Skip to content
Open
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
6 changes: 4 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sphinx-notes/cookiecutter",
"commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595",
"commit": "233a8daa4e276a9559975a51178f29e7079dcafd",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -12,6 +12,8 @@
"version": "0.1",
"github_owner": "sphinx-notes",
"github_repo": "project",
"generated_file_header": "This file is generated from sphinx-notes/cookiecutter.",
"dont_edit_header": "DO NOT EDIT.",
"pypi_name": "sphinxnotes-project",
"pypi_owner": "SilverRainZ",
"is_python_project": true,
Expand All @@ -20,7 +22,7 @@
"sphinx_version": "7.0",
"development_status": "3 - Alpha",
"_template": "https://github.com/sphinx-notes/cookiecutter",
"_commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595"
"_commit": "233a8daa4e276a9559975a51178f29e7079dcafd"
}
},
"directory": null
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is generated from sphinx-notes/cookiecutter.

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is generated from sphinx-notes/cookiecutter.

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.11
Expand Down
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- This file is generated from sphinx-notes/cookiecutter. -->

## 基本说明

这是一个由 SphinxNotes 开发的 Sphinx Extension,由 `sphinxnotes/cookiecutter` 生成,很多基础文件来自模板。

## 首先阅读

- 开始了解项目时,优先阅读 `docs/index.rst`。
- 如果任务和文档、Sphinx 配置或示例有关,继续阅读 `docs/` 下的其他文件

## 通用知识

- 使用 `make` 会构建 `docs/` 下的文档,文档自依赖当前项目,因此文档构建成功也意味着项目基本能正常构建
- `docs/_build` 存放构建好的文档,`make clean` 清除所有构建结果
- `make test` 运行测试,测试位于 `tests/`,可能的 e2e 测试位于 `tests/test_e2e.py`
- `make doctest` 运行 Sphinx 文档测试
- `make install` 使用 `pip install --user` 将项目安装到本地,跨项目测试时常用
- `make tmpl-*` 用于模板同步,参看 "模板同步" 小节

## 关于 SphinxNotes 项目

- 同为 `sphinxnotes` 项目的其他仓库通常位于当前项目的上一级目录
- 如果你在阅读代码时遇到本地依赖、模板来源或跨仓库复用关系,可以直接读取这些本地仓库文件,不必先猜测实现,也不必优先去远程搜索。
- 当我提到 "所有项目" 的时候,请从当前项目的上一级目录的 `cookiecutter/project-list.txt` 获取项目列表
- `docs/conf.py` 往往会直接从源码树导入当前项目,因此排查文档构建问题时,要同时检查运行时依赖和文档依赖。

## 模板同步

- 先确认任务是当前项目问题,还是模板问题;如果是模板问题,优先在 `sphinxnotes/cookiecutter` 中修复。
- 模板变更完成后,优先使用 `make tmpl-update` 把改动同步回项目,而不是手工重复修改生成文件。
- 如果 `make tmpl-update` 产生 `.rej`、冲突或三方合并失败,优先尝试 `make tmpl-apply-rej`,再手工解决冲突。
- 手工解决冲突时,重点检查 `README.rst`、`pyproject.toml`、`.github/workflows/`、`docs/conf.py`、`docs/requirements.txt` 这些常见受影响文件。
- 当模板同步结果确认无误后,优先使用 `make tmpl-update-done` 完成后续收尾步骤。

### 修改约定

- 修改模板生成文件时,保留原有注释,除非模板本身已经统一移除了这些注释。
- 遇到 `CUSTOM ... START` / `END` 这类用户自定义区块时,必须保留这些锚点,并尽量保留区块中的用户内容。
- 如果模板更新和项目内手工修改发生冲突,优先保护用户自定义内容,再整理模板变更。
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is generated from sphinx-notes/cookiecutter.
# You need to consider modifying the TEMPLATE or modifying THIS FILE.

include LICENSE
include README.rst
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. This file is generated from sphinx-notes/cookiecutter.
You need to consider modifying the TEMPLATE or modifying THIS FILE.

===================
sphinxnotes-project
Expand Down
1 change: 0 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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
1 change: 1 addition & 0 deletions docs/_images/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated from sphinx-notes/cookiecutter.
1 change: 1 addition & 0 deletions docs/_static/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated from sphinx-notes/cookiecutter.
1 change: 0 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. This file is generated from sphinx-notes/cookiecutter.
You need to consider modifying the TEMPLATE or modifying THIS FILE.

==========
Change Log
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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 Down Expand Up @@ -91,6 +90,9 @@
extensions.append('sphinx.ext.autodoc')
autoclass_content = 'init'
autodoc_typehints = 'description'
autodoc_default_options = {
'member-order': 'bysource',
}

extensions.append('sphinx.ext.intersphinx')
intersphinx_mapping = {}
Expand All @@ -109,6 +111,7 @@
'parsed_literal': (['literal'], True),
}


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

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. This file is generated from sphinx-notes/cookiecutter.
You need to consider modifying the TEMPLATE or modifying THIS FILE.

===================
sphinxnotes-project
Expand Down
75 changes: 38 additions & 37 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
REM This file is generated from sphinx-notes/cookiecutter. DO NOT EDIT.

@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
REM This file is generated from sphinx-notes/cookiecutter.
REM DO NOT EDIT.

@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
14 changes: 14 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is generated from sphinx-notes/cookiecutter.

# Documentation build dependencies.
# Keep these out of pyproject optional-dependencies to avoid resolver issues.
furo
sphinx_copybutton
sphinxcontrib-gtagjs
sphinx-sitemap
sphinxext-opengraph
sphinx-last-updated-by-git
sphinxnotes-comboroles

# CUSTOM DOCS DEPENDENCIES START
# CUSTOM DOCS DEPENDENCIES END
16 changes: 0 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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.
# Read more about the various options under:
Expand Down Expand Up @@ -61,21 +60,6 @@ dev = [
test = [
"pytest",
]
docs = [
"furo",
"sphinx_design",
"sphinx_copybutton",
"sphinxcontrib-gtagjs",
"sphinx-sitemap",
"sphinxext-opengraph",
"sphinx-last-updated-by-git",

# Dependencies of sphinxnotes projcts.
"sphinxnotes-comboroles",

# CUSTOM DOCS DEPENDENCIES START
# CUSTOM DOCS DEPENDENCIES END
]

[project.urls]
homepage = "https://sphinx.silverrainz.me/project"
Expand Down
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is generated from sphinx-notes/cookiecutter.
# You need to consider modifying the TEMPLATE or modifying THIS FILE.

exclude = [
"docs/conf.py",
Expand Down
2 changes: 1 addition & 1 deletion src/sphinxnotes/project/meta.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is generated from sphinx-notes/cookiecutter.
# DO NOT EDIT!!!
# DO NOT EDIT.

################################################################################
# Project meta infos.
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated from sphinx-notes/cookiecutter.
Loading