Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Template - Something is not working at all #494

Open
luckylinux opened this issue Oct 18, 2024 · 0 comments
Open

Custom Template - Something is not working at all #494

luckylinux opened this issue Oct 18, 2024 · 0 comments

Comments

@luckylinux
Copy link

luckylinux commented Oct 18, 2024

I tried following the Tutorial from the Official Documentation but for some weird Reason, nothing seems to work 😞.

I'm quite new to Python, so there might be something that I got wrong in either my Project Layout or the Way sphinx and/or sphinx-autoapi works.

First of all, the Namespace of the Python Project is (in my View) evaluated wrongly by sphinx-autoapi.

For a Work related Project, I'm using a src-Layout with a Package Namespace private.company.namespace.mytest001 and a Module private.company.namespace.mytest001.example.
The Package is Located in $PYTHONPATH/private/company/namespace/mytest001 while the src Tree is located in $PYTHONPATH/private/company/namespace/mytest001/src/private/company/namespace/mytest001/example.py, as it should be.

I manually configured some autodoc based Jinja2 Templates to render the Documentation, and those work correctly, using the FULL Package Namespace private.company.namespace.mytest001.<module>.<Class|Function/...>.

On the other Hand, sphinx-autoapi is quite stubborn and just uses mytest001 as the "root" Namespace.

conf.py:

#######################################################################################################
# !! WARNING: DO NOT EDIT THIS FILE DIRECTLY. THIS FILE IS AUTOMATICALLY GENERATED FROM A TEMPLATE !! #
#######################################################################################################

import os
import sys
import pprint
sys.path.insert(0, os.path.abspath(os.path.join('..', '..', '..', 'src')))

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'private.company.namespace.mytest001'
copyright = '2024, FirstName LastName'
author = 'FirstName LastName'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
    'sphinx_rtd_theme' ,                # Use Sphinx ReadTheDocs HTML Theme
    'sphinx.ext.napoleon' ,             # Support Google-Style and NumPy-Style Docstrings
    'sphinx.ext.duration',
    'sphinx.ext.doctest',
    'sphinx.ext.autodoc' ,              # Core library for html generation from docstrings
    'sphinx.ext.autodoc.typehints' ,    # Render type annotations as parameter types and return types
    'sphinx.ext.viewcode' ,
    'sphinx.ext.autosummary',           # Create neat summary tables
    #'sphinx.ext.autosectionlabel' ,     # Allow reference sections using its title
    'sphinx.ext.extlinks' ,             # Markup to shorten external links
    'sphinx.ext.coverage' ,             # Collect Documentation Coverage Statistics
    'sphinx.ext.graphviz' ,             # Add Graphviz graphs
    'sphinx.ext.intersphinx' ,          # Link to other projects' documentation
    'sphinx.ext.linkcode' ,             # Add external links to source code
    'sphinx.ext.todo' ,                 # Support for todo items

    #'sphinx_immaterial'  ,             # Use Sphinx Immaterial Extension
    #'sphinxcontrib.apidoc',
    'autoapi.extension' , 
    'sphinx.ext.inheritance_diagram' ,  # requires Graphviz to be installed
    
]

# sphinx-apidoc Options
#apidoc_module_dir = '../src'
#apidoc_output_dir = 'reference'
#apidoc_excluded_paths = ['tests']
#apidoc_separate_modules = True

#apidoc_extra_args = [
#    #'--implicit-namespaces',
#    '--private',  # include "_private" modules
#]

# sphinx-autodoc Options
autodoc_default_options = {
    'members': True,
    # The ones below should be optional but work nicely together with
    # example_package/autodoctest/doc/source/_templates/autosummary/class.rst
    # and other defaults in sphinx-autodoc.
    'show-inheritance': True ,
    'inherited-members': True ,
    'no-special-members': True ,
}

autodoc_mock_imports = [
    'tensorflow',
    'flask',
    'numpy',
    'plotly',
    'tqdm',
    'StringIO',
    'lime',
    'vis',
    'efficientnet_pytorch',
    'pycocotools',
    'repo.trainer.self_trainer_model',
    'theano',
    'sklearn',
    'torch',
    'telegram',
    'msvcrt',
    'bs4',
    'livereload',
    'repo.common.config',
    'plotting_server',
    'experiments',
    'cropper',
    "anytree",
    "skimage"
]

#autodoc_typehints = 'description'
autodoc_typehints = 'none'

# Use FullName
add_module_names = True

# sphinx-autoapi Options
autoapi_root = 'reference'
autoapi_generate_api_docs = True
#autoapi_generate_api_docs = True
#autoapi_type = 'python'

autoapi_python_use_implicit_namespaces = False
autoapi_dirs = ['../../../src']

autoapi_add_toctree_entry = True

#autoapi_python_use_implicit_namespaces = True
#autoapi_dirs = ['../../../src/private/company/namespace/mytest001']

#autoapi_template_dir = '../../../docs/sphinx/source/_autoapi_templates'
autoapi_template_dir = '_autoapi_templates'

autoapi_member_order = 'alphabetical'

autoapi_own_page_level = 'attribute'

autoapi_ignore = []

# Turn on sphinx.ext.autosummary
autosummary_generate = True


templates_path = ['_templates']
exclude_patterns = []
#exclude_patterns = ["_autoapi_templates"]



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

# Set HTML Theme
# html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"
# html_theme = 'sphinx_immaterial'

html_static_path = ['_static']


# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_preprocess_types = False
napoleon_type_aliases = None
napoleon_attr_annotations = True

# sphinx.ext.linkcode Configuration
def linkcode_resolve(domain, info):
    #pprint.pprint(domain)
    #pprint.pprint(info)

    if domain != 'py':
        return None
    if not info['module']:
        return None

    # This is just the quick & dirty "implementation"
    ns = project
    nspath = ns.replace('.' , '/')

    fullfilepath = info['module']
    fullfilepath = fullfilepath.replace('.' , '/')

    filename = info['module'].replace(ns , '')
    filename = filename.replace('.', '/')
    filename = filename.rstrip('/')

    #return "https://somesite/sourcerepo/%s.py" % filename
    return f"https://gitlab.example.com/{nspath}/tree/main/src/{fullfilepath}.py"


#[build_sphinx]
#all_files = 1
#build-dir = "docs/build"
#source-dir = "docs/source"

Hence I tried Configuring the autoapi_template_dir according to the Documentation, but all I get is lots of errors while running make html (similarly for LaTeX / PDF Generation) ....

(venv) PS C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx> .\make.bat html
Running Sphinx v8.1.3
loading translations [en]... done
loading pickled environment... The configuration has changed (1 option: 'linkcode_resolve')
done
[autosummary] generating autosummary for: _autoapi_templates\index.rst, _autoapi_templates\python\attribute.rst, _autoapi_templates\python\class.rst, _autoapi_templates\python\data.rst, _autoapi_templates\python\exception.rst, _autoapi_templates\python\function.rst, _autoapi_templates\python\method.rst, _autoapi_templates\python\module.rst, _autoapi_templates\python\package.rst, _autoapi_templates\python\property.rst, api.rst, index.rst
[AutoAPI] Reading files... [ 50%] C:\Users\USERNAME\Programming\private\company\namespace\mytest001\src\private\company\namespace\mytest001\example.p[AutoAPI] Reading files... [100%] C:\Users\USERNAME\Programming\private\company\namespace\mytest001\src\private\company\namespace\mytest001\__init__.py
[AutoAPI] Mapping Data... [100%] C:\Users\USERNAME\Programming\private\company\namespace\mytest001\src\private\company\namespace\mytest001\__init__.py
[AutoAPI] Rendering Data... [ 17%] mytest001
[AutoAPI] Rendering Data... [ 33%] mytest001.example
[AutoAPI] Rendering Data... [ 50%] mytest001.example.ClassA
[AutoAPI] Rendering Data... [ 67%] mytest001.example.ClassB
[AutoAPI] Rendering Data... [ 83%] mytest001.example.main
[AutoAPI] Rendering Data... [100%] mytest001.__path__

building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 7 source files that are out of date
updating environment: 0 added, 11 changed, 0 removed
[AutoAPI] Adding AutoAPI TOCTree [reference/index] to index.rst
reading sources... [100%] reference/mytest001/index
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\index.rst:6: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/{% for page in pages|selectattr("is_top_level_object") %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\index.rst:6: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/{{ page.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\index.rst:6: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/{% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:3: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:10: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:10: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% for child in own_page_children %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:10: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ child.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:10: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:10: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:53: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:66: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:79: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:92: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst:104: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:3: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:6: ERROR: Error in "py:module" directive:
maximum 1 argument(s) allowed, 3 supplied.

.. py:module:: {{ obj.name }}

      {% if obj.docstring %} [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:18: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% for subpackage in visible_subpackages %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ subpackage.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% endblock %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% block submodules %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% set visible_submodules = obj.submodules|selectattr("display")|list %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:21: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% if visible_submodules %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:34: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% for submodule in visible_submodules %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ submodule.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% endblock %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/   {% block content %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% set visible_children = obj.children|selectattr("display")|list %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/      {% if visible_children %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/         {% if visible_attributes %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:37: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/            {% if "attribute" in own_page_types or "show-module-summary" in autoapi_options %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:53: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:57: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:57: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% for attribute in visible_attributes %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:57: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ attribute.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:57: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:57: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/               {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:77: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:81: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:81: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% for exception in visible_exceptions %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:81: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ exception.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:81: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:81: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/               {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:101: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:105: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:105: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% for klass in visible_classes %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:105: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ klass.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:105: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:105: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/               {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:125: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:129: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:129: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% for function in visible_functions %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:129: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/{{ function.include_path }}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:129: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/                  {% endfor %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:129: WARNING: toctree contains reference to nonexisting document '_autoapi_templates/python/               {% endif %}' [toc.not_readable]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:148: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:152: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:154: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:155: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:156: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:157: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:158: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:158: ERROR: Error in "py:module" directive:
maximum 1 argument(s) allowed, 3 supplied.

.. py:module:: {{ obj.name }}

      {% if obj.docstring %}
   .. autoapi-nested-parse::

      {{ obj.docstring|indent(6) }}

      {% endif %}
      {% for obj_item in visible_children %}
   {{ obj_item.render()|indent(3) }}
      {% endfor %}
   {% endif %} [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst:170: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\index.rst:17: WARNING: toctree contains reference to nonexisting document 'install' [toc.not_readable]
looking for now-outdated files... none found
pickling environment... done
checking consistency... C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\index.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\attribute.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\class.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\data.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\exception.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\function.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\method.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\module.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\package.rst: WARNING: document isn't included in any toctree
C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\source\_autoapi_templates\python\property.rst: WARNING: document isn't included in any toctree
done
preparing documents... done
copying assets...
copying static files...
Writing evaluated template result to C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\build\html\_static\basic.css
Writing evaluated template result to C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\build\html\_static\documentation_options.js
Writing evaluated template result to C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\build\html\_static\language_data.js
Writing evaluated template result to C:\Users\USERNAME\Programming\private\company\namespace\mytest001\docs\sphinx\build\html\_static\js\versions.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [100%] reference/mytest001/index
generating indices... genindex py-modindex done
highlighting module code... [100%] private.company.namespace.mytest001.example
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done

====================== slowest reading durations =======================
0.032 _autoapi_templates/index
0.032 index
0.016 reference/mytest001/__path__
0.015 _autoapi_templates/python/class
0.015 _autoapi_templates/python/module
build succeeded, 81 warnings.

The HTML pages are in build\html.

I also tried adding some MY_DEBUG_TEXT in Several of these Custom Templates, but nothing of it can be found in the generated HTML Documentation (or LaTeX/PDF for that Matter).

It's like sphinx-autoapi doesn't want to use these Files no matter what, but sphinx itself does (and complains about it) unless this Folder gets added to the exclude_patterns list ...

The Templates are located in docs/sphinx/source/_autoapi_templates like the Documentation states ("relative to the root of the documentation source directory").

The docs/sphinx/source/_autoapi_templates contains ALL Files from the Original templates Folder of the autoapi Package, including index.rst.

Is there something fundamentally wrong ?

EDIT 1: Based on another Issue, I tried docs/sphinx/source/_templates/_autoapi instead of docs/sphinx/source/_autoapi_templates and indeed there it works and shows the customized Template.

Quite a shame that it needs such workarounds "just" because of the wrong Namespace. I just don't see why sphinx-autoapi works like this. Is it ignoring PYTHONPATH Environment Variables or just assuming it's the same as the Project Root Folder or something ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant