Skip to content

perellonieto/sphinx_apidoc_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sphinx_apidoc_example

A really simple example of using the sphinx-apidoc

To try this example just clone the package

git clone git@github.com:perellonieto/sphinx_apidoc_example.git

And then go into the created folder

cd sphinx_apidoc_example

And follow the next steps.

In order to create the documentation first it is necessary to generate all the configuration files. The easiest way is just to run the following script.

sphinx-apidoc -o docs -E -H PackageName -A "Author Name" -V 0.1 -f -F package/

where

  • -o Directory to place the output files.
  • -E Put each module file in its own page.
  • -H Project name to put into the configuration.
  • -A Author name(s) to put into the configuration.
  • -V Project version.
  • -f Usually, apidoc does not overwrite files, unless this option is given.
  • -F If given, a full Sphinx project is generated using sphinx-quickstart.

Then you need to modify the file docs/conf.py by adding the path to the root folder with the package.

import os
import sys
sys.path.insert(0, os.path.abspath('../'))

Now it is possible to generate the documentation by going to the docs folder and running the sphinx code. The easiest way is

cd docs
make html

It will generate an index.html in docs/_build/index.html and it should look somethink similar to this index.html

About

A really simple example of using the sphinx-apidoc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages