Skip to content

Commit

Permalink
chore: Sync with cookiecutter template
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Dec 26, 2023
1 parent 4d322f1 commit bf27f2d
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 36 deletions.
8 changes: 4 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sphinx-notes/template",
"commit": "93c85ed7fe6dc87e11ffd024b762a3c8c9a83a1b",
"template": "https://github.com/sphinx-notes/cookiecutter",
"commit": "0b7d8aa478b37114cef369a217bd1d463e369d37",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -9,12 +9,12 @@
"full_name": "sphinxnotes-comboroles",
"author": "Shengyu Zhang",
"description": "Sphinx extension for composing multiple roles",
"version": "0.1.0",
"version": "1.0.0a0",
"github_owner": "sphinx-notes",
"github_repo": "comboroles",
"pypi_name": "sphinxnotes-comboroles",
"pypi_owner": "SilverRainZ",
"_template": "https://github.com/sphinx-notes/template"
"_template": "https://github.com/sphinx-notes/cookiecutter"
}
},
"directory": null
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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.

LANG = en_US.UTF-8
Expand Down Expand Up @@ -46,7 +46,7 @@ upload-test: dist
$(PY) -m twine upload --repository testpypi $</*

# Keep up to date with the latest template.
# See also https://github.com/sphinx-notes/template.
# See also https://github.com/sphinx-notes/cookiecutter.
.PHONY: update-template
update-template:
$(PY) -m cruft update
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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.
======================
Expand All @@ -17,7 +17,7 @@ sphinxnotes-comboroles
:target: https://pypi.python.org/pypi/sphinxnotes-comboroles
:alt: PyPI Package

.. image:: https://img.shields.io/pypi/dw/sphinxnotes-comboroles
.. image:: https://img.shields.io/pypi/dm/sphinxnotes-comboroles
:target: https://pypi.python.org/pypi/sphinxnotes-comboroles
:alt: PyPI Package Downloads

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -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.

# Minimal makefile for Sphinx documentation
Expand Down
Empty file added docs/_images/.gitkeep
Empty file.
File renamed without changes
11 changes: 11 additions & 0 deletions docs/_templates/confval.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

:Type: :py:class:`{{ type }}`
:Default: ``{{ default }}``
{% if choice %}:Choices: {% for c in choice %}``{{ c }}`` {% endfor %}{% endif %}
{% if versionadded %}:Version added: :version:`{{ versionadded }}`{% endif %}
{% if versionchanged %}:Version changed:{% for i in range(0, versionchanged|count -1, 2) %}
:version:`{{ versionchanged[i] }}`
{{ versionchanged[i+1] }}{% endfor %}{% endif %}

{{ content }}

31 changes: 31 additions & 0 deletions docs/_templates/example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

{% if style is not defined or style == 'tab' %}
.. tab-set::

.. tab-item:: Result

{% for line in content %}{{ line }}
{% endfor %}

.. tab-item:: reStructuredText

.. code:: rst
{% for line in content %}{{ line }}
{% endfor %}
{% elif style == 'grid' %}
.. grid:: 2

.. grid-item-card:: reStructuredText

.. code:: rst
{% for line in content %}{{ line }}
{% endfor %}
.. grid-item-card:: Result

{% for line in content %}{{ line }}
{% endfor %}
{% endif %}

7 changes: 2 additions & 5 deletions docs/_templates/version.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.. list-table::
:align: left

* - :ref:`📅 {{ date }} <any-version.date>`
- :tag:`{{ title }}`

:Date: :ref:`📅{{ date }} <any-version.date>`
:Download: :tag:`{{ title }}`

{% for line in content %}
{{ line }}
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -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.
==========
Expand Down
59 changes: 43 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -17,7 +17,7 @@
copyright = "2023, " + author

# The full version, including alpha/beta/rc tags
version = release = '0.1.0'
version = release = '1.0.0a0'

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -70,38 +70,64 @@
# It is used to indicate the location of document like canonical_url
html_baseurl = 'https://sphinx.silverrainz.me/comboroles'

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/comboroles/issues/%s', '💬 %s'),
'pull': ('https://github.com/sphinx-notes/comboroles/pull/%s', '🚀 %s'),
'tag': ('https://github.com/sphinx-notes/comboroles/releases/tag/%s', '🏷️ %s'),
'issue': ('https://github.com/sphinx-notes/comboroles/issues/%s', '💬%s'),
'pull': ('https://github.com/sphinx-notes/comboroles/pull/%s', '🚀%s'),
'tag': ('https://github.com/sphinx-notes/comboroles/releases/tag/%s', '🏷️%s'),
}

extensions.append('sphinxcontrib.gtagjs')
gtagjs_ids = ['G-E4SNX0WZYV']

#
# -- Eat your own dog food --------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -118,3 +144,4 @@
}

# DOG FOOD CONFIGURATION END
#
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -98,7 +98,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::
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit bf27f2d

Please sign in to comment.