Skip to content

Commit 72fffb2

Browse files
Add Nitrokey Python SDK documentation
Fixes: #329
1 parent a6297ee commit 72fffb2

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build
22
dist
33
venv
4+
nitrokey-sdk-py*

Makefile

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1+
NITROKEY_SDK_PY_VERSION ?= v0.2.3
2+
NITROKEY_SDK_PY_CHECKSUM ?= b0547efe0bce6907f831a80297baf5393825037d3996edd6cf9f1ccc796e736e
13

4+
NITROKEY_SDK_PY_URL := https://github.com/Nitrokey/nitrokey-sdk-py/archive/refs/tags/$(NITROKEY_SDK_PY_VERSION).tar.gz
5+
NITROKEY_SDK_PY := nitrokey-sdk-py-$(NITROKEY_SDK_PY_VERSION)
6+
NITROKEY_SDK_PY_ARCHIVE := $(NITROKEY_SDK_PY).tar.gz
7+
NITROKEY_SDK_PY_LINK := source/components/software/nitrokey-sdk-py
28

3-
9+
.PHONY: all
410
all: venv
511
venv/bin/sphinx-build -j auto -b html -D language=en -d build/en/doctrees source dist/en
612

7-
venv:
13+
.PHONY: venv
14+
venv: $(NITROKEY_SDK_PY)
815
python -m venv venv
916
venv/bin/pip3 install -r requirements.txt
17+
venv/bin/pip3 install ./$(NITROKEY_SDK_PY)
18+
19+
$(NITROKEY_SDK_PY): $(NITROKEY_SDK_PY_ARCHIVE)
20+
mkdir "$@"
21+
tar --directory "$@" --extract --strip-components 1 --file "$<"
22+
rm -f $(NITROKEY_SDK_PY_LINK)
23+
ln -s ../../../$(NITROKEY_SDK_PY)/docs $(NITROKEY_SDK_PY_LINK)
24+
25+
$(NITROKEY_SDK_PY_ARCHIVE):
26+
curl "$(NITROKEY_SDK_PY_URL)" --location --output "$@"
27+
echo "$(NITROKEY_SDK_PY_CHECKSUM) $@" | sha256sum -c
1028

29+
.PHONY: clean
1130
clean:
12-
rm -rf dist build venv
31+
rm -rf dist build venv nitrokey-sdk-py* $(NITROKEY_SDK_PY_LINK)

source/components/software/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Software
77

88
nk-app2/index
99
nitropy/index
10+
nitrokey-sdk-py/index

source/conf.py

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4040
# ones.
4141
extensions = [
42+
'sphinx.ext.autodoc',
4243
'sphinx.ext.todo',
4344
'sphinx.ext.coverage',
4445
#'sphinx_copybutton',
@@ -434,3 +435,9 @@
434435

435436
# Disables the closing of tabs if clicked on the currently active tab
436437
sphinx_tabs_disable_tab_closing = True
438+
439+
# -- Options for autodoc extension -------------------------------------------
440+
441+
autodoc_class_signature = 'separated'
442+
autodoc_member_order = 'groupwise'
443+
autodoc_typehints = 'description'

0 commit comments

Comments
 (0)