跳转到主要内容

从glob表达式生成多个文件的模块的sphinx扩展

项目描述

sphinxcontrib-autofile

readthedocs pre-commit.ci status github/workflow codecov

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

从glob表达式生成多个文件的模块的sphinx扩展。

使用方法

以MyST为例。rst类似。

docs/conf.py:

# ...
extensions = [
    "myst_parser",
    "sphinxcontrib.autofile",
]
# ...

docs/index.md:

```{autofile} ../src/sphinxcontrib/autofile/*.py
:members:
```

它将被翻译成

```{eval-rst}
.. automodule:: sphinxcontrib.autofile
    :members:

.. automodule:: sphinxcontrib.autofile.directive
    :members:

... (more modules)
```

当你的模块很多时,它会节省你的时间。

自定义

```{autofile} ../src/sphinxcontrib/autofile/*.py
:prefix: your_prefix
:template: /the/path/of/your/template
```
  • prefix:如果你不使用src-layout,请更改它。
  • template:模板使用jinja语法。请参阅示例

替代方案

请参阅readthedocs 了解更多信息。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定该选择哪个,请了解更多关于安装包的信息。

源代码分发

sphinxcontrib-autofile-0.0.2.tar.gz (24.2 kB 查看哈希值)

上传时间: 源代码

构建分发

sphinxcontrib_autofile-0.0.2-py3-none-any.whl (18.1 kB 查看哈希值)

上传时间: Python 3

由以下机构支持