Skip to content

Commit 2075442

Browse files
SilverRainZMiniMax
andauthored
chore: Rename sphinxnotes-snippet to sphinxnotes-picker (#46)
* chore: Rename sphinxnotes-snippet to sphinxnotes-picker Updates project name from sphinxnotes-snippet to sphinxnotes-picker. Executed cruft command: $ cruft update --variables-to-update '{"name": "picker", "full_name": "sphinxnotes-picker", "pypi_name": "sphinxnotes-picker"}' --skip-apply-ask Co-authored-by: MiniMax <model@minimax.io> * refactor: Update module references from sphinxnotes.snippet to sphinxnotes.picker Co-authored-by: MiniMax <model@minimax.io> * refactor: Rename config values and variables from snippet to picker Co-authored-by: MiniMax <model@minimax.io> * fix: Keep builder name as 'snippet' for backwards compatibility Co-authored-by: MiniMax <model@minimax.io> * chore: Remove old snippet directory after rename * chore: More update --------- Co-authored-by: MiniMax <model@minimax.io>
1 parent 50beaac commit 2075442

36 files changed

Lines changed: 276 additions & 263 deletions

.cruft.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"template": "https://github.com/sphinx-notes/template",
3-
"commit": "251643b4d04376494409369c91f29ca047687a5d",
3+
"commit": "a829f105e638f3cba98b799eabef94c0148cd9c0",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
77
"namespace": "sphinxnotes",
8-
"name": "snippet",
9-
"full_name": "sphinxnotes-snippet",
8+
"name": "picker",
9+
"full_name": "sphinxnotes-picker",
1010
"author": "Shengyu Zhang",
1111
"description": "Sphinx documentation snippets manager",
1212
"version": "1.2",
1313
"github_owner": "sphinx-notes",
1414
"github_repo": "snippet",
15-
"pypi_name": "sphinxnotes-snippet",
15+
"pypi_name": "sphinxnotes-picker",
1616
"pypi_owner": "SilverRainZ",
1717
"is_python_project": true,
1818
"python_version": "3.12",
1919
"is_sphinx_extension": true,
2020
"sphinx_version": "7.0",
2121
"development_status": "3 - Alpha",
2222
"_template": "https://github.com/sphinx-notes/template",
23-
"_commit": "251643b4d04376494409369c91f29ca047687a5d"
23+
"_commit": "a829f105e638f3cba98b799eabef94c0148cd9c0"
2424
}
2525
},
2626
"directory": null

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
environment:
1212
name: pypi
13-
url: https://pypi.org/p/sphinxnotes-snippet
13+
url: https://pypi.org/p/sphinxnotes-picker
1414
permissions:
1515
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1616
steps:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- uses: ncipollo/release-action@v1
1616
with:
1717
body: |
18-
Changelog: https://sphinx.silverrainz.me/snippet/changelog.html
18+
Changelog: https://sphinx.silverrainz.me/picker/changelog.html

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ clean:
2323

2424
.PHONY: fmt
2525
fmt:
26-
ruff format src/ && ruff check --fix src/
26+
ruff format src/ tests/ && ruff check --fix src/ tests/
2727

2828
.PHONY: test
2929
test:
@@ -36,7 +36,8 @@ test:
3636
# Build distribution package, for "install" or "upload".
3737
.PHONY: dist
3838
dist: pyproject.toml clean
39-
$(PY) -m build
39+
# Use ``--no-isolation`` to prevent network accessing.
40+
$(PY) -m build --no-isolation
4041

4142
# Install distribution package to user directory.
4243
#

README.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
.. This file is generated from sphinx-notes/cookiecutter.
22
You need to consider modifying the TEMPLATE or modifying THIS FILE.
33
4-
===================
5-
sphinxnotes-snippet
6-
===================
4+
==================
5+
sphinxnotes-picker
6+
==================
77

8-
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/snippet/github-pages
9-
:target: https://sphinx.silverrainz.me/snippet
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/picker/github-pages
9+
:target: https://sphinx.silverrainz.me/picker
1010
:alt: Documentation Status
11-
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/snippet
11+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/picker
1212
:target: https://github.com/sphinx-notes/snippet/blob/master/LICENSE
1313
:alt: Open Source License
14-
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-snippet.svg
15-
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
14+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-picker.svg
15+
:target: https://pypi.python.org/pypi/sphinxnotes-picker
1616
:alt: PyPI Package
17-
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
18-
:target: https://pypistats.org/packages/sphinxnotes-snippet
17+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-picker
18+
:target: https://pypistats.org/packages/sphinxnotes-picker
1919
:alt: PyPI Package Downloads
2020

2121
|docs| |license| |pypi| |download|
@@ -29,4 +29,4 @@ Sphinx documentation snippets manager.
2929
3030
Please refer to Documentation_ for more details.
3131

32-
.. _Documentation: https://sphinx.silverrainz.me/snippet
32+
.. _Documentation: https://sphinx.silverrainz.me/picker

docs/_static/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* This file is generated from sphinx-notes/cookiecutter.
2+
* DO NOT EDIT.
3+
*/
4+
5+
/* Missing style for nodes.system_message from Alabaster. */
6+
.system-message {
7+
background-color: #fda;
8+
padding: 5px;
9+
border: 3px solid red;
10+
}

docs/conf.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# -- Project information -----------------------------------------------------
1111

12-
project = 'sphinxnotes-snippet'
12+
project = 'sphinxnotes-picker'
1313
author = 'Shengyu Zhang'
1414
copyright = "2023, " + author
1515

@@ -55,12 +55,6 @@
5555
#
5656
html_theme = 'furo'
5757

58-
html_theme_options = {}
59-
60-
# Add any paths that contain custom static files (such as style sheets) here,
61-
# relative to this directory. They are copied after the builtin static files,
62-
# so a file named "default.css" will overwrite the builtin "default.css".
63-
html_static_path = ['_static']
6458
html_theme_options = {
6559
"source_repository": "https://github.com/sphinx-notes/snippet/",
6660
"source_branch": "master",
@@ -69,10 +63,17 @@
6963

7064
# The URL which points to the root of the HTML documentation.
7165
# It is used to indicate the location of document like canonical_url
72-
html_baseurl = 'https://sphinx.silverrainz.me/snippet'
66+
html_baseurl = 'https://sphinx.silverrainz.me/picker'
7367

7468
html_logo = html_favicon = '_static/sphinx-notes.png'
7569

70+
# Add any paths that contain custom static files (such as style sheets) here,
71+
# relative to this directory. They are copied after the builtin static files,
72+
# so a file named "default.css" will overwrite the builtin "default.css".
73+
html_static_path = ['_static']
74+
75+
html_css_files = ['custom.css']
76+
7677
# -- Extensions -------------------------------------------------------------
7778

7879
extensions.append('sphinx.ext.extlinks')
@@ -117,7 +118,7 @@
117118
import os
118119
import sys
119120
sys.path.insert(0, os.path.abspath('../src/sphinxnotes'))
120-
extensions.append('snippet')
121+
extensions.append('picker')
121122

122123
# CUSTOM CONFIGURATION
123124

docs/index.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
.. This file is generated from sphinx-notes/cookiecutter.
22
You need to consider modifying the TEMPLATE or modifying THIS FILE.
33
4-
===================
5-
sphinxnotes-snippet
6-
===================
4+
==================
5+
sphinxnotes-picker
6+
==================
77

8-
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/snippet/github-pages?label=docs
9-
:target: https://sphinx.silverrainz.me/snippet
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/picker/github-pages?label=docs
9+
:target: https://sphinx.silverrainz.me/picker
1010
:alt: Documentation Status
11-
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/snippet
11+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/picker
1212
:target: https://github.com/sphinx-notes/snippet/blob/master/LICENSE
1313
:alt: Open Source License
14-
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-snippet.svg
15-
:target: https://pypistats.org/packages/sphinxnotes-snippet
14+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-picker.svg
15+
:target: https://pypistats.org/packages/sphinxnotes-picker
1616
:alt: PyPI Package
17-
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
18-
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
17+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-picker
18+
:target: https://pypi.python.org/pypi/sphinxnotes-picker
1919
:alt: PyPI Package Downloads
2020
.. |github| image:: https://img.shields.io/badge/GitHub-181717?style=flat&logo=github&logoColor=white/
21-
:target: https://github.com/sphinx-notes/snippet
21+
:target: https://github.com/sphinx-notes/picker
2222
:alt: GitHub Repository
2323

2424
|docs| |license| |pypi| |download| |github|
@@ -49,7 +49,7 @@ First, downloading extension from PyPI:
4949

5050
.. code-block:: console
5151
52-
$ pip install sphinxnotes-snippet
52+
$ pip install sphinxnotes-picker
5353
5454
5555
Then, add the extension name to ``extensions`` configuration item in your
@@ -59,7 +59,7 @@ Then, add the extension name to ``extensions`` configuration item in your
5959
6060
extensions = [
6161
#
62-
'sphinxnotes.snippet',
62+
'sphinxnotes.picker',
6363
#
6464
]
6565
@@ -95,6 +95,7 @@ as part of **The Sphinx Notes Project**.
9595
:caption: The Sphinx Notes Project
9696

9797
Home <https://sphinx.silverrainz.me/>
98+
GitHub <https://github.com/sphinx-notes>
9899
Blog <https://silverrainz.me/blog/category/sphinx.html>
99100
PyPI <https://pypi.org/search/?q=sphinxnotes>
100101

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata
77

88
[project]
9-
name = "sphinxnotes-snippet"
9+
name = "sphinxnotes-picker"
1010
description = "Sphinx documentation snippets manager"
1111
readme = "README.rst"
1212
license = "BSD-3-Clause"
@@ -38,7 +38,6 @@ classifiers = [
3838
# CUSTOM CLASSIFIERS END
3939
]
4040

41-
# See ``make pyver`` for more details.
4241
requires-python = ">=3.12"
4342
dependencies = [
4443
"Sphinx >= 7.0",
@@ -85,14 +84,15 @@ docs = [
8584
]
8685

8786
[project.urls]
88-
homepage = "https://sphinx.silverrainz.me/snippet"
89-
documentation = "https://sphinx.silverrainz.me/snippet"
87+
homepage = "https://sphinx.silverrainz.me/picker"
88+
documentation = "https://sphinx.silverrainz.me/picker"
9089
repository = "https://github.com/sphinx-notes/snippet"
91-
changelog = "https://sphinx.silverrainz.me/snippet/changelog.html"
90+
changelog = "https://sphinx.silverrainz.me/picker/changelog.html"
9291
tracker = "https://github.com/sphinx-notes/snippet/issues"
9392

9493
[project.scripts]
95-
snippet = "sphinxnotes.snippet.cli:main"
94+
sphinx-picker = "sphinxnotes.picker.cli:main"
95+
sphinxnotes-picker = "sphinxnotes.picker.cli:main"
9696

9797
[build-system]
9898
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"]
@@ -113,4 +113,4 @@ where = ["src"]
113113
[tool.setuptools.package-data]
114114
# A maps from PACKAGE NAMES to lists of glob patterns,
115115
# see also https://setuptools.pypa.io/en/latest/userguide/datafiles.html
116-
"sphinxnotes.snippet.integration" = ["*.*"]
116+
"sphinxnotes.picker.integration" = ["*.*"]
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
sphinxnotes.snippet
2+
sphinxnotes.picker
33
~~~~~~~~~~~~~~~~~~~
44
55
Sphinx extension entrypoint.
@@ -11,10 +11,10 @@
1111

1212
def setup(app):
1313
# **WARNING**: We don't import these packages globally, because the current
14-
# package (sphinxnotes.snippet) is always resloved when importing
15-
# sphinxnotes.snippet.*. If we import packages here, eventually we will
14+
# package (sphinxnotes.picker) is always resloved when importing
15+
# sphinxnotes.picker.*. If we import packages here, eventually we will
1616
# load a lot of packages from the Sphinx. It will seriously **SLOW DOWN**
17-
# the startup time of our CLI tool (sphinxnotes.snippet.cli).
17+
# the startup time of our CLI tool (sphinxnotes.picker.cli).
1818
#
1919
# .. seealso:: https://github.com/sphinx-notes/snippet/pull/31
2020
from .ext import (
@@ -27,8 +27,8 @@ def setup(app):
2727

2828
app.add_builder(SnippetBuilder)
2929

30-
app.add_config_value('snippet_config', {}, '')
31-
app.add_config_value('snippet_patterns', {'*': ['.*']}, '')
30+
app.add_config_value('picker_config', {}, '')
31+
app.add_config_value('picker_patterns', {'*': ['.*']}, '')
3232

3333
app.connect('config-inited', on_config_inited)
3434
app.connect('env-get-outdated', on_env_get_outdated)

0 commit comments

Comments
 (0)