[root@localhost doc]# /usr/local/python3/bin/sphinx-quickstart Welcome to the Sphinx 3.1.2 quickstart utility.
Please enter values for the following settings (just press Enter to accept a default value, if one is given in brackets).
Selected root path: .
You have two options for placing the build directory for Sphinx output. Either, you use a directory "_build" within the root path, or you separate "source" and "build" directories within the root path. > Separate source and build directories (y/n) [n]: y
The project name will occur in several places in the built documentation. > Project name: auto_try > Author name(s): fatboy > Project release []: 1.0
If the documents are to be written in a language other than English, you can select a language here by its language code. Sphinx will then translate text that it generates into that language.
For a list of supported codes, see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language. > Project language [en]: zh_cn
Finished: An initial directory structure has been created.
You should now populate your master file /jscan/tools_/auto_doc_try/doc/source/index.rst and create other do source files. Use the Makefile to build the docs, like so: make builder where"builder" is one of the supported builders, e.g. html, latex or linkcheck.
import os import sys sys.path.insert(0, os.path.abspath('./../../code'))
这里要配好,不然待会生成文档的时候会报找不到模块的错
1 2 3 4 5 6
WARNING: autodoc: failed to import module '1'; the following exception was raised: No module named '1' WARNING: autodoc: failed to import module '2'; the following exception was raised: No module named '2' WARNING: autodoc: failed to import module 'doc'; the following exception was raised: No module named 'doc'
[root@localhost doc]# make html Running Sphinx v3.1.2 loading translations [zh_cn]... done loading pickled environment... done building [mo]: targets for 0 po files that are out of date building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed looking for now-outdated files... none found no targets are out of date. build succeeded.