0

I use the following conf.py for a python project. The html generated files is nice and provide the auto generated documents from the codes, but the pdf file is almost empty and only includes conents in the rst files.


import os
import sys
import stanford_theme

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

extensions = ['sphinx.ext.todo',
              'sphinx.ext.viewcode',
              'sphinx.ext.autodoc',
              'sphinx.ext.githubpages',
              # 'sphinxcontrib.plantuml',
              'sphinx.ext.inheritance_diagram',
              'sphinx.ext.coverage',
              'sphinx.ext.napoleon',
              'sphinx.ext.imgmath',
              'sphinx.ext.mathjax'
              ]

templates_path = ['_templates']
exclude_patterns = ['_build']
html_theme = 'stanford_theme'
html_theme_path = [stanford_theme.get_html_theme_path()]
html_static_path = ['_static']


latex_elements = {
    'papersize': 'letterpaper',
    'pointsize': '12pt',
    'preamble': r"""
\usepackage{setspace}
"""
}

I use

make latex
cd build/latex
make

to produce pdf file. How do I make pdf files including the autogenerated docs from the source codes. I am using Sphinx(I think the latest version) on Ubuntu 20.04 machine.

Abolfazl
  • 1,047
  • 2
  • 12
  • 29

1 Answers1

0

I found it: The auto generated code is produced in an rst file:

Auto Generated Documentation 
==============================

.. automodule:: visualization
    :members:

I reference the file in index.rst

.. toctree::
   :maxdepth: 2

   code
Abolfazl
  • 1,047
  • 2
  • 12
  • 29