在Sphinx中,如何在源文件夹中创建第一个文件(比如使用某种方法),然后只扫描第一个文件的源文件?

时间:2018-06-06 13:57:25

标签: python python-sphinx restructuredtext

输入sphinx-build命令时,请说

sphinx-build -b html source/ build /home/mypc/src/sphinx/source/sample.jsonl

我写了一个扩展名,我保存在source / extensions文件夹中。此扩展程序获得sys.argv[5],即/home/mypc/src/sphinx/source/sample.jsonl,然后在rst的源代码中创建一些sample.jsonl个文件。但是当我运行sphinx-build命令时,只处理index.rst而不是新创建的rst文件,即使它们位于源文件夹中。我知道它必须对处理顺序做一些事情。另一个奇怪的事情是,当我在我的sphinx扩展中硬编码sample.jsonl的路径时,似乎也创建了其他rst文件的html。

一些日志:

Running Sphinx v1.7.5
making output directory...
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are specified
building [html]: 1 source files given on command line
updating environment: 7 added, 0 changed, 0 removed
reading sources... [100%] index                                                                                                                
/home/vibin/src/sphinx/source/2018-05-10.rst:80: WARNING: Literal block expected; none found.
/home/vibin/src/sphinx/source/2018-05-18.rst:47: WARNING: Literal block expected; none found.
/home/vibin/src/sphinx/source/2018-05-21.rst:45: WARNING: Literal block expected; none found.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... WARNING: search index couldn't be loaded, but not all documents will be built: the index will be incomplete.
done
writing output... [100%] index                                                                                                                 
generating indices... genindex
writing additional pages... search
copying static files... WARNING: html_static_path entry '/home/vibin/src/sphinx/source/_static' does not exist
done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 5 warnings.

The HTML pages are in build.

0 个答案:

没有答案
相关问题