|
5 | 5 | from datetime import date |
6 | 6 |
|
7 | 7 |
|
8 | | -# --- Project information ----------------------------------------------------- |
9 | | - |
10 | | -# General info about the TEMPLATE documentation itself |
11 | 8 | project = "cookiecutter-robust-python Template Documentation" |
12 | | -# Copyright year and author name |
13 | | -copyright = f"{date.today().year}, Kyle Oliver" # Dynamically get current year |
| 9 | +copyright = f"{date.today().year}, Kyle Oliver" # noqa |
14 | 10 |
|
15 | | -# Author name |
16 | 11 | author = "Kyle Oliver" |
17 | 12 |
|
18 | | -# The version info for the TEMPLATE. Using Calendar Versioning: YYYY.MM.DD |
19 | | -# **UPDATE MANUALLY OR VIA SIMPLE SCRIPT WITH EACH TEMPLATE RELEASE** |
20 | | -# This version tracks the template"s development state, not generated projects. |
21 | | -release = "2025.04.28" # Example: YYYY.MM.DD - **UPDATE MANUALLY** |
22 | | -# The short X.Y version for the template (YYYY.MM) |
23 | | -version = "2025.04" # Example: YYYY.MM - **UPDATE MANUALLY** |
| 13 | +release = "2025.04.28" |
| 14 | +version = "2025.04" |
24 | 15 |
|
25 | 16 | extensions = [ |
26 | | - "sphinx.ext.intersphinx", # Link to documentation of other projects |
27 | | - "sphinx.ext.napoleon", # Support for Google and NumPy style docstrings (useful for understanding code mentioned) |
28 | | - "myst_parser", # Support for parsing Markdown files (.md) |
29 | | - "sphinx_autodoc_typehints", # Better rendering of type hints (useful for understanding code mentioned/evaluated) |
30 | | - "sphinx_copybutton", # Adds a "copy" button to code blocks (Excellent QoL) |
31 | | - "sphinx_tabs.tabs", # Adds tab support (Useful for showing OS-specific commands/configs, code variants) |
| 17 | + "sphinx.ext.intersphinx", |
| 18 | + "sphinx.ext.napoleon", |
| 19 | + "myst_parser", |
| 20 | + "sphinx_autodoc_typehints", |
| 21 | + "sphinx_copybutton", |
| 22 | + "sphinx_tabs.tabs", |
32 | 23 | ] |
33 | | -templates_path = ["_templates"] # Create this directory if needed |
| 24 | +templates_path = ["_templates"] |
34 | 25 |
|
35 | | -# List of patterns relative to source directory, that match files/directories to ignore. |
36 | 26 | exclude_patterns = [ |
37 | | - "_build", # Output directory |
38 | | - "Thumbs.db", # MacOS files |
39 | | - ".DS_Store", # MacOS files |
40 | | - ".venv", # Standard virtual environment directory |
41 | | - ".nox", # Nox environment directory (for template docs build) |
42 | | - # EXCLUDE THE GENERATED PROJECT TEMPLATE DIRECTORY ITSELF!! |
43 | | - # Sphinx runs from "docs/" directory, so path is relative to there "../{{ cookiecutter.project_slug }}" |
44 | | - # The {{ cookiecutter.project_slug }} variable is not available here at TEMPLATE doc build time. |
45 | | - # You need to manually exclude the directory name based on your typical generated slug structure or use a simpler pattern |
46 | | - # Assuming the generated slug will likely be lowercase/hyphenated based on cookiecutter.json logic |
47 | | - # e.g., exclude patterns like "my-robust-python-project", "another-project-name" |
48 | | - # Alternatively, exclude based on path structure if generated output goes to a known sibling dir |
49 | | - # A simple solution for template docs is to manually add generated projects to this list if they cause build issues. |
50 | | - # For robust template docs, you"d build from the template root and exclude the *rendered* output dir of the generated project. |
51 | | - # Let"s just exclude common development/build environment dirs and rely on the build process to only target the "docs/" dir. |
52 | | - "rust", # Exclude example Rust source dir at template root |
53 | | - "tests", # Exclude template"s own tests if any (e.g., tests/ directory at template root) |
54 | | - "cookiecutter.json", # Exclude the cookiecutter input file itself from being treated as a doc source |
55 | | - "README.md", # Exclude the template"s README file from being treated as a doc source |
56 | | - "noxfile.py", # Exclude the template"s noxfile |
57 | | - ".pre-commit-config.yaml", # Exclude template"s pre-commit config |
58 | | - "pyproject.toml", # Exclude the template"s pyproject.toml |
| 27 | + "_build", |
| 28 | + "Thumbs.db", |
| 29 | + ".DS_Store", |
| 30 | + ".venv", |
| 31 | + ".nox", |
| 32 | + "rust", |
| 33 | + "tests", |
| 34 | + "cookiecutter.json", |
| 35 | + "README.md", |
| 36 | + "noxfile.py", |
| 37 | + ".pre-commit-config.yaml", |
| 38 | + "pyproject.toml", |
59 | 39 | ] |
60 | 40 |
|
61 | | -# MyST-Parser settings (allows using Markdown + Sphinx features) |
62 | 41 | myst_enable_extensions = [ |
63 | 42 | "amsmath", |
64 | 43 | "colon_fence", |
|
75 | 54 | "attrs_block", |
76 | 55 | ] |
77 | 56 |
|
78 | | -# Intersphinx mapping: Link to documentation of standard libraries or tools mentioned |
79 | | -# Tuple: (base URL, inventory file path/None for standard) |
80 | | -# Ensure URLs end with / and are correct. Use "latest" or "stable" versions often. |
81 | 57 | intersphinx_mapping = { |
82 | 58 | "python": ("https://docs.python.org/3", None), |
83 | 59 | "pip": ("https://pip.pypa.io/en/stable/", None), |
84 | 60 | } |
85 | 61 |
|
86 | | -# -- Options for HTML output ------------------------------------------------- |
87 | | - |
88 | | -# The theme to use for HTML output |
89 | 62 | html_theme = "furo" |
90 | | - |
91 | | -# Add any paths that contain custom static files (like logo, css). |
92 | | -html_static_path = ["_static"] # Create this directory (docs/_static) if you add files like logo.png |
93 | | - |
94 | | -# HTML theme options (example for Furo) |
| 63 | +html_static_path = ["_static"] |
95 | 64 | html_theme_options = { |
96 | | - # Create docs/_static/logo-light.png and logo-dark.png |
97 | | - "sidebar_hide_name": True, # Hide project name next to logo if logo contains it |
98 | | - # "light_logo": "logo-light.png", |
99 | | - # "dark_logo": "logo-dark.png", |
100 | | - # Footer icons |
| 65 | + "sidebar_hide_name": True, |
101 | 66 | "footer_icons": [ |
102 | 67 | { |
103 | 68 | "name": "GitHub", |
104 | 69 | "url": "https://github.com/56kyle/cookiecutter-robust-python", |
105 | | - # **UPDATE THIS URL IF TEMPLATE REPO CHANGES** |
106 | 70 | "html": "<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.22.82.69 1.19 1.81.85 2.23.65.07-.51.28-.85.54-1.04-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38C13.71 14.53 16 11.53 16 8c0-4.42-3.58-8-8-8z'></path></svg>", |
107 | 71 | "aria-label": "GitHub", |
108 | 72 | }, |
109 | 73 | ], |
110 | | - # Configure links back to the source repo itself |
111 | 74 | "source_repository": "https://github.com/56kyle/cookiecutter-robust-python/", |
112 | | - # **UPDATE THIS URL IF TEMPLATE REPO CHANGES** |
113 | | - "source_branch": "main", # Or your default branch |
114 | | - "source_directory": "docs/", # Tells Furo that the doc source is in this subdir relative to repo root |
| 75 | + "source_branch": "main", |
| 76 | + "source_directory": "docs/", |
115 | 77 | } |
116 | 78 |
|
117 | | -# -- Options for Napoleon ----------------------------------------------------- |
118 | | -# Ensure Napoleon processes Google style docstrings correctly |
119 | | -napoleon_google_docstrings = True # Enable Google style (Parameters, Returns, etc.) |
120 | | -napoleon_numpy_docstrings = False # Disable NumPy style if not used |
121 | | -napoleon_include_init_with_doc = False # Set to true if __init__ only calls super() but has docstrings |
122 | | -napoleon_include_private_with_doc = False # Include private members with docstrings if needed |
123 | | -napoleon_include_special_with_doc = True # Include special members (__str__, etc.) |
124 | | -napoleon_use_admonition_for_examples = True # Render Examples sections as admonitions (Recommended) |
125 | | -napoleon_use_admonition_for_notes = True # Render Notes sections as admonitions (Recommended) |
126 | | -napoleon_use_admonition_for_references = True # Render References sections as admonitions (Recommended) |
127 | | -# Control parameter list format: use keyword is often nicer |
128 | | -napoleon_use_keyword = True # Use :keyword: role (aligns with Google style recommendation) |
129 | | -napoleon_use_param = True # Use :param: role |
130 | | -napoleon_use_rtype = True # Use :rtype: role (Recommended when using type hints) |
131 | | -napoleon_attr_annotations = True # Document attributes with type annotations |
| 79 | +napoleon_google_docstrings = True |
| 80 | +napoleon_numpy_docstrings = False |
| 81 | +napoleon_include_init_with_doc = False |
| 82 | +napoleon_include_private_with_doc = False |
| 83 | +napoleon_include_special_with_doc = True |
| 84 | +napoleon_use_admonition_for_examples = True |
| 85 | +napoleon_use_admonition_for_notes = True |
| 86 | +napoleon_use_admonition_for_references = True |
| 87 | +napoleon_use_keyword = True |
| 88 | +napoleon_use_param = True |
| 89 | +napoleon_use_rtype = True |
| 90 | +napoleon_attr_annotations = True |
132 | 91 |
|
133 | | -# -- Options for sphinx-autodoc-typehints ------------------------------------- |
134 | | -# This extension handles displaying type hints correctly and adds type annotation to Parameters/Returns sections |
135 | | -# https://sphinx-autodoc-typehints.readthedocs.io/en/stable/ |
136 | 92 | set_type_checking_flag = True |
137 | 93 | always_document_param_types = False |
138 | 94 | typehints_fully_qualified = False |
|
0 commit comments