スフィンクスクイックスタートというコマンドを入力すると、何度も値を入力する必要があります。たとえば
:Sphinx:Sphinxを使用してドキュメントを生成する方法
> Root path for the documentation [.]:
> Separate source and build directories (y/n) [n]:
> Name prefix for templates and static dir [_]:
> Project name:
> Author name(s):
> Project version []:
> Project release []:
> 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]:
> 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]:
> imgmath: include math, rendered as PNG or SVG 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]:
> githubpages: create .nojekyll file to publish the document on GitHub pages (y/n) [n]:
> Create Makefile? (y/n) [y]:
> Create Windows command file? (y/n) [y]:
たちは、この退屈な仕事する必要がないこと周り方法はありますか?
たとえば、bashスクリプトやpythonスクリプトはありますか?
関連する引数は次のとおりです。
> Project name: My Project
> Author name(s): My Name
> Project version []: 1
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
> doctest: automatically test code snippets in doctest blocks (y/n) [n]: y
> viewcode: include links to the source code of documented Python objects (y/n) [n]: y
すべての残りの部分だけで、空の文字列です。
私の試み
printf '\n\n\nMyProject\nBhishan Poudel\n1\n\n\n\n\n\ny\ny\n\n\n\n\n\n\ny\n\n\n\n' | sphinx-quickstart
試み2
# run_sphinx_quickstart.py
#!/usr/bin/env python3
import subprocess
sphinx_args = {
'Root_path' : '',
'Separate_source' : '',
'Name_prefix' : '',
'Project_name' : 'My Project',
'Author_name' : 'Bhishan Poudel',
'Project_version' : '1',
'Project_release' : '',
'Project_language' : 'en',
'Source_file' : '.rst',
'master_document' : 'index',
'epub' : '',
'autodoc' : 'y',
'doctest' : 'y',
'intersphinx' : 'n',
'todo' : 'n',
'coverage' : 'n',
'imgmath' : 'n',
'mathjax' : 'n',
'ifconfig' : 'n',
'viewcode' : 'y',
'githubpages' : 'n',
'Makefile' : 'y',
'Windows_Makefile ': 'n' }
for k,v in sphinx_args.items():
print(k,'\t\t:', v)
subprocess.call('sphink-quickstart', shell=True)
# I don't know how to caputre the outputs of shell commands!!
ヘルプは本当に理解されるであろう。
関連リンク:
ありがとう、1つのフォローアップの質問、これはプロジェクトと呼ばれるフォルダを作成します、私たちはどのようにPWDから "make html"を実行できますか? –
bash "./Project/Makefile"が失敗します。 –