This is the 19th day of my participation in the August Wenwen Challenge.More challenges in August
This article is a continuation of a small but comprehensive project from the previous article
Sphinx Sphinx Sphinx Sphinx Sphinx Sphinx Sphinx Sphinx Sphinx Sphinx
Write an essay and recommend it.
Install Sphinx (document generation tool)
pip install -U Sphinx
Generate the default document configuration
sphinx-quickstart
I chose not to separate the code from the documentation.
Generating documentation
sphinx-build -b html . _build
Because we didn’t choose to separate the code from the document, sphinx scanned all directories instead of our module code and got the following error:
Checking consistency… / Users/MAC/python/python_sample/lib/python3.8 / site – packages/Jinja2-2.11.3. Dist – info/LICENSE. RST: WARNING: the document did not join any directory tree
/ Users/MAC/python/python_sample/lib/python3.8 / site – packages/MarkupSafe – 1.1.1. Dist – info/LICENSE. RST: WARNING: The document is not added to any directory tree
This error can be ignored without preventing document generation.
View the default generated document
Open the browser and access the current directory /_build/index.html to view.
How does Sphinx work?
The default document declaration files Makefile and conf.py were generated above using sphinx-Quickstart, where the Makefile specifies the project information and the source directory (in this case, sphinx’s source).
Sphinx then takes the found source (*.rst, suffix.rst file) and parses to generate an HTML file with the same name.
Learning committee development experience Tips
The whole process is quick, adding these issues to generate documentation, best early in the project!
As time goes on, the project grows, for example, the various apis have to be documented and that takes more time.
It takes more time, that’s for sure.
:ref specifies the three hyperlinks in the index.html page above.
www.sphinx.org.cn/
By the way, there is also this can pay attention to long-term reading => Thunder committee interesting programming story compilation or => Thunder Committee NodeJS hobby series
Continuous learning and continuous development, I am Lei Xuewei! Programming is fun. The key is to get the technology right. Creation is not easy, please support, like collection support committee!