简体   繁体   中英

overwrite .rst files during Sphinx documentation

Let us say that we have a document structure that looks like the following

.
|____src
| |____abc.py
|____docs

Now we generate documentation with the command:

sphinx-apidoc -F -o docs src

This generates several files within the ./docs/ folder that, including a ./docs/abc.rst , which I can now build using a make html within the ./docs/ folder.

Now, after adding some additional function within ./src/abc.py I want to rebuild the documentation. I try the same things and Sphinx says that the rest file is already present and as a result, it doesn't get updates. I have to manually delete the relevant files before I can update the documentation.

Now the question is, how do I do the entire process without having to resort to deleting the .rst files.

sphinx-apidoc has a --force option for overwriting files.

See http://www.sphinx-doc.org/en/stable/man/sphinx-apidoc.html#sphinx-apidoc-manual-page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM