Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"template": "https://github.com/sphinx-notes/cookiecutter",
"commit": "800a79a06f9a67494516bc14bcda85b3472dcac9",
"checkout": null,
"context": {
"cookiecutter": {
"namespace": "sphinxnotes",
"name": "recentupdate",
"full_name": "sphinxnotes-recentupdate",
"author": "Shengyu Zhang",
"description": "Get the document update information from git and display it in Sphinx documentation",
"version": "1.0a2",
"github_owner": "sphinx-notes",
"github_repo": "recentupdate",
"pypi_name": "sphinxnotes-recentupdate",
"pypi_owner": "SilverRainZ",
"is_python_project": true,
"python_version": "3.12",
"is_sphinx_extension": true,
"sphinx_version": "7.0",
"development_status": "3 - Alpha",
"_template": "https://github.com/sphinx-notes/cookiecutter",
"_commit": "800a79a06f9a67494516bc14bcda85b3472dcac9"
}
},
"directory": null
}
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Ruff
on: [ push, pull_request ]

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
39 changes: 21 additions & 18 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: Pages
name: Deploy Sphinx documentation to Pages

# Runs on pushes targeting the default branch
on:
push:
branches:
- master
branches: [master]

# Cancel any in-progress job or run
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
pages:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Build and Commit
uses: sphinx-notes/pages@master
with:
documentation_path: doc
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
- id: deployment
uses: sphinx-notes/pages@v3
22 changes: 22 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish package distributions to PyPI

on:
push:
tags:
- "*"

jobs:
pypi:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sphinxnotes-recentupdate
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install build twine && make dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Github Release

on:
push:
tags:
- "[0-9]+.[0-9]+" # MAJOR.MINOR (1.0: y, 1.0a0: n, 1.0.1: n)

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
body: |
Changelog: https://sphinx.silverrainz.me/recentupdate/changelog.html
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,10 @@ dmypy.json
# Pyre type checker
.pyre/

# Poetry
poetry.lock

# Sphinx
doc/_build/
docs/_build/
# sphinxnotes-any >= 2.5
docs/.any*
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Sphinx Notes
Copyright (c) 2025, Shengyu Zhang
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 changes: 10 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
include README.rst
# This file is generated from sphinx-notes/cookiecutter.
# You need to consider modifying the TEMPLATE or modifying THIS FILE.

include LICENSE
recursive-include doc *
prune doc/_build
include README.rst

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
102 changes: 83 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,92 @@
LANG=en_US.UTF-8
# This file is generated from sphinx-notes/cookiecutter.
# You need to consider modifying the TEMPLATE or modifying THIS FILE.

MAKE = make
PY = python3
RM = rm -rf
LANG = en_US.UTF-8

.PHONY: doc
doc:
$(RM) doc/_build
$(MAKE) -C doc/
MAKE = make
PY = python3
RM = rm -rf
GIT = git
OPEN = xdg-open

.PHONY: dist
dist: setup.py
$(RM) dist/ build/ *.egg-info/
$(PY) setup.py sdist bdist_wheel
$(PY) -m twine check dist/*
.PHONY: docs
docs:
$(MAKE) -C docs/

.PHONY: upload
upload: dist/
$(PY) -m twine upload --repository pypi $<*
.PHONY: view
view:
$(OPEN) docs/_build/html/index.html

.PHONY: clean
clean:
$(MAKE) -C docs/ clean; $(RM) dist/

.PHONY: fmt
fmt:
ruff format src/ && ruff check --fix src/

.PHONY: test
test:
$(PY) -m unittest discover -s tests -v

################################################################################
# Distribution Package
################################################################################

# Build distribution package, for "install" or "upload".
.PHONY: dist
dist: pyproject.toml clean
$(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

.PHONY: test
test: tests
$(PY) -m unittest discover -s tests -v
# Publish wheel to PyPI offical server <https://pypi.org/> 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 $</*

################################################################################
# Cookiecutter Incremental Updates
################################################################################

# Keep up to date with the latest template.
# See https://github.com/sphinx-notes/cookiecutter.
.PHONY: tmpl-update tmpl-update-done tmpl-apply-rej

tmpl-update:
$(PY) -m cruft update

tmpl-update-done:
$(GIT) commit -m "chore: Update project template to sphinx-notes/cookiecutter@$(shell jq -r '.commit' .cruft.json | head -c8)"

tmpl-apply-rej:
@for rej in $$(find . -name '*.rej'); do \
echo "applying $$rej..."; \
wiggle --replace $${rej%.rej} $$rej; \
done

# Update project version.
.PHONY: bump-version bump-version-done

bump-version:
@echo -n "Please enter the version to bump: "
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"

bump-version-done:
VERSION=$(shell jq -r '.context.cookiecutter.version' .cruft.json); \
$(GIT) commit -m "chore: Bump version to $$VERSION"; \
$(GIT) tag $$VERSION


################################################################################
# CUSTOM TARGETS
################################################################################
29 changes: 28 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
.. This file is generated from sphinx-notes/cookiecutter.
You need to consider modifying the TEMPLATE or modifying THIS FILE.

========================
sphinxnotes-recentupdate
========================

Please refer to https://sphinx-notes.github.io/recentupdate/ for documentation.
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/recentupdate/github-pages
:target: https://sphinx.silverrainz.me/recentupdate
:alt: Documentation Status
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/recentupdate
:target: https://github.com/sphinx-notes/recentupdate/blob/master/LICENSE
:alt: Open Source License
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-recentupdate.svg
:target: https://pypi.python.org/pypi/sphinxnotes-recentupdate
:alt: PyPI Package
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-recentupdate
:target: https://pypi.python.org/pypi/sphinxnotes-recentupdate
:alt: PyPI Package Downloads

|docs| |license| |pypi| |download|

Get the document update information from git and display it in Sphinx documentation.

.. INTRODUCTION START
(MUST written in standard reStructuredText, without Sphinx stuff)

.. INTRODUCTION END

Please refer to Documentation_ for more details.

.. _Documentation: https://sphinx.silverrainz.me/recentupdate
17 changes: 0 additions & 17 deletions doc/confval.py

This file was deleted.

Loading