0
0
mirror of https://github.com/thegeeklab/corenetworks.git synced 2024-11-21 21:20:38 +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 # Misc
.local/ .local/
.corenetworks* .corenetworks*
docs/api/corenetworks/

View File

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

View File

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

View File

@ -2,5 +2,11 @@
main: main:
- name: Setup - name: Setup
ref: "/setup" ref: "/setup"
- name: Usage - name: API
ref: "/usage" 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 >}}