0
0
mirror of https://github.com/thegeeklab/corenetworks.git synced 2024-11-24 20:10:40 +00:00

use pdoc to genrate markdown api docs

This commit is contained in:
Robert Kaussow 2020-04-14 21:35:47 +02:00
parent 5f7f9650a4
commit dbbfedff6d
6 changed files with 22 additions and 17 deletions

1
.gitignore vendored
View File

@ -110,3 +110,4 @@ resources/_gen/
# Misc
.local/
.corenetworks*
docs/api/corenetworks/

View File

@ -1,7 +1,9 @@
export GEEKDOC_VERSION ?= latest
BASE_DIR := docs
THEME := hugo-geekdoc
THEME_DIR := $(BASE_DIR)/themes
BASEDIR := docs
THEMEDIR := $(BASEDIR)/themes
APIDIR := $(BASEDIR)/content/api
PACKAGE := corenetworks
.PHONY: all
all: doc
@ -11,16 +13,17 @@ doc: doc-assets doc-generate
.PHONY: doc-assets
doc-assets:
mkdir -p $(THEME_DIR)/$(THEME)/ ; \
curl -sSL "https://github.com/xoxys/$(THEME)/releases/$${GEEKDOC_VERSION}/download/$(THEME).tar.gz" | tar -xz -C $(THEME_DIR)/$(THEME)/ --strip-components=1
mkdir -p $(THEMEDIR)/$(THEME)/ ; \
curl -sSL "https://github.com/xoxys/$(THEME)/releases/$${GEEKDOC_VERSION}/download/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1
.PHONY: doc-generate
doc-generate:
cd $(BASE_DIR) ; \
cp templates/usage_index.md content/usage/_index.md ; \
pydocmd simple corenetworks.authenticators++ corenetworks.client++ corenetworks.exceptions++ >> content/usage/_index.md
pdoc --template-dir $(BASEDIR)/templates/ -o $(APIDIR) --force \
$(PACKAGE).authenticators \
$(PACKAGE).client \
$(PACKAGE).exceptions
.PHONY: clean
clean:
rm -rf $(THEME_DIR) && \
rm -f $(BASE_DIR)/content/usage/_index.md
rm -rf $(THEMEDIR) && \
rm -rf $(APIDIR)/$(PACKAGE)

View File

@ -18,4 +18,4 @@ pytest-cov
bandit
requests-mock
yapf
pydoc-markdown
pdoc; python_version >= "3.6"

View File

@ -2,5 +2,11 @@
main:
- name: Setup
ref: "/setup"
- name: Usage
ref: "/usage"
- name: API
sub:
- name: corenetworks.authenticators
ref: "/api/corenetworks/authenticators"
- name: corenetworks.client
ref: "/api/corenetworks/client"
- name: corenetworks.exceptions
ref: "/api/corenetworks/exceptions"

View File

@ -1,5 +0,0 @@
---
title: Usage
---
{{< toc >}}