scverse-doc 0.5.0__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/autofix.yaml +1 -1
  2. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/build.yaml +1 -1
  3. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/pr.yaml +1 -1
  4. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/release.yaml +1 -1
  5. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/sync.yaml +1 -1
  6. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/workflows/test.yaml +1 -1
  7. scverse_doc-0.5.2/.panache.toml +14 -0
  8. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.pre-commit-config.yaml +10 -5
  9. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.vscode/extensions.json +1 -0
  10. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.vscode/settings.json +5 -2
  11. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/CHANGELOG.md +19 -1
  12. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/PKG-INFO +4 -4
  13. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/README.md +3 -3
  14. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/biome.jsonc +1 -0
  15. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/registry.py +5 -5
  16. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/release_notes.py +4 -6
  17. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/__init__.py +28 -11
  18. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/components/scverse-ecosystem.html +3 -2
  19. scverse_doc-0.5.2/src/scverse_doc/theme/scverse/components/scverse-footer.html +22 -0
  20. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/theme.toml +0 -1
  21. scverse_doc-0.5.0/src/scverse_doc/theme/scverse/components/scverse-footer.html +0 -18
  22. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.codecov.yaml +0 -0
  23. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.cruft.json +0 -0
  24. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.editorconfig +0 -0
  25. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  26. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  27. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  28. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.github/dependabot.yml +0 -0
  29. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.gitignore +0 -0
  30. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.readthedocs.yaml +0 -0
  31. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/.vscode/launch.json +0 -0
  32. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/LICENSE +0 -0
  33. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/hatch_build.py +0 -0
  34. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/pyproject.toml +0 -0
  35. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/scripts/check_changelog.py +0 -0
  36. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/scripts/sync_upstream.py +0 -0
  37. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/__init__.py +0 -0
  38. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/_accents.json +0 -0
  39. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/autodoc/__init__.py +0 -0
  40. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/autodoc/templates/autosummary/class.rst +0 -0
  41. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/autodoc/templates/autosummary/module.rst +0 -0
  42. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/config.py +0 -0
  43. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/math_core.py +0 -0
  44. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/napoleon.py +0 -0
  45. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/py.typed +0 -0
  46. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/source.py +0 -0
  47. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/static/math_core.css +0 -0
  48. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/static/mathmlfixes.css +0 -0
  49. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/_bundle.py +0 -0
  50. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/components/scverse-sidebar-nav.html +0 -0
  51. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/components/sidebar-versions.html +0 -0
  52. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/components/toggle-primary-sidebar.html +0 -0
  53. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/components/toggle-secondary-sidebar.html +0 -0
  54. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/layout.html +0 -0
  55. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/scripts/readthedocs-integration.js +0 -0
  56. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/scverse-fa.svg +0 -0
  57. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/styles/_pydata.css +0 -0
  58. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/styles/_readthedocs.css +0 -0
  59. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/styles/_tokens.css +0 -0
  60. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/theme/scverse/static/styles/scverse.css +0 -0
  61. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/typed_fields.py +0 -0
  62. {scverse_doc-0.5.0 → scverse_doc-0.5.2}/src/scverse_doc/xref_overrides.py +0 -0
@@ -19,7 +19,7 @@ jobs:
19
19
  fetch-depth: 0
20
20
  filter: blob:none
21
21
  persist-credentials: false
22
- - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
22
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
23
23
  with:
24
24
  enable-cache: true
25
25
  - run: uv tool install hatch
@@ -23,7 +23,7 @@ jobs:
23
23
  fetch-depth: 0
24
24
  persist-credentials: false
25
25
  - name: Install uv
26
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
26
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
27
27
  - name: Build package
28
28
  run: uv build
29
29
  - name: Check package
@@ -12,7 +12,7 @@ jobs:
12
12
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
13
13
  with:
14
14
  persist-credentials: false
15
- - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
15
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
16
16
  - run: uv run scripts/check_changelog.py --pr="$PR" --title="$TITLE"
17
17
  env:
18
18
  PR: ${{ github.event.pull_request.number }}
@@ -24,7 +24,7 @@ jobs:
24
24
  fetch-depth: 0
25
25
  persist-credentials: false
26
26
  - name: Install uv
27
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
27
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
28
28
  with:
29
29
  enable-cache: false
30
30
  - name: Build package
@@ -32,5 +32,5 @@ jobs:
32
32
  repository: tmke8/math-core
33
33
  path: .upstream/math-core
34
34
  persist-credentials: false
35
- - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
35
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
36
36
  - run: uv run scripts/sync_upstream.py --website .upstream/website --math-core .upstream/math-core --check
@@ -33,7 +33,7 @@ jobs:
33
33
  fetch-depth: 0
34
34
  persist-credentials: false
35
35
  - &setup-uv
36
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
36
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
37
37
  - name: Get test environments
38
38
  id: get-envs
39
39
  run: |
@@ -0,0 +1,14 @@
1
+ #:schema https://panache.bz/panache.schema.json
2
+ flavor = "myst"
3
+
4
+ [format]
5
+ wrap = "preserve"
6
+ smart-punctuation = "unicode"
7
+ tab-stops = "preserve"
8
+
9
+ # MyST syntax extensions from `scverse_doc.config.MYST_ENABLE_EXTENSIONS`
10
+ [extensions]
11
+ myst-colon-fence = true # colon_fence
12
+ definition-lists = true # deflist
13
+ tex-math-dollars = true # dollarmath, amsmath
14
+ raw-html = true # html_image, html_admonition
@@ -7,26 +7,31 @@ default_stages:
7
7
  minimum_pre_commit_version: 2.16.0
8
8
  repos:
9
9
  - repo: https://github.com/biomejs/pre-commit
10
- rev: v2.6.3
10
+ rev: v2.6.7
11
11
  hooks:
12
12
  - id: biome-format
13
13
  exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
14
14
  groups: [format]
15
15
  - id: biome-lint
16
16
  args: [--error-on-warnings]
17
+ - repo: https://github.com/jolars/panache-pre-commit
18
+ rev: v3.18.0
19
+ hooks:
20
+ - id: panache-format
21
+ groups: [format]
17
22
  - repo: https://github.com/tox-dev/pyproject-fmt
18
- rev: v2.30.3
23
+ rev: v2.30.6
19
24
  hooks:
20
25
  - id: pyproject-fmt
21
26
  groups: [format]
22
27
  - repo: https://github.com/djlint/djLint
23
- rev: v1.47.0
28
+ rev: v1.50.2
24
29
  hooks:
25
30
  - id: djlint-reformat
26
31
  groups: [format]
27
32
  - id: djlint
28
33
  - repo: https://github.com/astral-sh/ruff-pre-commit
29
- rev: v0.17.2
34
+ rev: v0.17.5
30
35
  hooks:
31
36
  - id: ruff-check
32
37
  args: [--fix, --exit-non-zero-on-fix]
@@ -60,7 +65,7 @@ repos:
60
65
  - id: check-merge-conflict
61
66
  args: [--assume-in-merge]
62
67
  - repo: https://github.com/zizmorcore/zizmor-pre-commit
63
- rev: v1.31.1
68
+ rev: v1.32.0
64
69
  hooks:
65
70
  - id: zizmor
66
71
  args: [--no-progress, --fix]
@@ -14,5 +14,6 @@
14
14
  "editorconfig.editorconfig",
15
15
  "charliermarsh.ruff",
16
16
  "biomejs.biome",
17
+ "jolars.panache",
17
18
  ],
18
19
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "[python][json][jsonc]": {
2
+ "[python][json][jsonc][yaml][markdown]": {
3
3
  "editor.formatOnSave": true,
4
4
  },
5
5
  "[python]": {
@@ -9,9 +9,12 @@
9
9
  "source.organizeImports.ruff": "always",
10
10
  },
11
11
  },
12
- "[json][jsonc]": {
12
+ "[json][jsonc][yaml]": {
13
13
  "editor.defaultFormatter": "biomejs.biome",
14
14
  },
15
+ "[markdown]": {
16
+ "editor.defaultFormatter": "jolars.panache",
17
+ },
15
18
  "python.testing.pytestEnabled": true,
16
19
  "python.testing.pytestArgs": ["-vv", "--color=yes"],
17
20
  "python-envs.defaultEnvManager": "pypa.hatch:hatch",
@@ -10,6 +10,22 @@ and this project adheres to [Semantic Versioning][].
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.5.2]
14
+
15
+ ### Added
16
+
17
+ - the registry covers scverse’s infrastructure repositories (e.g. `scverse-doc`, `cookiecutter-scverse`) as `kind="infrastructure"` (#96)
18
+
19
+ ### Changed
20
+
21
+ - the scverse branding depends on the package’s registry entry: ecosystem packages get the scverse menu and Discourse link, scverse’s own packages also the footer’s scverse lines and the announcement banner, and unregistered projects none of it (#96)
22
+
23
+ ## [0.5.1]
24
+
25
+ ### Fixed
26
+
27
+ - `release-notes` nests Markdown notes under its version headings again when `.md` is parsed by MyST-NB (#87)
28
+
13
29
  ## [0.5.0]
14
30
 
15
31
  ### Added
@@ -100,7 +116,9 @@ and this project adheres to [Semantic Versioning][].
100
116
  - Read the Docs integration: version selector and search, both with dark mode
101
117
  - Autodoc, prose, and confval rendering extensions (from scverse-misc)
102
118
 
103
- [Unreleased]: https://github.com/scverse/scverse-doc/compare/v0.5.0...main
119
+ [Unreleased]: https://github.com/scverse/scverse-doc/compare/v0.5.2...main
120
+ [0.5.2]: https://github.com/scverse/scverse-doc/releases/tag/v0.5.2
121
+ [0.5.1]: https://github.com/scverse/scverse-doc/releases/tag/v0.5.1
104
122
  [0.5.0]: https://github.com/scverse/scverse-doc/releases/tag/v0.5.0
105
123
  [0.4.0]: https://github.com/scverse/scverse-doc/releases/tag/v0.4.0
106
124
  [0.3.0]: https://github.com/scverse/scverse-doc/releases/tag/v0.3.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scverse-doc
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: Scverse documentation theme and utilities.
5
5
  Project-URL: Documentation, https://scverse-doc.readthedocs.io/
6
6
  Project-URL: Homepage, https://github.com/scverse/scverse-doc
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
42
42
 
43
43
  The shared Sphinx theme and documentation configuration for scverse packages.
44
44
 
45
- Install it, and a package's `conf.py` becomes:
45
+ Install it, and a package’s `conf.py` becomes:
46
46
 
47
47
  ```python
48
48
  extensions = ["scverse_doc"]
@@ -50,7 +50,7 @@ extensions = ["scverse_doc"]
50
50
  source_repository = "https://github.com/scverse/pertpy"
51
51
  ```
52
52
 
53
- That gets you the scverse brand and dark mode, the shared sidebar layout, footer, and announcement banner, a "scverse packages" dropdown generated from the package registry, cross-links to every core package, the repository links ("edit this page" and the header icon), and the standard extension stack.
53
+ That gets you the scverse brand and dark mode, the shared sidebar layout, footer, and announcement banner, a “scverse packages” dropdown generated from the package registry, cross-links to every core package, the repository links (“edit this page” and the header icon), and the standard extension stack.
54
54
 
55
55
  Every piece also works on its own. For the theme without the extension stack or the shared defaults, select it and leave `extensions` alone – it is a registered Sphinx theme, so installing the package is enough:
56
56
 
@@ -69,7 +69,7 @@ The [kitchen sink][] shows every construct the theme styles, in both colour sche
69
69
  ## Installation
70
70
 
71
71
  You need to have Python 3.12 or newer installed on your system.
72
- If you don't have Python installed, we recommend installing [uv][].
72
+ If you don’t have Python installed, we recommend installing [uv][].
73
73
 
74
74
  We recommend managing dependencies in project-specific virtual environments to avoid dependency conflicts.
75
75
  This is most convenient using package managers such as [uv][].
@@ -18,7 +18,7 @@
18
18
 
19
19
  The shared Sphinx theme and documentation configuration for scverse packages.
20
20
 
21
- Install it, and a package's `conf.py` becomes:
21
+ Install it, and a package’s `conf.py` becomes:
22
22
 
23
23
  ```python
24
24
  extensions = ["scverse_doc"]
@@ -26,7 +26,7 @@ extensions = ["scverse_doc"]
26
26
  source_repository = "https://github.com/scverse/pertpy"
27
27
  ```
28
28
 
29
- That gets you the scverse brand and dark mode, the shared sidebar layout, footer, and announcement banner, a "scverse packages" dropdown generated from the package registry, cross-links to every core package, the repository links ("edit this page" and the header icon), and the standard extension stack.
29
+ That gets you the scverse brand and dark mode, the shared sidebar layout, footer, and announcement banner, a “scverse packages” dropdown generated from the package registry, cross-links to every core package, the repository links (“edit this page” and the header icon), and the standard extension stack.
30
30
 
31
31
  Every piece also works on its own. For the theme without the extension stack or the shared defaults, select it and leave `extensions` alone – it is a registered Sphinx theme, so installing the package is enough:
32
32
 
@@ -45,7 +45,7 @@ The [kitchen sink][] shows every construct the theme styles, in both colour sche
45
45
  ## Installation
46
46
 
47
47
  You need to have Python 3.12 or newer installed on your system.
48
- If you don't have Python installed, we recommend installing [uv][].
48
+ If you don’t have Python installed, we recommend installing [uv][].
49
49
 
50
50
  We recommend managing dependencies in project-specific virtual environments to avoid dependency conflicts.
51
51
  This is most convenient using package managers such as [uv][].
@@ -12,6 +12,7 @@
12
12
  ],
13
13
  },
14
14
  "formatter": { "useEditorconfig": true },
15
+ "markdown": { "formatter": { "enabled": false } }, // handled by panache
15
16
  "javascript": {
16
17
  "formatter": {
17
18
  "semicolons": "asNeeded",
@@ -72,11 +72,10 @@ _ACCENTS: dict[str, list[str]] = {
72
72
  DEFAULT_ACCENT = _ACCENTS.pop("scverse")[0]
73
73
 
74
74
  #: Upstream ``category`` -> the ``kind`` recorded here.
75
- #: ``core-infrastructure`` is skipped:
76
- #: those entries are repositories (governance, stats, the website), not packages.
77
- _KINDS: dict[str, Literal["core", "ecosystem"]] = {
75
+ _KINDS: dict[str, Literal["core", "infrastructure", "ecosystem"]] = {
78
76
  "core-datastructure": "core",
79
77
  "core-framework": "core",
78
+ "core-infrastructure": "infrastructure",
80
79
  "ecosystem": "ecosystem",
81
80
  }
82
81
 
@@ -97,8 +96,9 @@ class Package:
97
96
  name: str
98
97
  """The package’s display name, e.g. ``"scvi-tools"``."""
99
98
 
100
- kind: Literal["core", "ecosystem"]
101
- """Whether the package is maintained by the core team or listed as an ecosystem package."""
99
+ kind: Literal["core", "infrastructure", "ecosystem"]
100
+ """Whether the package is maintained by the core team, is part of scverse’s own tooling
101
+ (e.g. this package, the cookiecutter, the website), or is listed as an ecosystem package."""
102
102
 
103
103
  docs: str
104
104
  """Where to send a reader – a link for humans, not necessarily a documentation root."""
@@ -69,8 +69,6 @@ FULL_VERSION_RE = re.compile(r"^(\d+)\.(\d+)\.(\d+)(?:.*)?$")
69
69
  class _Backend:
70
70
  dir: Path
71
71
  instance: SphinxDirective
72
- #: The format the directive is in, which :meth:`render_native` parses.
73
- filetype: ClassVar[str] = "restructuredtext"
74
72
 
75
73
  def run(self) -> Sequence[nodes.Node]:
76
74
  versions = sorted(
@@ -102,11 +100,13 @@ class _Backend:
102
100
  def render_include(self, path: Path) -> Sequence[nodes.Node]:
103
101
  """Parse `path` with the parser for its suffix, falling back to the page’s."""
104
102
  env = self.instance.env
103
+ # filetype names depend on `source_suffix` (e.g. `.md` can be `markdown` or `myst-nb`)
104
+ page_filetype = get_filetype(env.config.source_suffix, env.doc2path(env.docname))
105
105
  try:
106
106
  filetype = get_filetype(env.config.source_suffix, path)
107
107
  except FiletypeNotFoundError: # e.g. `.txt`
108
- filetype = self.filetype
109
- if filetype == self.filetype:
108
+ filetype = page_filetype
109
+ if filetype == page_filetype:
110
110
  return self.render_native(path)
111
111
  # Like docutils’ ``include`` with ``:parser:``: parse into a document sharing the page’s targets
112
112
  parser = env._registry.create_source_parser(filetype, config=env.config, env=env)
@@ -128,8 +128,6 @@ class _Backend:
128
128
  # TODO(flying-sheep): Remove once MyST-Parser bug is fixed
129
129
  # https://github.com/executablebooks/MyST-Parser/issues/967
130
130
  class _BackendMyst(_Backend):
131
- filetype: ClassVar[str] = "markdown"
132
-
133
131
  def run(self) -> Sequence[nodes.Node]:
134
132
  super().run()
135
133
  return []
@@ -7,6 +7,13 @@ Declare the package with the :ref:`theme options <theme-options>`;
7
7
  This theme sets up :mod:`scverse_doc.source`, which adds the repository links.
8
8
  The accent colour and the “scverse packages” dropdown come from the
9
9
  :mod:`registry <scverse_doc.registry>`, without any configuration.
10
+
11
+ What identifies a site as scverse depends on the package’s registry entry:
12
+
13
+ - every registered package gets the scverse menu and the Discourse link;
14
+ - scverse’s own packages (core and infrastructure) also get the footer’s
15
+ scverse/NumFOCUS lines and the shared announcement banner;
16
+ - an unregistered project gets none of these, only the look.
10
17
  """
11
18
 
12
19
  from __future__ import annotations
@@ -21,7 +28,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
21
28
  from sphinx.environment.adapters.toctree import _resolve_toctree
22
29
  from sphinx.util.typing import ExtensionMetadata
23
30
 
24
- from ..registry import DEFAULT_ACCENT, _build_cache, packages
31
+ from ..registry import DEFAULT_ACCENT, Package, _build_cache, packages
25
32
  from ._bundle import bundle, find_lightningcss
26
33
 
27
34
  if TYPE_CHECKING:
@@ -75,18 +82,22 @@ _SECONDARY_ACCENT_CSS = f"""\
75
82
  }}}}
76
83
  """
77
84
 
78
- #: scverse.org itself is linked from the scverse menu beside them.
85
+ #: For every registered package; scverse.org itself is linked from the scverse menu beside them.
79
86
  _ICON_LINKS = ({"name": "Discourse", "url": "https://discourse.scverse.org/", "icon": "fa-brands fa-discourse"},)
80
87
 
88
+ #: The banner shared by scverse’s own projects, i.e. not the ecosystem packages.
89
+ _ANNOUNCEMENT_URL = "https://scverse.org/announcement.html"
90
+
81
91
 
82
- def _package_name(config: Config) -> str:
83
- return str(config.html_theme_options.get("package") or config.project)
92
+ def _package(config: Config) -> Package | None:
93
+ pkg_name = str(config.html_theme_options.get("package") or config.project)
94
+ return packages.get(pkg_name)
84
95
 
85
96
 
86
97
  def _accent(config: Config) -> str:
87
98
  if accent := config.html_theme_options.get("accent"):
88
99
  return str(accent)
89
- if (pkg := packages.get(_package_name(config))) is not None:
100
+ if (pkg := _package(config)) is not None:
90
101
  return pkg.accent
91
102
  return DEFAULT_ACCENT
92
103
 
@@ -95,17 +106,21 @@ def _secondary_accent(config: Config) -> str | None:
95
106
  accent: str | bool = config.html_theme_options.get("secondary_accent")
96
107
  if accent is not True:
97
108
  return accent or None
98
- if pkg := packages.get(_package_name(config)):
109
+ if pkg := _package(config):
99
110
  return pkg.secondary_accent
100
111
  return None
101
112
 
102
113
 
103
114
  def _add_chrome(config: Config) -> None:
104
- """Add the brand icon links and the colour mode, alongside whatever :mod:`scverse_doc.source` set."""
115
+ """Add the colour mode, and for registered packages the scverse links, alongside what :mod:`~scverse_doc.source` set."""
116
+ config.html_context = {"default_mode": "auto", **config.html_context}
117
+ if (pkg := _package(config)) is None:
118
+ return
105
119
  options = config.html_theme_options
106
120
  # Appended, so this works whichever order `scverse_doc.source`’s hook runs in.
107
121
  options["icon_links"] = [*options.get("icon_links", []), *_ICON_LINKS]
108
- config.html_context = {"default_mode": "auto", **config.html_context}
122
+ if pkg.kind != "ecosystem":
123
+ options.setdefault("announcement", _ANNOUNCEMENT_URL)
109
124
 
110
125
 
111
126
  def _configure(app: Sphinx) -> None:
@@ -145,13 +160,15 @@ def _add_ecosystem_context(
145
160
  context: dict[str, object],
146
161
  doctree: object,
147
162
  ) -> None:
148
- """Expose the registry to the scverse menu template."""
163
+ """Expose the package’s registry kind to the scverse templates, and the registry to the scverse menu."""
149
164
  if app.config.html_theme != "scverse":
150
165
  return
151
- current = _package_name(app.config).lower()
166
+ current = _package(app.config)
167
+ context["scverse_kind"] = current and current.kind
152
168
  groups: dict[str, list[dict[str, object]]] = {"core": [], "ecosystem": []}
153
169
  for pkg in packages.values():
154
- groups[pkg.kind].append({"name": pkg.name, "docs": pkg.docs, "current": pkg.name.lower() == current})
170
+ if pkg.kind in groups: # scverse’s own tooling isn’t what readers browse for
171
+ groups[pkg.kind].append({"name": pkg.name, "docs": pkg.docs, "current": pkg is current})
155
172
  context["scverse_ecosystem"] = groups
156
173
 
157
174
 
@@ -3,8 +3,9 @@
3
3
  The packages are generated from the registry,
4
4
  so adding a package to scverse/ecosystem-packages makes it reachable from every scverse docs site
5
5
  without any package touching its own conf.py.
6
+ Projects outside the registry don’t get the menu at all.
6
7
  -#}
7
- {%- if theme_show_ecosystem_dropdown | tobool and scverse_ecosystem -%}
8
+ {%- if scverse_kind and theme_show_ecosystem_dropdown | tobool -%}
8
9
  <div
9
10
  class="dropdown scverse-ecosystem-dropdown"
10
11
  data-bs-toggle="tooltip"
@@ -40,7 +41,7 @@
40
41
  {%- endfor %}
41
42
  </ul>
42
43
  </div>
43
- {%- else -%}
44
+ {%- elif scverse_kind -%}
44
45
  <a
45
46
  class="nav-link pst-navbar-icon"
46
47
  href="https://scverse.org/"
@@ -0,0 +1,22 @@
1
+ {#- Shared footer: the boilerplate every scverse README already carries, rendered identically on every docs site.
2
+ The scverse lines are only for scverse’s own projects: on an ecosystem package they’d read as if scverse ran it.
3
+ -#}
4
+ <div class="scverse-footer-brand">
5
+ <span>{%- if show_copyright and copyright %}© {{ copyright }}{% endif -%}</span>
6
+ {%- if scverse_kind in ("core", "infrastructure") %}
7
+ <span>
8
+ <a href="https://scverse.org/">scverse</a> is a
9
+ <a href="https://numfocus.org/">NumFOCUS</a> affiliated project.
10
+ </span>
11
+ <span>
12
+ <a href="https://scverse.org/about/roles/">Governance</a>
13
+ ·
14
+ <a href="https://discourse.scverse.org/">Discourse</a>
15
+ ·
16
+ <a href="https://scverse.org/join/">Get involved</a>
17
+ </span>
18
+ {%- endif %}
19
+ {%- if last_updated %}
20
+ <span>{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}</span>
21
+ {%- endif %}
22
+ </div>
@@ -30,4 +30,3 @@ navigation_depth = 3
30
30
  collapse_navigation = false
31
31
  pygments_light_style = "tango"
32
32
  pygments_dark_style = "monokai"
33
- announcement = "https://scverse.org/announcement.html"
@@ -1,18 +0,0 @@
1
- {#- Shared footer: the boilerplate every scverse README already carries, rendered identically on every docs site. -#}
2
- <div class="scverse-footer-brand">
3
- <span>{%- if show_copyright and copyright %}© {{ copyright }}{% endif -%}</span>
4
- <span>
5
- <a href="https://scverse.org/">scverse</a> is a
6
- <a href="https://numfocus.org/">NumFOCUS</a> affiliated project.
7
- </span>
8
- <span>
9
- <a href="https://scverse.org/about/roles/">Governance</a>
10
- ·
11
- <a href="https://discourse.scverse.org/">Discourse</a>
12
- ·
13
- <a href="https://scverse.org/join/">Get involved</a>
14
- </span>
15
- {%- if last_updated %}
16
- <span>{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}</span>
17
- {%- endif %}
18
- </div>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes