diff --git a/.cruft.json b/.cruft.json index 0ebafc5..93a6379 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sphinx-notes/template", - "commit": "c781308dbd84e739727ce09aaf798444ced1e7e4", + "commit": "0b7d8aa478b37114cef369a217bd1d463e369d37", "checkout": null, "context": { "cookiecutter": { @@ -14,10 +14,6 @@ "github_repo": "snippet", "pypi_name": "sphinxnotes-snippet", "pypi_owner": "SilverRainZ", - "dependencies": [ - "Sphinx >= 4" - ], - "additional_docs": [], "_template": "https://github.com/sphinx-notes/template" } }, diff --git a/MANIFEST.in b/MANIFEST.in index 6b5bf17..4c868dc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -# This file is generated from sphinx-notes/template. +# This file is generated from sphinx-notes/cookiecutter. # You need to consider modifying the TEMPLATE or modifying THIS FILE. include LICENSE diff --git a/Makefile b/Makefile index fc82176..d9b7a14 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,62 @@ -# This file is generated from sphinx-notes/template. +# This file is generated from sphinx-notes/cookiecutter. # You need to consider modifying the TEMPLATE or modifying THIS FILE. LANG = en_US.UTF-8 -MAKE = make -PY = python3 -RM = rm -rf +MAKE = make +PY = python3 +RM = rm -rf +# Build sphinx documentation. .PHONY: docs docs: $(MAKE) -C docs/ +# Run unittest. .PHONY: test test: $(PY) -m unittest discover -s tests -v +# Build distribution package, for "install" or "upload". .PHONY: dist dist: pyproject.toml $(RM) dist/ # clean up old dist $(PY) -m build +# Install distribution package to user directory. +# +# NOTE: It may breaks your system-level packages, use at your own risk. .PHONY: install install: dist + export PIP_BREAK_SYSTEM_PACKAGES=1 # required by Python 3.11+, see PEP-668 $(PY) -m pip install --user --no-deps --force-reinstall dist/*.whl +# Publish wheel to PyPI offical server when you want to +# You should have a PyPI account and have PyPI token configured. +# +# See also https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives .PHONY: upload upload: dist $(PY) -m twine upload --repository pypi $. +.PHONY: upload-test +upload-test: dist $(PY) -m twine upload --repository testpypi $` - - :tag:`{{ title }}` +:Date: :ref:`📅{{ date }} ` +:Download: :tag:`{{ title }}` {% for line in content %} {{ line }} diff --git a/docs/changelog.rst b/docs/changelog.rst index 2e5ea3a..8258eb5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,4 +1,4 @@ -.. This file is generated from sphinx-notes/template. +.. This file is generated from sphinx-notes/cookiecutter. You need to consider modifying the TEMPLATE or modifying THIS FILE. ========== diff --git a/docs/conf.py b/docs/conf.py index 8b72bc9..1d0836a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,4 @@ -# This file is generated from sphinx-notes/template. +# This file is generated from sphinx-notes/cookiecutter. # You need to consider modifying the TEMPLATE or modifying THIS FILE. # Configuration file for the Sphinx documentation builder. @@ -70,31 +70,58 @@ # It is used to indicate the location of document like canonical_url html_baseurl = 'https://sphinx.silverrainz.me/snippet' -html_logo = html_favicon = '_images/sphinx-notes.png' +html_logo = html_favicon = '_static/sphinx-notes.png' # -- Extensions ------------------------------------------------------------- +# extensions.append('sphinxnotes.any') from sphinxnotes.any import Schema, Field as F +# +version_schema = Schema('version', + name=F(unique=True, referenceable=True, required=True, form=F.Form.LINES), + attrs={'date': F(referenceable=True)}, + content=F(form=F.Form.LINES), + description_template=open('_templates/version.rst', 'r').read(), + reference_template='🏷️{{ title }}', + missing_reference_template='🏷️{{ title }}', + ambiguous_reference_template='🏷️{{ title }}') +confval_schema = Schema('confval', + name=F(unique=True, referenceable=True, required=True, form=F.Form.LINES), + attrs={ + 'type': F(), + 'default': F(), + 'choice': F(form=F.Form.WORDS), + 'versionadded': F(), + 'versionchanged': F(form=F.Form.LINES), + }, + content=F(), + description_template=open('_templates/confval.rst', 'r').read(), + reference_template='⚙️{{ title }}', + missing_reference_template='⚙️{{ title }}', + ambiguous_reference_template='⚙️{{ title }}') +example_schema = Schema('example', + name=F(referenceable=True), + attrs={'style': F()}, + content=F(form=F.Form.LINES), + description_template=open('_templates/example.rst', 'r').read(), + reference_template='📝{{ title }}', + missing_reference_template='📝{{ title }}', + ambiguous_reference_template='📝{{ title }}') +# any_schemas = [ - # - Schema('version', - name=F(unique=True, referenceable=True, required=True, form=F.Form.LINES), - attrs={'date': F(referenceable=True)}, - content=F(form=F.Form.LINES), - description_template=open('_templates/version.rst', 'r').read(), - reference_template='💽 {{ title }}', - missing_reference_template='💽 {{ title }}', - ambiguous_reference_template='💽 {{ title }}'), - # + version_schema, + confval_schema, + example_schema, ] primary_domain = 'any' +# extensions.append('sphinx.ext.extlinks') extlinks = { - 'issue': ('https://github.com/sphinx-notes/snippet/issues/%s', '💬 %s'), - 'pull': ('https://github.com/sphinx-notes/snippet/pull/%s', '🚀 %s'), - 'tag': ('https://github.com/sphinx-notes/snippet/releases/tag/%s', '🏷️ %s'), + 'issue': ('https://github.com/sphinx-notes/snippet/issues/%s', '💬%s'), + 'pull': ('https://github.com/sphinx-notes/snippet/pull/%s', '🚀%s'), + 'tag': ('https://github.com/sphinx-notes/snippet/releases/tag/%s', '🏷️%s'), } extensions.append('sphinxcontrib.gtagjs') @@ -102,6 +129,7 @@ extensions.append('sphinxcontrib.asciinema') +# # -- Eat your own dog food -------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, @@ -117,3 +145,4 @@ } # DOG FOOD CONFIGURATION END +# diff --git a/docs/index.rst b/docs/index.rst index f010140..d3796e2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. This file is generated from sphinx-notes/template. +.. This file is generated from sphinx-notes/cookiecutter. You need to consider modifying the TEMPLATE or modifying THIS FILE. .. include:: ../README.rst @@ -65,7 +65,7 @@ Contents The Sphinx Notes Project ======================== -This project is a developed by `Shengyu Zhang`__, +The project is developed by `Shengyu Zhang`__, as part of **The Sphinx Notes Project**. .. toctree:: diff --git a/docs/make.bat b/docs/make.bat index b3cafbd..b158787 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -1,4 +1,4 @@ -REM This file is generated from sphinx-notes/template. DO NOT EDIT. +REM This file is generated from sphinx-notes/cookiecutter. DO NOT EDIT. @ECHO OFF diff --git a/pyproject.toml b/pyproject.toml index dcdb4d1..21c94d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# This file is generated from sphinx-notes/template. +# This file is generated from sphinx-notes/cookiecutter. # You need to consider modifying the TEMPLATE or modifying THIS FILE. # This file is used to configure your project.