Skip to content

Commit 0dca9d9

Browse files
committed
chore: Update project template to sphinx-notes/cookiecutter@df339501
1 parent c505e78 commit 0dca9d9

File tree

9 files changed

+80
-35
lines changed

9 files changed

+80
-35
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/cookiecutter",
3-
"commit": "b90eb30533478fe686ce664e50541e0f91325c16",
3+
"commit": "df33950130c89d7d65d9a008716d95f99c4077c9",
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-any
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 & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +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-any
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
2710
needs: [pypi]
2811
runs-on: ubuntu-latest
2912
permissions:
@@ -33,4 +16,4 @@ jobs:
3316
- uses: ncipollo/release-action@v1
3417
with:
3518
body: |
36-
Changelog: https://sphinx.silverrainz.me/any/changelog.html#version-${{ github.ref_name }}
19+
Changelog: https://sphinx.silverrainz.me/any/changelog.html

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: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
sphinxnotes-any
66
===============
77

8-
98
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/any/github-pages
109
:target: https://sphinx.silverrainz.me/any
1110
:alt: Documentation Status
@@ -26,8 +25,11 @@ sphinxnotes-any
2625

2726
Sphinx domain for documenting anything.
2827

29-
* Documentation: https://sphinx.silverrainz.me/any
30-
* Source: https://github.com/sphinx-notes/any
31-
* Changelog: https://sphinx.silverrainz.me/any/changelog.html
32-
* Tracker: https://github.com/sphinx-notes/any/issues
33-
* Download: https://pypi.org/project/sphinxnotes-any/#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/any

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 2.x
1923
===========

docs/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,21 @@
8989
extensions.append('sphinx.ext.autodoc')
9090
autoclass_content = 'init'
9191
autodoc_typehints = 'description'
92-
92+
9393
extensions.append('sphinx.ext.intersphinx')
9494
intersphinx_mapping = {
9595
'python': ('https://docs.python.org/3', None),
9696
'sphinx': ('https://www.sphinx-doc.org/en/master', None),
9797
'jinja': ('https://jinja.palletsprojects.com/en/latest/', None),
9898
}
9999

100+
#
101+
extensions.append('sphinxnotes.comboroles')
102+
comboroles_roles = {
103+
'parsed_literal': (['literal'], True),
104+
}
105+
#
106+
100107
# -- Eat your own dog food --------------------------------------------------
101108

102109
# If extensions (or modules to document with autodoc) are in another directory,

docs/index.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
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-any
6+
===============
7+
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/any/github-pages
9+
:target: https://sphinx.silverrainz.me/any
10+
:alt: Documentation Status
11+
12+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/any
13+
:target: https://github.com/sphinx-notes/any/blob/master/LICENSE
14+
:alt: Open Source License
515

16+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-any.svg
17+
:target: https://pypi.python.org/pypi/sphinxnotes-any
18+
:alt: PyPI Package
19+
20+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-any
21+
:target: https://pypi.python.org/pypi/sphinxnotes-any
22+
:alt: PyPI Package Downloads
23+
24+
|docs| |license| |pypi| |download|
25+
626
Introduction
727
============
828

9-
.. ADDITIONAL CONTENT START
29+
.. INTRODUCTION START
1030
1131
The extension provides a domain which allows user creates directive and roles
1232
to descibe, reference and index arbitrary object in documentation.
1333
It is a bit like :py:meth:`sphinx.application.Sphinx.add_object_type`,
1434
but more powerful.
1535

16-
.. ADDITIONAL CONTENT END
36+
.. INTRODUCTION END
1737
1838
Getting Started
1939
===============
@@ -29,7 +49,8 @@ First, downloading extension from PyPI:
2949
3050
$ pip install sphinxnotes-any
3151
32-
Then, add the extension name to ``extensions`` configuration item in your conf.py_:
52+
Then, add the extension name to ``extensions`` configuration item in your
53+
:parsed_literal:`conf.py_`:
3354

3455
.. code-block:: python
3556

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ docs = [
5151
"sphinx_design",
5252
"sphinx_copybutton",
5353
"sphinxcontrib-gtagjs",
54+
"sphinxnotes-comboroles",
5455
]
5556

5657
[project.urls]

0 commit comments

Comments
 (0)