Skip to content

gen_ref_pages

このように、ファイル名がページタイトル(h1 要素)となり、 以降は各関数が見出し(h2 要素)、小見出し(h3 要素)と続く。

すべて .py から抽出して来たものである。 これを普段から利用すれば、いずれはドキュメント駆動でコードを書く習慣が身につくはず!

setEditPath(directory) ¤

Generate pages on-the-fly via mkdocs-gen-files plugin

recipes に書いてある通り、 mkdocs-gen-filesmkdocs-literate-nav を使用して自動的にページを生成する。 この setEditPath() は、mkdocs_gen_files.set_edit_path() の wrapper である。 引数としてディレクトリを与えると、その配下にある .py ファイルを再帰的に走査し、 その全てから docstring を抽出してドキュメントを生成してくれる。

Parameters:

Name Type Description Default
directory Path

An pathlib.Path instance. In the given directory, Generate documentation by recursively looking for *.py files. cf. https://docs.python.org/ja/3/library/pathlib.html#pathlib.Path

required

Returns:

Type Description
None

None