sphinxnotes-project 1.0a0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. sphinxnotes_project-1.0a0/.cruft.json +22 -0
  2. sphinxnotes_project-1.0a0/.github/workflows/lint.yml +9 -0
  3. sphinxnotes_project-1.0a0/.github/workflows/pages.yml +25 -0
  4. sphinxnotes_project-1.0a0/.github/workflows/pypi.yml +22 -0
  5. sphinxnotes_project-1.0a0/.github/workflows/release.yml +18 -0
  6. sphinxnotes_project-1.0a0/.gitignore +137 -0
  7. sphinxnotes_project-1.0a0/.pre-commit-config.yaml +6 -0
  8. sphinxnotes_project-1.0a0/LICENSE +29 -0
  9. sphinxnotes_project-1.0a0/MANIFEST.in +11 -0
  10. sphinxnotes_project-1.0a0/Makefile +81 -0
  11. sphinxnotes_project-1.0a0/PKG-INFO +77 -0
  12. sphinxnotes_project-1.0a0/README.rst +35 -0
  13. sphinxnotes_project-1.0a0/docs/Makefile +23 -0
  14. sphinxnotes_project-1.0a0/docs/_build/html/_static/file.png +0 -0
  15. sphinxnotes_project-1.0a0/docs/_build/html/_static/minus.png +0 -0
  16. sphinxnotes_project-1.0a0/docs/_build/html/_static/plus.png +0 -0
  17. sphinxnotes_project-1.0a0/docs/_build/html/_static/sphinx-notes.png +0 -0
  18. sphinxnotes_project-1.0a0/docs/_images/.gitkeep +0 -0
  19. sphinxnotes_project-1.0a0/docs/_static/.gitkeep +0 -0
  20. sphinxnotes_project-1.0a0/docs/_static/sphinx-notes.png +0 -0
  21. sphinxnotes_project-1.0a0/docs/changelog.rst +28 -0
  22. sphinxnotes_project-1.0a0/docs/conf.py +116 -0
  23. sphinxnotes_project-1.0a0/docs/index.rst +99 -0
  24. sphinxnotes_project-1.0a0/docs/make.bat +37 -0
  25. sphinxnotes_project-1.0a0/docs/usage.rst +9 -0
  26. sphinxnotes_project-1.0a0/pyproject.toml +81 -0
  27. sphinxnotes_project-1.0a0/ruff.toml +9 -0
  28. sphinxnotes_project-1.0a0/setup.cfg +4 -0
  29. sphinxnotes_project-1.0a0/src/sphinxnotes/project/__init__.py +98 -0
  30. sphinxnotes_project-1.0a0/src/sphinxnotes/project/templates/confval.rst +11 -0
  31. sphinxnotes_project-1.0a0/src/sphinxnotes/project/templates/example.rst +31 -0
  32. sphinxnotes_project-1.0a0/src/sphinxnotes/project/templates/version.rst +8 -0
  33. sphinxnotes_project-1.0a0/src/sphinxnotes_project.egg-info/PKG-INFO +77 -0
  34. sphinxnotes_project-1.0a0/src/sphinxnotes_project.egg-info/SOURCES.txt +35 -0
  35. sphinxnotes_project-1.0a0/src/sphinxnotes_project.egg-info/dependency_links.txt +1 -0
  36. sphinxnotes_project-1.0a0/src/sphinxnotes_project.egg-info/requires.txt +20 -0
  37. sphinxnotes_project-1.0a0/src/sphinxnotes_project.egg-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "template": "https://github.com/sphinx-notes/cookiecutter",
3
+ "commit": "e9395e52b94aa56ef6e2e309df6ef3c2ab877b43",
4
+ "checkout": null,
5
+ "context": {
6
+ "cookiecutter": {
7
+ "namespace": "sphinxnotes",
8
+ "name": "project",
9
+ "full_name": "sphinxnotes-project",
10
+ "author": "Shengyu Zhang",
11
+ "description": "A Sphinx extension that provides useful directives for creating project documentation",
12
+ "version": "0.1",
13
+ "github_owner": "sphinx-notes",
14
+ "github_repo": "project",
15
+ "pypi_name": "sphinxnotes-project",
16
+ "pypi_owner": "SilverRainZ",
17
+ "_template": "https://github.com/sphinx-notes/cookiecutter",
18
+ "_commit": "e9395e52b94aa56ef6e2e309df6ef3c2ab877b43"
19
+ }
20
+ },
21
+ "directory": null
22
+ }
@@ -0,0 +1,9 @@
1
+ name: Ruff
2
+ on: [ push, pull_request ]
3
+
4
+ jobs:
5
+ ruff:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v4
9
+ - uses: chartboost/ruff-action@v1
@@ -0,0 +1,25 @@
1
+ name: Deploy Sphinx documentation to Pages
2
+
3
+ # Runs on pushes targeting the default branch
4
+ on:
5
+ push:
6
+ branches: [master]
7
+
8
+ # Cancel any in-progress job or run
9
+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
10
+ concurrency:
11
+ group: ${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ pages:
16
+ runs-on: ubuntu-20.04
17
+ environment:
18
+ name: github-pages
19
+ url: ${{ steps.deployment.outputs.page_url }}
20
+ permissions:
21
+ pages: write
22
+ id-token: write
23
+ steps:
24
+ - id: deployment
25
+ uses: sphinx-notes/pages@v3
@@ -0,0 +1,22 @@
1
+ name: Publish package distributions to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*"
7
+
8
+ jobs:
9
+ pypi:
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/sphinxnotes-project
14
+ permissions:
15
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ - run: pip install build twine && make dist
20
+ - uses: pypa/gh-action-pypi-publish@release/v1
21
+ with:
22
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,18 @@
1
+ name: Publish Github Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "[0-9]+.[0-9]+" # MAJOR.MINOR (1.0: y, 1.0a0: n, 1.0.1: n)
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: ncipollo/release-action@v1
16
+ with:
17
+ body: |
18
+ Changelog: https://sphinx.silverrainz.me/project/changelog.html
@@ -0,0 +1,137 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # Poetry
132
+ poetry.lock
133
+
134
+ # Sphinx
135
+ docs/_build/
136
+ # sphinxnotes-any >= 2.5
137
+ docs/.any*
@@ -0,0 +1,6 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.1
4
+ hooks:
5
+ - id: ruff
6
+ - id: ruff-format
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Shengyu Zhang
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,11 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ include LICENSE
5
+ include README.rst
6
+
7
+ recursive-include tests *
8
+ recursive-exclude * __pycache__
9
+ recursive-exclude * *.py[co]
10
+
11
+ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
@@ -0,0 +1,81 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ LANG = en_US.UTF-8
5
+
6
+ MAKE = make
7
+ PY = python3
8
+ RM = rm -rf
9
+ GIT = git
10
+ OPEN = xdg-open
11
+
12
+ # Build sphinx documentation.
13
+ .PHONY: docs
14
+ docs:
15
+ $(MAKE) -C docs/
16
+
17
+ # View sphinx HTML documentation in browser.
18
+ .PHONY: view
19
+ view:
20
+ $(OPEN) docs/_build/html/index.html
21
+
22
+ .PHONY: clean
23
+ clean:
24
+ $(MAKE) -C docs/ clean | true
25
+ $(RM) dist/ | true
26
+
27
+ .PHONY: clean
28
+ fmt:
29
+ ruff format src/
30
+
31
+ # Run unittest.
32
+ .PHONY: test
33
+ test:
34
+ $(PY) -m unittest discover -s tests -v
35
+
36
+ # Build distribution package, for "install" or "upload".
37
+ .PHONY: dist
38
+ dist: pyproject.toml clean
39
+ $(PY) -m build
40
+
41
+ # Install distribution package to user directory.
42
+ #
43
+ # NOTE: It may breaks your system-level packages, use at your own risk.
44
+ .PHONY: install
45
+ install: dist
46
+ export PIP_BREAK_SYSTEM_PACKAGES=1 # required by Python 3.11+, see PEP-668
47
+ $(PY) -m pip install --user --no-deps --force-reinstall dist/*.whl
48
+
49
+ # Publish wheel to PyPI offical server <https://pypi.org/> when you want to
50
+ # You should have a PyPI account and have PyPI token configured.
51
+ #
52
+ # See also https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
53
+ .PHONY: upload
54
+ upload: dist
55
+ $(PY) -m twine upload --repository pypi $</*
56
+
57
+ # Same to the aboved "upload" target, but this publishs to PyPI test server
58
+ # <https://test.pypi.org/>.
59
+ .PHONY: upload-test
60
+ upload-test: dist
61
+ $(PY) -m twine upload --repository testpypi $</*
62
+
63
+ # Keep up to date with the latest template.
64
+ # See also https://github.com/sphinx-notes/cookiecutter.
65
+ .PHONY: update-template
66
+ update-template:
67
+ $(PY) -m cruft update
68
+
69
+ .PHONY: update-template-done
70
+ update-template-done:
71
+ $(GIT) commit -m "chore: Update project template to sphinx-notes/cookiecutter@$(shell jq -r '.commit' .cruft.json | head -c8)"
72
+
73
+ # Update project version.
74
+ .PHONY: bump-version
75
+ bump-version:
76
+ @echo -n "Please enter the version to bump: "
77
+ @read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"
78
+
79
+ # EXTRA TARGETS START
80
+
81
+ # EXTRA TARGETS END
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.2
2
+ Name: sphinxnotes-project
3
+ Version: 1.0a0
4
+ Summary: A Sphinx extension that provides useful directives for creating project documentation
5
+ Author: Shengyu Zhang
6
+ Maintainer: Shengyu Zhang
7
+ Project-URL: homepage, https://sphinx.silverrainz.me/project
8
+ Project-URL: documentation, https://sphinx.silverrainz.me/project
9
+ Project-URL: repository, https://github.com/sphinx-notes/project
10
+ Project-URL: changelog, https://sphinx.silverrainz.me/project/changelog.html
11
+ Project-URL: tracker, https://github.com/sphinx-notes/project/issues
12
+ Keywords: sphinx,extension,documentation
13
+ Classifier: Environment :: Plugins
14
+ Classifier: Framework :: Sphinx
15
+ Classifier: Framework :: Sphinx :: Extension
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Topic :: Documentation
21
+ Classifier: Topic :: Documentation :: Sphinx
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/x-rst
24
+ License-File: LICENSE
25
+ Requires-Dist: Sphinx>=4
26
+ Requires-Dist: sphinxnotes-any>=3.0a4
27
+ Provides-Extra: dev
28
+ Requires-Dist: build; extra == "dev"
29
+ Requires-Dist: twine; extra == "dev"
30
+ Requires-Dist: cruft; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: pre-commit; extra == "dev"
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest; extra == "test"
35
+ Provides-Extra: docs
36
+ Requires-Dist: furo; extra == "docs"
37
+ Requires-Dist: sphinxnotes-project; extra == "docs"
38
+ Requires-Dist: sphinx_design; extra == "docs"
39
+ Requires-Dist: sphinx_copybutton; extra == "docs"
40
+ Requires-Dist: sphinxcontrib-gtagjs; extra == "docs"
41
+ Requires-Dist: sphinxnotes-comboroles; extra == "docs"
42
+
43
+ .. This file is generated from sphinx-notes/cookiecutter.
44
+ You need to consider modifying the TEMPLATE or modifying THIS FILE.
45
+
46
+ ===================
47
+ sphinxnotes-project
48
+ ===================
49
+
50
+ .. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/project/github-pages
51
+ :target: https://sphinx.silverrainz.me/project
52
+ :alt: Documentation Status
53
+
54
+ .. |license| image:: https://img.shields.io/github/license/sphinx-notes/project
55
+ :target: https://github.com/sphinx-notes/project/blob/master/LICENSE
56
+ :alt: Open Source License
57
+
58
+ .. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-project.svg
59
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
60
+ :alt: PyPI Package
61
+
62
+ .. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-project
63
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
64
+ :alt: PyPI Package Downloads
65
+
66
+ |docs| |license| |pypi| |download|
67
+
68
+ A Sphinx extension that provides useful directives for creating project documentation.
69
+
70
+ .. INTRODUCTION START
71
+ (MUST written in standard reStructuredText, without Sphinx stuff)
72
+
73
+ .. INTRODUCTION END
74
+
75
+ Please refer to Documentation_ for more details.
76
+
77
+ .. _Documentation: https://sphinx.silverrainz.me/project
@@ -0,0 +1,35 @@
1
+ .. This file is generated from sphinx-notes/cookiecutter.
2
+ You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ ===================
5
+ sphinxnotes-project
6
+ ===================
7
+
8
+ .. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/project/github-pages
9
+ :target: https://sphinx.silverrainz.me/project
10
+ :alt: Documentation Status
11
+
12
+ .. |license| image:: https://img.shields.io/github/license/sphinx-notes/project
13
+ :target: https://github.com/sphinx-notes/project/blob/master/LICENSE
14
+ :alt: Open Source License
15
+
16
+ .. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-project.svg
17
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
18
+ :alt: PyPI Package
19
+
20
+ .. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-project
21
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
22
+ :alt: PyPI Package Downloads
23
+
24
+ |docs| |license| |pypi| |download|
25
+
26
+ A Sphinx extension that provides useful directives for creating project documentation.
27
+
28
+ .. INTRODUCTION START
29
+ (MUST written in standard reStructuredText, without Sphinx stuff)
30
+
31
+ .. INTRODUCTION END
32
+
33
+ Please refer to Documentation_ for more details.
34
+
35
+ .. _Documentation: https://sphinx.silverrainz.me/project
@@ -0,0 +1,23 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ # Minimal makefile for Sphinx documentation
5
+
6
+ # You can set these variables from the command line.
7
+ SPHINXOPTS =
8
+ SPHINXBUILD = python3 -msphinx
9
+ SOURCEDIR = .
10
+ BUILDDIR = _build
11
+
12
+ default: html
13
+
14
+ # Put it first so that "make" without argument is like "make help".
15
+ help:
16
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
17
+
18
+ .PHONY: help Makefile default
19
+
20
+ # Catch-all target: route all unknown targets to Sphinx using the new
21
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
22
+ %: Makefile
23
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File without changes
File without changes
@@ -0,0 +1,28 @@
1
+ .. This file is generated from sphinx-notes/cookiecutter.
2
+ You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ ==========
5
+ Change Log
6
+ ==========
7
+
8
+ .. hint:: You may want to learn about our `Release Strategy`__
9
+
10
+ __ https://sphinx.silverrainz.me/release.html
11
+
12
+ .. Example:
13
+
14
+ 1.0
15
+ ===
16
+
17
+ .. version:: _
18
+ :date: yyyy-mm-dd
19
+
20
+ Change log here.
21
+
22
+ Version 1.x
23
+ ===========
24
+
25
+ .. version:: 1.0a0
26
+ :date: 2025-02-10
27
+
28
+ Alpha version~
@@ -0,0 +1,116 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ # Configuration file for the Sphinx documentation builder.
5
+ #
6
+ # This file only contains a selection of the most common options. For a full
7
+ # list see the documentation:
8
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
9
+
10
+ import os
11
+ import sys
12
+
13
+ # -- Project information -----------------------------------------------------
14
+
15
+ project = 'sphinxnotes-project'
16
+ author = 'Shengyu Zhang'
17
+ copyright = "2025, " + author
18
+
19
+ # The full version, including alpha/beta/rc tags
20
+ version = release = '0.1'
21
+
22
+ # -- General configuration ---------------------------------------------------
23
+
24
+ # Add any Sphinx extension module names here, as strings. They can be
25
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
26
+ # ones.
27
+ extensions = [
28
+ 'sphinx.ext.githubpages',
29
+ 'sphinx_design',
30
+ 'sphinx_copybutton',
31
+ ]
32
+
33
+ # Add any paths that contain templates here, relative to this directory.
34
+ templates_path = ['_templates']
35
+
36
+ # The document name of the “master” document, that is,
37
+ # the document that contains the root toctree directive.
38
+ # Default is 'index', we set it here for supporting Sphinx<2.0
39
+ master_doc = 'index'
40
+
41
+ # List of patterns, relative to source directory, that match files and
42
+ # directories to ignore when looking for source files.
43
+ # This pattern also affects html_static_path and html_extra_path.
44
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
45
+
46
+ # A boolean that decides whether codeauthor and sectionauthor directives
47
+ # produce any output in the built files.
48
+ show_authors = True
49
+
50
+ # -- Options for HTML output -------------------------------------------------
51
+
52
+ # The theme to use for HTML and HTML Help pages. See the documentation for
53
+ # a list of builtin themes.
54
+ #
55
+ html_theme = 'furo'
56
+
57
+ html_theme_options = {}
58
+
59
+ # Add any paths that contain custom static files (such as style sheets) here,
60
+ # relative to this directory. They are copied after the builtin static files,
61
+ # so a file named "default.css" will overwrite the builtin "default.css".
62
+ html_static_path = ['_static']
63
+ html_theme_options = {
64
+ "source_repository": "https://github.com/sphinx-notes/project/",
65
+ "source_branch": "master",
66
+ "source_directory": "docs/",
67
+ }
68
+
69
+ # The URL which points to the root of the HTML documentation.
70
+ # It is used to indicate the location of document like canonical_url
71
+ html_baseurl = 'https://sphinx.silverrainz.me/project'
72
+
73
+ html_logo = html_favicon = '_static/sphinx-notes.png'
74
+
75
+ # -- Extensions -------------------------------------------------------------
76
+
77
+ extensions.append('sphinx.ext.extlinks')
78
+ extlinks = {
79
+ 'issue': ('https://github.com/sphinx-notes/project/issues/%s', '💬%s'),
80
+ 'pull': ('https://github.com/sphinx-notes/project/pull/%s', '🚀%s'),
81
+ 'tag': ('https://github.com/sphinx-notes/project/releases/tag/%s', '🏷️%s'),
82
+ }
83
+
84
+ extensions.append('sphinxcontrib.gtagjs')
85
+ gtagjs_ids = ['G-E4SNX0WZYV']
86
+
87
+ extensions.append('sphinx.ext.autodoc')
88
+ autoclass_content = 'init'
89
+ autodoc_typehints = 'description'
90
+
91
+ extensions.append('sphinx.ext.intersphinx')
92
+ intersphinx_mapping = {
93
+ 'python': ('https://docs.python.org/3', None),
94
+ 'sphinx': ('https://www.sphinx-doc.org/en/master', None),
95
+ 'jinja': ('https://jinja.palletsprojects.com/en/latest/', None),
96
+ }
97
+
98
+ extensions.append('sphinxnotes.comboroles')
99
+ comboroles_roles = {
100
+ 'parsed_literal': (['literal'], True),
101
+ }
102
+
103
+ extensions.append('sphinxnotes.project')
104
+ primary_domain = 'any'
105
+
106
+ # -- Eat your own dog food --------------------------------------------------
107
+
108
+ # If extensions (or modules to document with autodoc) are in another directory,
109
+ # add these directories to sys.path here. If the directory is relative to the
110
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
111
+ sys.path.insert(0, os.path.abspath('../src/sphinxnotes'))
112
+ extensions.append('project')
113
+
114
+ # DOG FOOD CONFIGURATION START
115
+
116
+ # DOG FOOD CONFIGURATION END
@@ -0,0 +1,99 @@
1
+ .. This file is generated from sphinx-notes/cookiecutter.
2
+ You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ ===================
5
+ sphinxnotes-project
6
+ ===================
7
+
8
+ .. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/project/github-pages
9
+ :target: https://sphinx.silverrainz.me/project
10
+ :alt: Documentation Status
11
+
12
+ .. |license| image:: https://img.shields.io/github/license/sphinx-notes/project
13
+ :target: https://github.com/sphinx-notes/project/blob/master/LICENSE
14
+ :alt: Open Source License
15
+
16
+ .. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-project.svg
17
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
18
+ :alt: PyPI Package
19
+
20
+ .. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-project
21
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
22
+ :alt: PyPI Package Downloads
23
+
24
+ |docs| |license| |pypi| |download|
25
+
26
+ Introduction
27
+ ============
28
+
29
+ .. INTRODUCTION START
30
+
31
+ A Sphinx extension that provides useful directives for creating project
32
+ documentation
33
+
34
+ .. warning::
35
+
36
+ Currently, this extension is only used internally in `Sphinx Notes`__ and
37
+ **NO** availability guarantees.
38
+
39
+ __ https://sphinx.silverrainz.me/
40
+
41
+ .. INTRODUCTION END
42
+
43
+ Getting Started
44
+ ===============
45
+
46
+ .. note::
47
+
48
+ We assume you already have a Sphinx documentation,
49
+ if not, see `Getting Started with Sphinx`_.
50
+
51
+ First, downloading extension from PyPI:
52
+
53
+ .. code-block:: console
54
+
55
+ $ pip install sphinxnotes-project
56
+
57
+ Then, add the extension name to ``extensions`` configuration item in your
58
+ :parsed_literal:`conf.py_`:
59
+
60
+ .. code-block:: python
61
+
62
+ extensions = [
63
+ # …
64
+ 'sphinxnotes.project',
65
+ # …
66
+ ]
67
+
68
+ .. _Getting Started with Sphinx: https://www.sphinx-doc.org/en/master/usage/quickstart.html
69
+ .. _conf.py: https://www.sphinx-doc.org/en/master/usage/configuration.html
70
+
71
+ .. ADDITIONAL CONTENT START
72
+
73
+ Check out :doc:`usage` for all available directives.
74
+
75
+ .. ADDITIONAL CONTENT END
76
+
77
+ Contents
78
+ ========
79
+
80
+ .. toctree::
81
+ :caption: Contents
82
+
83
+ usage
84
+ changelog
85
+
86
+ The Sphinx Notes Project
87
+ ========================
88
+
89
+ The project is developed by `Shengyu Zhang`__,
90
+ as part of **The Sphinx Notes Project**.
91
+
92
+ .. toctree::
93
+ :caption: The Sphinx Notes Project
94
+
95
+ Home <https://sphinx.silverrainz.me/>
96
+ Blog <https://silverrainz.me/blog/category/sphinx.html>
97
+ PyPI <https://pypi.org/search/?q=sphinxnotes>
98
+
99
+ __ https://github.com/SilverRainZ
@@ -0,0 +1,37 @@
1
+ REM This file is generated from sphinx-notes/cookiecutter. DO NOT EDIT.
2
+
3
+ @ECHO OFF
4
+
5
+ pushd %~dp0
6
+
7
+ REM Command file for Sphinx documentation
8
+
9
+ if "%SPHINXBUILD%" == "" (
10
+ set SPHINXBUILD=python -msphinx
11
+ )
12
+ set SOURCEDIR=.
13
+ set BUILDDIR=_build
14
+
15
+ if "%1" == "" goto help
16
+
17
+ %SPHINXBUILD% >NUL 2>NUL
18
+ if errorlevel 9009 (
19
+ echo.
20
+ echo.The Sphinx module was not found. Make sure you have Sphinx installed,
21
+ echo.then set the SPHINXBUILD environment variable to point to the full
22
+ echo.path of the 'sphinx-build' executable. Alternatively you may add the
23
+ echo.Sphinx directory to PATH.
24
+ echo.
25
+ echo.If you don't have Sphinx installed, grab it from
26
+ echo.http://sphinx-doc.org/
27
+ exit /b 1
28
+ )
29
+
30
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
31
+ goto end
32
+
33
+ :help
34
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
35
+
36
+ :end
37
+ popd
@@ -0,0 +1,9 @@
1
+ =====
2
+ Usage
3
+ =====
4
+
5
+ TODO: document directivces.
6
+
7
+ .. rst:directive:: version
8
+ .. rst:directive:: confval
9
+ .. rst:directive:: rst-example
@@ -0,0 +1,81 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ # This file is used to configure your project.
5
+ # Read more about the various options under:
6
+ # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata
7
+
8
+ [project]
9
+ name = "sphinxnotes-project"
10
+ description = "A Sphinx extension that provides useful directives for creating project documentation"
11
+ readme = "README.rst"
12
+ license = { file = "BSD-3-Clause" }
13
+ authors = [ { name = "Shengyu Zhang" } ]
14
+ maintainers = [ { name = "Shengyu Zhang" } ]
15
+ keywords = ["sphinx", "extension", "documentation"] # TOOD: additional_keywords
16
+ classifiers = [
17
+ # "Development Status :: 4 - Beta",
18
+ "Environment :: Plugins",
19
+ "Framework :: Sphinx",
20
+ "Framework :: Sphinx :: Extension",
21
+ "License :: OSI Approved :: BSD License",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python",
24
+ "Programming Language :: Python :: 3",
25
+ "Topic :: Documentation",
26
+ "Topic :: Documentation :: Sphinx",
27
+ ]
28
+
29
+ requires-python = ">=3.8"
30
+ dependencies = [
31
+ "Sphinx >= 4",
32
+ "sphinxnotes-any >= 3.0a4",
33
+ ]
34
+
35
+ dynamic = ["version"] # required by setuptools_scm, see section [build-system]
36
+
37
+ [project.optional-dependencies]
38
+ dev = [
39
+ "build",
40
+ "twine",
41
+ "cruft",
42
+ "ruff",
43
+ "pre-commit"
44
+ ]
45
+ test = [
46
+ "pytest",
47
+ ]
48
+ docs = [
49
+ "furo",
50
+ "sphinxnotes-project",
51
+ "sphinx_design",
52
+ "sphinx_copybutton",
53
+ "sphinxcontrib-gtagjs",
54
+ "sphinxnotes-comboroles",
55
+ ]
56
+
57
+ [project.urls]
58
+ homepage = "https://sphinx.silverrainz.me/project"
59
+ documentation = "https://sphinx.silverrainz.me/project"
60
+ repository = "https://github.com/sphinx-notes/project"
61
+ changelog = "https://sphinx.silverrainz.me/project/changelog.html"
62
+ tracker = "https://github.com/sphinx-notes/project/issues"
63
+
64
+ [build-system]
65
+ requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"]
66
+ build-backend = "setuptools.build_meta"
67
+
68
+ [tool.setuptools_scm]
69
+ # For smarter version schemes and other configuration options,
70
+ # check out https://github.com/pypa/setuptools_scm
71
+ version_scheme = "no-guess-dev"
72
+
73
+ [tool.setuptools.packages.find]
74
+ # Find namespace package,
75
+ # check out https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-namespace-packages
76
+ where = ["src"]
77
+
78
+ [tool.setuptools.package-data]
79
+ # A maps from PACKAGE NAMES to lists of glob patterns,
80
+ # see also https://setuptools.pypa.io/en/latest/userguide/datafiles.html
81
+ "sphinxnotes.project.templates" = ["*.*"]
@@ -0,0 +1,9 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+ # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
+
4
+ exclude = [
5
+ "docs/conf.py",
6
+ ]
7
+
8
+ [format]
9
+ quote-style = "single"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,98 @@
1
+ """
2
+ sphinxnotes.project
3
+ ~~~~~~~~~~~~~~~~~~~
4
+
5
+ Sphinx extension entrypoint.
6
+
7
+ :copyright: Copyright 2025 Shengyu Zhang
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ from __future__ import annotations
12
+ from typing import TYPE_CHECKING
13
+ from importlib.metadata import version
14
+ from os import path
15
+
16
+ from sphinx.util import logging
17
+
18
+ from sphinxnotes.any.api import Schema, Field as F, by_year, by_month
19
+
20
+ if TYPE_CHECKING:
21
+ from sphinx.application import Sphinx
22
+ from sphinx.config import Config
23
+
24
+
25
+ logger = logging.getLogger(__name__)
26
+
27
+
28
+ def _get_template_file(name: str) -> str:
29
+ """
30
+ Get file path of template file.
31
+
32
+ .. seealso::
33
+
34
+ see ``[tool.setuptools.package-data]`` section of pyproject.toml to know
35
+ how files are included.
36
+ """
37
+ prefix = path.abspath(path.dirname(__file__))
38
+ # TODO: Various parser (md, rst, and ect..) support.
39
+ return path.join(prefix, 'templates', name + '.rst')
40
+
41
+
42
+ def _read_template_file(name: str) -> str:
43
+ return open(_get_template_file(name), 'r').read()
44
+
45
+
46
+ def _config_inited(app: Sphinx, config: Config) -> None:
47
+ version_schema = Schema(
48
+ 'version',
49
+ name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES),
50
+ attrs={
51
+ 'date': F(ref=True, indexers=[by_year, by_month]),
52
+ },
53
+ content=F(form=F.Forms.LINES),
54
+ description_template=_read_template_file('version'),
55
+ reference_template='🏷️{{ title }}',
56
+ missing_reference_template='🏷️{{ title }}',
57
+ ambiguous_reference_template='🏷️{{ title }}',
58
+ )
59
+ confval_schema = Schema(
60
+ 'confval',
61
+ name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES),
62
+ attrs={
63
+ 'type': F(),
64
+ 'default': F(),
65
+ 'choice': F(form=F.Forms.WORDS),
66
+ 'versionadded': F(),
67
+ 'versionchanged': F(form=F.Forms.LINES),
68
+ },
69
+ content=F(),
70
+ description_template=_read_template_file('confval'),
71
+ reference_template='⚙️{{ title }}',
72
+ missing_reference_template='⚙️{{ title }}',
73
+ ambiguous_reference_template='⚙️{{ title }}',
74
+ )
75
+ example_schema = Schema(
76
+ 'rst-example',
77
+ name=F(ref=True),
78
+ attrs={'style': F()},
79
+ content=F(form=F.Forms.LINES),
80
+ description_template=_read_template_file('example'),
81
+ reference_template='📝{{ title }}',
82
+ missing_reference_template='📝{{ title }}',
83
+ ambiguous_reference_template='📝{{ title }}',
84
+ )
85
+
86
+ config.any_schemas.extend([
87
+ version_schema,
88
+ confval_schema,
89
+ example_schema,
90
+ ])
91
+
92
+
93
+ def setup(app: Sphinx):
94
+ app.setup_extension('sphinxnotes.any')
95
+ # Should have priority over sphinxnotes.any's "config-inited" callback.
96
+ app.connect('config-inited', _config_inited, priority=400)
97
+
98
+ return {'version': version('sphinxnotes.project')}
@@ -0,0 +1,11 @@
1
+
2
+ :Type: :py:class:`{{ type }}`
3
+ :Default: ``{{ default }}``
4
+ {% if choice %}:Choices: {% for c in choice %}``{{ c }}`` {% endfor %}{% endif %}
5
+ {% if versionadded %}:Version added: :version:`{{ versionadded }}`{% endif %}
6
+ {% if versionchanged %}:Version changed:{% for i in range(0, versionchanged|count -1, 2) %}
7
+ :version:`{{ versionchanged[i] }}`
8
+ {{ versionchanged[i+1] }}{% endfor %}{% endif %}
9
+
10
+ {{ content }}
11
+
@@ -0,0 +1,31 @@
1
+
2
+ {% if style is not defined or style == 'tab' %}
3
+ .. tab-set::
4
+
5
+ .. tab-item:: Result
6
+
7
+ {% for line in content %}{{ line }}
8
+ {% endfor %}
9
+
10
+ .. tab-item:: reStructuredText
11
+
12
+ .. code:: rst
13
+
14
+ {% for line in content %}{{ line }}
15
+ {% endfor %}
16
+ {% elif style == 'grid' %}
17
+ .. grid:: 2
18
+
19
+ .. grid-item-card:: reStructuredText
20
+
21
+ .. code:: rst
22
+
23
+ {% for line in content %}{{ line }}
24
+ {% endfor %}
25
+
26
+ .. grid-item-card:: Result
27
+
28
+ {% for line in content %}{{ line }}
29
+ {% endfor %}
30
+ {% endif %}
31
+
@@ -0,0 +1,8 @@
1
+
2
+ :Date: :ref:`📅{{ date }} <any-version.date>`
3
+ :Download: :tag:`{{ title }}`
4
+
5
+ {% for line in content %}
6
+ {{ line }}
7
+ {% endfor %}
8
+
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.2
2
+ Name: sphinxnotes-project
3
+ Version: 1.0a0
4
+ Summary: A Sphinx extension that provides useful directives for creating project documentation
5
+ Author: Shengyu Zhang
6
+ Maintainer: Shengyu Zhang
7
+ Project-URL: homepage, https://sphinx.silverrainz.me/project
8
+ Project-URL: documentation, https://sphinx.silverrainz.me/project
9
+ Project-URL: repository, https://github.com/sphinx-notes/project
10
+ Project-URL: changelog, https://sphinx.silverrainz.me/project/changelog.html
11
+ Project-URL: tracker, https://github.com/sphinx-notes/project/issues
12
+ Keywords: sphinx,extension,documentation
13
+ Classifier: Environment :: Plugins
14
+ Classifier: Framework :: Sphinx
15
+ Classifier: Framework :: Sphinx :: Extension
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Topic :: Documentation
21
+ Classifier: Topic :: Documentation :: Sphinx
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/x-rst
24
+ License-File: LICENSE
25
+ Requires-Dist: Sphinx>=4
26
+ Requires-Dist: sphinxnotes-any>=3.0a4
27
+ Provides-Extra: dev
28
+ Requires-Dist: build; extra == "dev"
29
+ Requires-Dist: twine; extra == "dev"
30
+ Requires-Dist: cruft; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: pre-commit; extra == "dev"
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest; extra == "test"
35
+ Provides-Extra: docs
36
+ Requires-Dist: furo; extra == "docs"
37
+ Requires-Dist: sphinxnotes-project; extra == "docs"
38
+ Requires-Dist: sphinx_design; extra == "docs"
39
+ Requires-Dist: sphinx_copybutton; extra == "docs"
40
+ Requires-Dist: sphinxcontrib-gtagjs; extra == "docs"
41
+ Requires-Dist: sphinxnotes-comboroles; extra == "docs"
42
+
43
+ .. This file is generated from sphinx-notes/cookiecutter.
44
+ You need to consider modifying the TEMPLATE or modifying THIS FILE.
45
+
46
+ ===================
47
+ sphinxnotes-project
48
+ ===================
49
+
50
+ .. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/project/github-pages
51
+ :target: https://sphinx.silverrainz.me/project
52
+ :alt: Documentation Status
53
+
54
+ .. |license| image:: https://img.shields.io/github/license/sphinx-notes/project
55
+ :target: https://github.com/sphinx-notes/project/blob/master/LICENSE
56
+ :alt: Open Source License
57
+
58
+ .. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-project.svg
59
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
60
+ :alt: PyPI Package
61
+
62
+ .. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-project
63
+ :target: https://pypi.python.org/pypi/sphinxnotes-project
64
+ :alt: PyPI Package Downloads
65
+
66
+ |docs| |license| |pypi| |download|
67
+
68
+ A Sphinx extension that provides useful directives for creating project documentation.
69
+
70
+ .. INTRODUCTION START
71
+ (MUST written in standard reStructuredText, without Sphinx stuff)
72
+
73
+ .. INTRODUCTION END
74
+
75
+ Please refer to Documentation_ for more details.
76
+
77
+ .. _Documentation: https://sphinx.silverrainz.me/project
@@ -0,0 +1,35 @@
1
+ .cruft.json
2
+ .gitignore
3
+ .pre-commit-config.yaml
4
+ LICENSE
5
+ MANIFEST.in
6
+ Makefile
7
+ README.rst
8
+ pyproject.toml
9
+ ruff.toml
10
+ .github/workflows/lint.yml
11
+ .github/workflows/pages.yml
12
+ .github/workflows/pypi.yml
13
+ .github/workflows/release.yml
14
+ docs/Makefile
15
+ docs/changelog.rst
16
+ docs/conf.py
17
+ docs/index.rst
18
+ docs/make.bat
19
+ docs/usage.rst
20
+ docs/_build/html/_static/file.png
21
+ docs/_build/html/_static/minus.png
22
+ docs/_build/html/_static/plus.png
23
+ docs/_build/html/_static/sphinx-notes.png
24
+ docs/_images/.gitkeep
25
+ docs/_static/.gitkeep
26
+ docs/_static/sphinx-notes.png
27
+ src/sphinxnotes/project/__init__.py
28
+ src/sphinxnotes/project/templates/confval.rst
29
+ src/sphinxnotes/project/templates/example.rst
30
+ src/sphinxnotes/project/templates/version.rst
31
+ src/sphinxnotes_project.egg-info/PKG-INFO
32
+ src/sphinxnotes_project.egg-info/SOURCES.txt
33
+ src/sphinxnotes_project.egg-info/dependency_links.txt
34
+ src/sphinxnotes_project.egg-info/requires.txt
35
+ src/sphinxnotes_project.egg-info/top_level.txt
@@ -0,0 +1,20 @@
1
+ Sphinx>=4
2
+ sphinxnotes-any>=3.0a4
3
+
4
+ [dev]
5
+ build
6
+ twine
7
+ cruft
8
+ ruff
9
+ pre-commit
10
+
11
+ [docs]
12
+ furo
13
+ sphinxnotes-project
14
+ sphinx_design
15
+ sphinx_copybutton
16
+ sphinxcontrib-gtagjs
17
+ sphinxnotes-comboroles
18
+
19
+ [test]
20
+ pytest