Skip to content

Commit 27b8d0a

Browse files
committed
chore: Update project template to sphinx-notes/cookiecutter@0db2ed86
1 parent 4dff532 commit 27b8d0a

File tree

10 files changed

+100
-40
lines changed

10 files changed

+100
-40
lines changed

.cruft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sphinx-notes/template",
3-
"commit": "1701bf78ca498d756ce4502aa1712cfe23ed35af",
3+
"commit": "0db2ed864acc101a2ee90a3bf94b54b9f46473cf",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {

.github/workflows/pypi.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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-snippet
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 }}

.github/workflows/release.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
name: Publish New Release
1+
name: Publish Github Release
22

33
on:
44
push:
55
tags:
6-
- "*"
6+
- "[0-9]+.[0-9]+" # MAJOR.MINOR (1.0: y, 1.0a0: n, 1.0.1: n)
77

88
jobs:
9-
pypi:
10-
name: Publish package distributions to PyPI
11-
runs-on: ubuntu-latest
12-
environment:
13-
name: pypi
14-
url: https://pypi.org/p/sphinxnotes-snippet
15-
permissions:
16-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17-
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v5
20-
- run: pip install build twine && make dist
21-
- uses: pypa/gh-action-pypi-publish@release/v1
22-
with:
23-
password: ${{ secrets.PYPI_API_TOKEN }}
24-
259
release:
26-
name: Publish Github Release
27-
needs: [pypi]
2810
runs-on: ubuntu-latest
2911
permissions:
3012
contents: write
@@ -33,4 +15,4 @@ jobs:
3315
- uses: ncipollo/release-action@v1
3416
with:
3517
body: |
36-
Changelog: https://sphinx.silverrainz.me/snippet/changelog.html#version-${{ github.ref_name }}
18+
Changelog: https://sphinx.silverrainz.me/snippet/changelog.html

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,5 @@ poetry.lock
133133

134134
# Sphinx
135135
docs/_build/
136+
# sphinxnotes-any >= 2.5
137+
docs/.any*

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LANG = en_US.UTF-8
66
MAKE = make
77
PY = python3
88
RM = rm -rf
9+
GIT = git
910

1011
# Build sphinx documentation.
1112
.PHONY: docs
@@ -51,6 +52,10 @@ upload-test: dist
5152
update-template:
5253
$(PY) -m cruft update
5354

55+
.PHONY: update-template-done
56+
update-template-done:
57+
$(GIT) commit -m "chore: Update project template to sphinx-notes/cookiecutter@$(shell jq -r '.commit' .cruft.json | head -c8)"
58+
5459
# Update project version.
5560
.PHONY: bump-version
5661
bump-version:

README.rst

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@
55
sphinxnotes-snippet
66
===================
77

8-
.. image:: https://img.shields.io/github/actions/workflow/status/sphinx-notes/snippet/pages.yml
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/snippet/github-pages
99
:target: https://sphinx.silverrainz.me/snippet
1010
:alt: Documentation Status
1111

12-
.. image:: https://img.shields.io/github/license/sphinx-notes/snippet
13-
:target: https://github.com/sphinx-notes/snippet/LICENSE
12+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/snippet
13+
:target: https://github.com/sphinx-notes/snippet/blob/master/LICENSE
1414
:alt: Open Source License
1515

16-
.. image:: https://img.shields.io/pypi/v/sphinxnotes-snippet.svg
16+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-snippet.svg
1717
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
1818
:alt: PyPI Package
1919

20-
.. image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
20+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
2121
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
2222
:alt: PyPI Package Downloads
2323

24+
|docs| |license| |pypi| |download|
25+
2426
Sphinx documentation snippets manager.
2527

26-
* Documentation: https://sphinx.silverrainz.me/snippet
27-
* Source: https://github.com/sphinx-notes/snippet
28-
* Changelog: https://sphinx.silverrainz.me/snippet/changelog.html
29-
* Tracker: https://github.com/sphinx-notes/snippet/issues
30-
* Download: https://pypi.org/project/sphinxnotes-snippet/#files
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/snippet

docs/changelog.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
Change Log
66
==========
77

8+
.. hint:: You may want to learn about our `Release Strategy`__
9+
10+
__ https://sphinx.silverrainz.me/release.html
11+
812
.. Example:
913
10-
1.0.0
11-
=====
14+
1.0
15+
===
1216
1317
.. version:: _
1418
:date: yyyy-mm-dd
1519
16-
Change log here.
20+
Change log here.
1721
1822
Version 1.x
1923
===========

docs/conf.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,23 @@
127127
extensions.append('sphinxcontrib.gtagjs')
128128
gtagjs_ids = ['G-E4SNX0WZYV']
129129

130-
extensions.append('sphinxcontrib.asciinema')
130+
extensions.append('sphinx.ext.autodoc')
131+
autoclass_content = 'init'
132+
autodoc_typehints = 'description'
133+
134+
extensions.append('sphinx.ext.intersphinx')
135+
intersphinx_mapping = {
136+
'python': ('https://docs.python.org/3', None),
137+
'sphinx': ('https://www.sphinx-doc.org/en/master', None),
138+
'jinja': ('https://jinja.palletsprojects.com/en/latest/', None),
139+
}
140+
141+
#
142+
extensions.append('sphinxnotes.comboroles')
143+
comboroles_roles = {
144+
'parsed_literal': (['literal'], True),
145+
}
146+
#
131147

132148
#
133149
# -- Eat your own dog food --------------------------------------------------
@@ -144,5 +160,7 @@
144160
'cache_dir': '/tmp/' + 'sphinxnotes-snippet'
145161
}
146162

163+
extensions.append('sphinxcontrib.asciinema')
164+
147165
# DOG FOOD CONFIGURATION END
148166
#

docs/index.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
.. This file is generated from sphinx-notes/cookiecutter.
22
You need to consider modifying the TEMPLATE or modifying THIS FILE.
33
4-
.. include:: ../README.rst
4+
===================
5+
sphinxnotes-snippet
6+
===================
7+
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/snippet/github-pages
9+
:target: https://sphinx.silverrainz.me/snippet
10+
:alt: Documentation Status
11+
12+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/snippet
13+
:target: https://github.com/sphinx-notes/snippet/blob/master/LICENSE
14+
:alt: Open Source License
15+
16+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-snippet.svg
17+
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
18+
:alt: PyPI Package
19+
20+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
21+
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
22+
:alt: PyPI Package Downloads
23+
24+
|docs| |license| |pypi| |download|
525

626
Introduction
727
============
828

9-
.. ADDITIONAL CONTENT START
29+
.. INTRODUCTION START
1030
1131
Documentations in Sphinx can be parsed into doctree_ (In other words, Abstract Syntax Tree), all contents of documents are parsed into node of this tree. The :ref:`ext` collects snippets (doctree nodes) during the build phase of Sphinx, and provide a :ref:`cli` for your accessing.
1232

1333
For more details, please refer to :doc:`intro`
1434

1535
.. _doctree: https://docutils.sourceforge.io/docs/ref/doctree.html
1636

17-
.. ADDITIONAL CONTENT END
37+
.. INTRODUCTION END
1838
1939
Getting Started
2040
===============
@@ -30,7 +50,8 @@ First, downloading extension from PyPI:
3050
3151
$ pip install sphinxnotes-snippet
3252
33-
Then, add the extension name to ``extensions`` configuration item in your conf.py_:
53+
Then, add the extension name to ``extensions`` configuration item in your
54+
:parsed_literal:`conf.py_`:
3455

3556
.. code-block:: python
3657

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ docs = [
5757
"sphinx_design",
5858
"sphinx_copybutton",
5959
"sphinxcontrib-gtagjs",
60+
"sphinxnotes-comboroles",
6061
"sphinxcontrib.asciinema",
6162
]
6263

0 commit comments

Comments
 (0)