如何在非交互模式下使用 sphinx-quickstart?
How to use sphinx-quickstart in non-interactive mode?
当我运行sphinx-quickstart
时,它会问我一堆问题。
> Root path for the documentation [.]:
> Separate source and build directories (y/n) [n]:
> Name prefix for templates and static dir [_]:
> Project name: Foo
> Author name(s): Lone Learner
> Project version: 0.0.1
> Project release [0.0.1]:
> Project language [en]:
> Source file suffix [.rst]:
> Name of your master document (without suffix) [index]:
> Do you want to use the epub builder (y/n) [n]:
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
> doctest: automatically test code snippets in doctest blocks (y/n) [n]:
> intersphinx: link between Sphinx documentation of different projects (y/n) [n]:
> todo: write "todo" entries that can be shown or hidden on build (y/n) [n]:
> coverage: checks for documentation coverage (y/n) [n]:
> pngmath: include math, rendered as PNG images (y/n) [n]:
> mathjax: include math, rendered in the browser by MathJax (y/n) [n]:
> ifconfig: conditional inclusion of content based on config values (y/n) [n]:
> viewcode: include links to the source code of documented Python objects (y/n) [n]:
> Create Makefile? (y/n) [y]:
> Create Windows command file? (y/n) [y]:
对于其中的大部分问题,我只是按回车键接受默认值。
以下是我实际提供人工回答的仅有的四个问题。
> Project name: Foo
> Author name(s): Lone Learner
> Project version: 0.0.1
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
有没有办法告诉 sphinx-quickstart
使用这四个值并为所有其他问题使用默认值。换句话说,我想在完全非交互模式下使用 sphinx-quickstart
。这可能吗?
您可以使用 sphinx-quickstart 带有 -q 或 --quiet 选项的安静模式
这需要以下选项:
- -p(项目名称)
- -a(作者)
- -v(版本)
你可以添加 --ext-autodoc 来自动插入文档字符串
当我运行sphinx-quickstart
时,它会问我一堆问题。
> Root path for the documentation [.]:
> Separate source and build directories (y/n) [n]:
> Name prefix for templates and static dir [_]:
> Project name: Foo
> Author name(s): Lone Learner
> Project version: 0.0.1
> Project release [0.0.1]:
> Project language [en]:
> Source file suffix [.rst]:
> Name of your master document (without suffix) [index]:
> Do you want to use the epub builder (y/n) [n]:
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
> doctest: automatically test code snippets in doctest blocks (y/n) [n]:
> intersphinx: link between Sphinx documentation of different projects (y/n) [n]:
> todo: write "todo" entries that can be shown or hidden on build (y/n) [n]:
> coverage: checks for documentation coverage (y/n) [n]:
> pngmath: include math, rendered as PNG images (y/n) [n]:
> mathjax: include math, rendered in the browser by MathJax (y/n) [n]:
> ifconfig: conditional inclusion of content based on config values (y/n) [n]:
> viewcode: include links to the source code of documented Python objects (y/n) [n]:
> Create Makefile? (y/n) [y]:
> Create Windows command file? (y/n) [y]:
对于其中的大部分问题,我只是按回车键接受默认值。
以下是我实际提供人工回答的仅有的四个问题。
> Project name: Foo
> Author name(s): Lone Learner
> Project version: 0.0.1
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
有没有办法告诉 sphinx-quickstart
使用这四个值并为所有其他问题使用默认值。换句话说,我想在完全非交互模式下使用 sphinx-quickstart
。这可能吗?
您可以使用 sphinx-quickstart 带有 -q 或 --quiet 选项的安静模式
这需要以下选项:
- -p(项目名称)
- -a(作者)
- -v(版本)
你可以添加 --ext-autodoc 来自动插入文档字符串