|  | 
| 18 | 18 | # If extensions (or modules to document with autodoc) are in another directory, | 
| 19 | 19 | # add these directories to sys.path here. If the directory is relative to the | 
| 20 | 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. | 
| 21 |  | -sys.path.insert(0, os.path.abspath('../pythonrepo')) | 
|  | 21 | +sys.path.insert(0, os.path.abspath('../')) | 
|  | 22 | +sys.path.insert(1, os.path.abspath('./pythonrepo')) | 
| 22 | 23 | 
 | 
| 23 | 24 | # -- General configuration ----------------------------------------------------- | 
| 24 | 25 | 
 | 
| 25 | 26 | # If your documentation needs a minimal Sphinx version, state it here. | 
| 26 |  | -needs_sphinx = '4.0' | 
|  | 27 | +needs_sphinx = '5.3' | 
| 27 | 28 | 
 | 
| 28 | 29 | # Add any Sphinx extension module names here, as strings. They can be extensions | 
| 29 | 30 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | 
|  | 31 | +# for md us 'autodoc2' (pip install sphinx-autodoc2) | 
|  | 32 | +# for rst use 'sphinx.ext.autodoc' | 
| 30 | 33 | extensions = [ | 
| 31 |  | -				'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.githubpages', | 
|  | 34 | +				'sphinx.ext.napoleon', 'autodoc2', 'sphinx.ext.autosummary', | 
|  | 35 | +				'sphinx.ext.githubpages', | 
| 32 | 36 | 				'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.todo', | 
| 33 |  | -				'sphinx.ext.linkcode', 'sphinx.ext.viewcode' | 
|  | 37 | +				'sphinx.ext.linkcode', 'sphinx.ext.viewcode', 'myst_parser' | 
| 34 | 38 | 			] | 
| 35 | 39 | 
 | 
|  | 40 | +# for md auto-docs | 
|  | 41 | +autodoc2_packages = [ | 
|  | 42 | +	"pythonrepo", | 
|  | 43 | +	"tests", | 
|  | 44 | +] | 
|  | 45 | + | 
|  | 46 | +autodoc2_render_plugin = "myst" | 
|  | 47 | + | 
| 36 | 48 | # Add any paths that contain templates here, relative to this directory. | 
| 37 | 49 | templates_path = ['_templates'] | 
| 38 | 50 | 
 | 
| 39 | 51 | # The suffix of source filenames. | 
| 40 | 52 | source_suffix = { | 
| 41 |  | -	'.rst': 'restructuredtext', | 
| 42 | 53 | 	'.md': 'markdown', | 
|  | 54 | +	'.txt': 'markdown', | 
|  | 55 | +	'.rst': 'restructuredtext', | 
| 43 | 56 | } | 
| 44 | 57 | 
 | 
| 45 | 58 | # The encoding of source files. Official sphinx docs reccomend utf-8-sig. | 
| 46 | 59 | source_encoding = 'utf-8-sig' | 
| 47 | 60 | 
 | 
| 48 | 61 | # The master toctree document. | 
| 49 |  | -master_doc = 'index' | 
|  | 62 | +master_doc = 'toc' | 
| 50 | 63 | 
 | 
| 51 | 64 | # General information about the project. | 
| 52 | 65 | project = u'python_template' | 
|  | 
| 74 | 87 | 
 | 
| 75 | 88 | # List of patterns, relative to source directory, that match files and | 
| 76 | 89 | # directories to ignore when looking for source files. | 
| 77 |  | -exclude_patterns = ['_build', '.github/', '.circleci/', 'dist', 'tests'] | 
|  | 90 | +exclude_patterns = ['_build', '.github', '.circleci', '.DS_Store', '**/.git', 'dist', 'tests'] | 
| 78 | 91 | 
 | 
| 79 | 92 | # The reST default role (used for this markup: `text`) to use for all documents. | 
| 80 | 93 | # default_role = None | 
|  | 
| 86 | 99 | # unit titles (such as .. function::). | 
| 87 | 100 | add_module_names = True | 
| 88 | 101 | 
 | 
|  | 102 | +# sigs should not have backslashes | 
|  | 103 | +strip_signature_backslash = True | 
|  | 104 | + | 
| 89 | 105 | # If true, sectionauthor and moduleauthor directives will be shown in the | 
| 90 | 106 | # output. They are ignored by default. | 
| 91 |  | -show_authors = False | 
|  | 107 | +show_authors = True | 
| 92 | 108 | 
 | 
| 93 | 109 | # The name of the Pygments (syntax highlighting) style to use. | 
|  | 110 | +# pygments_style = 'py' | 
| 94 | 111 | pygments_style = 'default' | 
| 95 | 112 | 
 | 
| 96 | 113 | # A list of ignored prefixes for module index sorting. | 
| 97 | 114 | # modindex_common_prefix = [] | 
| 98 | 115 | 
 | 
|  | 116 | +# Create table of contents entries for domain objects (e.g. functions, classes, attributes, etc.). | 
|  | 117 | +toc_object_entries = True | 
| 99 | 118 | 
 | 
| 100 | 119 | # -- Options for HTML output --------------------------------------------------- | 
| 101 | 120 | 
 | 
| 102 | 121 | # The theme to use for HTML and HTML Help pages.  See the documentation for | 
| 103 | 122 | # a list of builtin themes. | 
| 104 |  | -html_theme = 'default' | 
|  | 123 | +html_theme = 'sphinxawesome_theme' | 
| 105 | 124 | 
 | 
| 106 | 125 | # Theme options are theme-specific and customize the look and feel of a theme | 
| 107 | 126 | # further.  For a list of options available for each theme, see the | 
|  | 
| 116 | 135 | # html_title = None | 
| 117 | 136 | 
 | 
| 118 | 137 | # A shorter title for the navigation bar.  Default is the same as html_title. | 
| 119 |  | -# html_short_title = None | 
|  | 138 | +html_short_title = 'Project Docs' | 
| 120 | 139 | 
 | 
| 121 | 140 | # The name of an image file (relative to this directory) to place at the top | 
| 122 | 141 | # of the sidebar. | 
|  | 
| 127 | 146 | # pixels large. | 
| 128 | 147 | # html_favicon = None | 
| 129 | 148 | 
 | 
|  | 149 | +html_permalinks_icon = '<span>#</span>' | 
|  | 150 | + | 
| 130 | 151 | # Add any paths that contain custom static files (such as style sheets) here, | 
| 131 | 152 | # relative to this directory. They are copied after the builtin static files, | 
| 132 | 153 | # so a file named "default.css" will overwrite the builtin "default.css". | 
|  | 
| 177 | 198 | htmlhelp_basename = 'python_repo_doc' | 
| 178 | 199 | 
 | 
| 179 | 200 | 
 | 
|  | 201 | +# -- Options for MyST markdown parser ------------------------------------------- | 
|  | 202 | +# see https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#syntax-directives | 
|  | 203 | + | 
|  | 204 | +# be more like GFM with style | 
|  | 205 | +myst_enable_extensions = set(['tasklist', 'strikethrough', 'fieldlist']) | 
|  | 206 | + | 
|  | 207 | +# for GFM diagrams and interoperability with other Markdown renderers | 
|  | 208 | +myst_fence_as_directive = set(('mermaid', 'suggestion', 'note')) | 
|  | 209 | + | 
|  | 210 | +# Focus only on github markdown | 
|  | 211 | +myst_gfm_only = False | 
|  | 212 | + | 
|  | 213 | + | 
|  | 214 | +#heading_anchors = 1 | 
|  | 215 | + | 
|  | 216 | +# -- Options for napoleon ext -------------------------------------------------- | 
|  | 217 | + | 
|  | 218 | +# include __init__ when it has docstrings | 
|  | 219 | +napoleon_include_init_with_doc = True | 
|  | 220 | + | 
|  | 221 | +# try to be smarter | 
|  | 222 | +napoleon_preprocess_types = True | 
|  | 223 | + | 
| 180 | 224 | # -- Options for LaTeX output -------------------------------------------------- | 
| 181 | 225 | 
 | 
| 182 | 226 | latex_elements = {} | 
|  | 
| 266 | 310 | 
 | 
| 267 | 311 | # How to display URL addresses: 'footnote', 'no', or 'inline'. | 
| 268 | 312 | # texinfo_show_urls = 'footnote' | 
|  | 313 | + | 
|  | 314 | +# -- Link resolver ------------------------------------------------------------- | 
|  | 315 | +def linkcode_resolve(domain, info): | 
|  | 316 | +	if domain != 'py': | 
|  | 317 | +		return None | 
|  | 318 | +	if not info['module']: | 
|  | 319 | +		return None | 
|  | 320 | +	filename = info['module'].replace('.', '/') | 
|  | 321 | +	return "https://github.com/reactive-firewall/python-repo/blob/stable/%s.py" % filename | 
0 commit comments