Skip to content

Commit f6aa8e6

Browse files
committed
chore: Update project template to sphinx-notes/cookiecutter@c4f14dab
1 parent a1bfebf commit f6aa8e6

File tree

13 files changed

+145
-41
lines changed

13 files changed

+145
-41
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": "1701bf78ca498d756ce4502aa1712cfe23ed35af",
3+
"commit": "c4f14dab2840eeff6352647a923642b6377d1f49",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {

.github/workflows/lint.yml

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

.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-isso
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-isso
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/isso/changelog.html#version-${{ github.ref_name }}
18+
Changelog: https://sphinx.silverrainz.me/isso/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*

.pre-commit-config.yaml

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

Makefile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,36 @@ LANG = en_US.UTF-8
66
MAKE = make
77
PY = python3
88
RM = rm -rf
9+
GIT = git
10+
OPEN = xdg-open
911

1012
# Build sphinx documentation.
1113
.PHONY: docs
1214
docs:
1315
$(MAKE) -C docs/
1416

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+
1531
# Run unittest.
1632
.PHONY: test
1733
test:
1834
$(PY) -m unittest discover -s tests -v
1935

2036
# Build distribution package, for "install" or "upload".
2137
.PHONY: dist
22-
dist: pyproject.toml
23-
$(RM) dist/ # clean up old dist
38+
dist: pyproject.toml clean
2439
$(PY) -m build
2540

2641
# Install distribution package to user directory.
@@ -51,8 +66,16 @@ upload-test: dist
5166
update-template:
5267
$(PY) -m cruft update
5368

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+
5473
# Update project version.
5574
.PHONY: bump-version
5675
bump-version:
5776
@echo -n "Please enter the version to bump: "
5877
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"
78+
79+
# EXTRA TARGETS START
80+
81+
# EXTRA TARGETS END

README.rst

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

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

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

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

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

24+
|docs| |license| |pypi| |download|
25+
2426
Sphinx extension for embeding Isso comments in documents.
2527

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

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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@
127127
extensions.append('sphinxcontrib.gtagjs')
128128
gtagjs_ids = ['G-E4SNX0WZYV']
129129

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+
#
147+
130148
#
131149
# -- Eat your own dog food --------------------------------------------------
132150

0 commit comments

Comments
 (0)