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:
parent
5f7f9650a4
commit
dbbfedff6d
1
.gitignore
vendored
1
.gitignore
vendored
@ -110,3 +110,4 @@ resources/_gen/
|
|||||||
# Misc
|
# Misc
|
||||||
.local/
|
.local/
|
||||||
.corenetworks*
|
.corenetworks*
|
||||||
|
docs/api/corenetworks/
|
||||||
|
21
Makefile
21
Makefile
@ -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)
|
||||||
|
@ -18,4 +18,4 @@ pytest-cov
|
|||||||
bandit
|
bandit
|
||||||
requests-mock
|
requests-mock
|
||||||
yapf
|
yapf
|
||||||
pydoc-markdown
|
pdoc; python_version >= "3.6"
|
||||||
|
@ -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"
|
||||||
|
5
docs/templates/usage_index.md
vendored
5
docs/templates/usage_index.md
vendored
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
title: Usage
|
|
||||||
---
|
|
||||||
|
|
||||||
{{< toc >}}
|
|
Loading…
Reference in New Issue
Block a user