afterpython 0.4.9__py3-none-any.whl → 0.5.1__py3-none-any.whl

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.
@@ -12,6 +12,7 @@ from afterpython.builders.marimo_content import build_marimo_content
12
12
  from afterpython.builders.marimo_notebook import build_marimo_readme
13
13
  from afterpython.builders.markdown import build_markdown
14
14
  from afterpython.builders.metadata import build_metadata
15
+ from afterpython.builders.seo import build_seo
15
16
  from afterpython.builders.url_md import build_url_md
16
17
 
17
18
  __all__ = (
@@ -25,6 +26,7 @@ __all__ = (
25
26
  "build_markdown",
26
27
  "build_metadata",
27
28
  "build_pdoc",
29
+ "build_seo",
28
30
  "build_url_md",
29
31
  "create_placeholder_index_md_files",
30
32
  "delete_placeholder_index_md_files",
@@ -66,5 +66,6 @@ def build_pdoc(base_path: str) -> None:
66
66
  if result.returncode != 0:
67
67
  raise click.ClickException(
68
68
  f"pdoc failed with exit code {result.returncode}. "
69
- f"Re-run `ap build --skip-api` to skip API reference generation."
69
+ "To skip API reference generation, set `api_reference = false` "
70
+ "under [website] in afterpython.toml."
70
71
  )
@@ -1,8 +1,10 @@
1
1
  import json
2
- import os
2
+ import re
3
3
  from pathlib import Path
4
4
 
5
5
  import click
6
+ from ruamel.yaml import YAML
7
+ from ruamel.yaml.error import YAMLError
6
8
 
7
9
  import afterpython as ap
8
10
  from afterpython.builders.marimo_notebook import _create_molab_url, _get_molab_badge
@@ -178,6 +180,43 @@ def _add_thumbnail_to_notebook(
178
180
  return True
179
181
 
180
182
 
183
+ def _wants_molab_badge(notebook: dict) -> bool:
184
+ """True if the notebook's frontmatter sets `molab_badge: true`, or a
185
+ generated notebook already had it moved into its metadata."""
186
+ if notebook.get("metadata", {}).get("afterpython", {}).get("molab_badge"):
187
+ return True
188
+ content = _read_frontmatter(notebook)
189
+ if content is None:
190
+ return False
191
+ match = re.match(r"^---\s*\n(.*?)\n---", content, re.DOTALL)
192
+ if not match:
193
+ return False
194
+ try:
195
+ data = YAML(typ="safe").load(match.group(1))
196
+ except YAMLError:
197
+ return False
198
+ return isinstance(data, dict) and data.get("molab_badge") is True
199
+
200
+
201
+ def _remove_frontmatter_key(notebook: dict, key: str):
202
+ content = _read_frontmatter(notebook)
203
+ if content is None:
204
+ return
205
+ lines = [line for line in content.split("\n") if not line.startswith(f"{key}:")]
206
+ _write_frontmatter(notebook, "\n".join(lines))
207
+
208
+
209
+ def _remove_molab_badge_from_notebook(notebook: dict) -> bool:
210
+ """Remove a badge cell left by an earlier build, e.g. after `molab_badge`
211
+ was turned off in a committed notebook. Returns True if one was removed."""
212
+ cells = notebook["cells"]
213
+ kept = [cell for cell in cells if cell.get("id") != "molab-badge-cell"]
214
+ if len(kept) == len(cells):
215
+ return False
216
+ notebook["cells"] = kept
217
+ return True
218
+
219
+
181
220
  def _add_molab_badge_to_notebook(notebook: dict, github_url: str, content_path: Path):
182
221
  """Add a molab badge markdown cell to a single notebook.
183
222
 
@@ -224,20 +263,9 @@ def build_jupyter_notebooks():
224
263
  """Build Jupyter notebooks for all content types"""
225
264
  from afterpython.tools._afterpython import get_default_thumbnail
226
265
 
227
- # Check if molab badge feature is enabled
228
- add_molab_badge = os.getenv("AP_MOLAB_BADGE", "0") == "1"
229
-
230
- # Get GitHub URL once if needed for molab badges
266
+ # read pyproject.toml only once a notebook wants a badge
231
267
  github_url = None
232
- if add_molab_badge:
233
- metadata = read_metadata()
234
- if "repository" in metadata.urls:
235
- github_url = metadata.urls["repository"]
236
- else:
237
- click.echo(
238
- "⚠ Repository URL not found in [project.urls] in pyproject.toml, skipping molab badge"
239
- )
240
- add_molab_badge = False
268
+ github_url_read = False
241
269
 
242
270
  for content_type in CONTENT_TYPES:
243
271
  click.echo(f"Building Jupyter notebooks for {content_type}/...")
@@ -269,9 +297,18 @@ def build_jupyter_notebooks():
269
297
  # Track if notebook was modified
270
298
  modified = False
271
299
 
272
- # Add molab badge if enabled. A notebook generated from a marimo .py
273
- # isn't committed, so the badge must open the .py instead.
274
- if add_molab_badge and github_url:
300
+ # Add a molab badge if the notebook opts in with `molab_badge: true`
301
+ # in its frontmatter. A notebook generated from a marimo .py isn't
302
+ # committed, so the badge must open the .py instead.
303
+ wants_badge = _wants_molab_badge(notebook)
304
+ if wants_badge and not github_url_read:
305
+ github_url = read_metadata().urls.get("repository")
306
+ github_url_read = True
307
+ if wants_badge and not github_url:
308
+ click.echo(
309
+ f"⚠ Repository URL not found in [project.urls] in pyproject.toml, skipping molab badge in {content_path}"
310
+ )
311
+ if wants_badge and github_url:
275
312
  generated_from = (
276
313
  notebook.get("metadata", {})
277
314
  .get("afterpython", {})
@@ -284,6 +321,16 @@ def build_jupyter_notebooks():
284
321
  )
285
322
  _add_molab_badge_to_notebook(notebook, github_url, molab_path)
286
323
  modified = True
324
+ # MyST warns about unknown frontmatter keys. A generated notebook is
325
+ # a build output, so move the key into its metadata, where a cached
326
+ # rebuild still finds it; a hand-written notebook is the source and
327
+ # must keep it.
328
+ afterpython_metadata = notebook.get("metadata", {}).get("afterpython")
329
+ if wants_badge and afterpython_metadata is not None:
330
+ afterpython_metadata["molab_badge"] = True
331
+ _remove_frontmatter_key(notebook, "molab_badge")
332
+ elif _remove_molab_badge_from_notebook(notebook):
333
+ modified = True
287
334
 
288
335
  # Add thumbnail to frontmatter
289
336
  if content_type != "doc" and _add_thumbnail_to_notebook(
@@ -333,12 +333,42 @@ def _rewrite_cell_ids(notebook: dict, prefix: str):
333
333
  cell["id"] = cell_id
334
334
 
335
335
 
336
+ def _markdown_output_to_markdown_cell(notebook: dict):
337
+ """A static `mo.md("...")` cell exports as a markdown cell, but a dynamic one
338
+ (e.g. an f-string) stays a code cell with a `text/markdown` output, and MyST
339
+ renders that output as raw text instead of markdown. When the code is hidden,
340
+ only the output is shown anyway, so turn the cell into a markdown cell with
341
+ the output as its source."""
342
+ for index, cell in enumerate(notebook["cells"]):
343
+ if cell.get("cell_type") != "code":
344
+ continue
345
+ hide_code = (
346
+ cell.get("metadata", {})
347
+ .get("marimo", {})
348
+ .get("config", {})
349
+ .get("hide_code", False)
350
+ )
351
+ outputs = cell.get("outputs", [])
352
+ if not hide_code or len(outputs) != 1:
353
+ continue
354
+ data = outputs[0].get("data", {})
355
+ if "text/markdown" not in data or set(data) - {"text/markdown", "text/plain"}:
356
+ continue
357
+ notebook["cells"][index] = {
358
+ "cell_type": "markdown",
359
+ "id": cell.get("id", ""),
360
+ "metadata": {},
361
+ "source": _as_lines(data["text/markdown"]),
362
+ }
363
+
364
+
336
365
  def _postprocess(
337
366
  notebook: dict, source: Path, content_path: Path, marimo_version: str
338
367
  ) -> dict:
339
368
  for cell in notebook["cells"]:
340
369
  cell["source"] = _as_lines(cell.get("source", ""))
341
370
  _check_no_errors(notebook, source)
371
+ _markdown_output_to_markdown_cell(notebook)
342
372
  _check_frontmatter_first(notebook, source)
343
373
  _warn_heading_not_first(notebook, source)
344
374
  # outputs come from the sandbox, `myst build --execute` must not redo them
@@ -55,6 +55,9 @@ def build_metadata():
55
55
 
56
56
  afterpython = read_afterpython()
57
57
  website = _from_tomlkit(afterpython.get("website", {}))
58
+ # homepage <title>, e.g. "PyTrade - Python Trading Resources & Tutorials";
59
+ # empty means the frontend falls back to its own default
60
+ metadata_json["site_title"] = str(website.get("title", "")).strip()
58
61
  metadata_json["announcement"] = str(website.get("announcement", "")).strip()
59
62
  metadata_json["readme_py"] = _resolve_readme_py(website)
60
63
  # Logos are served from the site root in _website/ (assets copied from
@@ -0,0 +1,218 @@
1
+ """Post-process the final static site (afterpython/_website/build/) for SEO.
2
+
3
+ Runs after `pnpm build`, on the HTML that actually gets deployed, so it covers
4
+ both the SvelteKit pages and the MyST content pages without touching either
5
+ generator:
6
+
7
+ - one canonical URL per page: `x/index.html` -> `{url}/x/`, `x.html` -> `{url}/x`,
8
+ matching how GitHub Pages serves them (no redirect, no duplicate)
9
+ - `<link rel="canonical">` injected into every indexable page
10
+ - internal links rewritten to that canonical form, so `/doc/quickstart` (301 on
11
+ GitHub Pages) becomes `/doc/quickstart/`
12
+ - `noindex` on the SPA fallback (200.html) and 404.html
13
+ - sitemap.xml listing every indexable page, plus a robots.txt pointing to it
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import html
19
+ import posixpath
20
+ import re
21
+ from functools import partial
22
+ from pathlib import Path, PurePosixPath
23
+ from xml.sax.saxutils import escape
24
+
25
+ import click
26
+
27
+ import afterpython as ap
28
+
29
+ # pages that must not be indexed or listed in the sitemap
30
+ NOINDEX_FILES = {"200.html", "404.html"}
31
+
32
+ _HEAD_OPEN = re.compile(r"<head[^>]*>", re.IGNORECASE)
33
+ _CANONICAL = re.compile(r"<link[^>]*rel=[\"']?canonical", re.IGNORECASE)
34
+ _ROBOTS_NOINDEX = re.compile(
35
+ r"<meta[^>]*name=[\"']?robots[\"']?[^>]*noindex", re.IGNORECASE
36
+ )
37
+ # SvelteKit's prerendered redirect, e.g. blog/x.html -> blog/x/ (old post links)
38
+ _META_REFRESH = re.compile(r"<meta[^>]*http-equiv=[\"']?refresh", re.IGNORECASE)
39
+ # href on any tag, skipping external (scheme:) and fragment-only links
40
+ _HREF = re.compile(
41
+ r"""(\shref=)(["'])(?![a-zA-Z][\w+.-]*:|#)([^"']+)\2""", re.IGNORECASE
42
+ )
43
+
44
+
45
+ def _canonical_path(rel: PurePosixPath) -> str:
46
+ """URL path (without base path) under which GitHub Pages serves `rel` with a 200."""
47
+ if rel.name == "index.html":
48
+ parent = rel.parent.as_posix()
49
+ return "/" if parent == "." else f"/{parent}/"
50
+ return "/" + rel.with_suffix("").as_posix()
51
+
52
+
53
+ def _is_redirect(text: str) -> bool:
54
+ head = text.split("</head>", 1)[0]
55
+ return bool(_META_REFRESH.search(head))
56
+
57
+
58
+ def _canonical_map(build_dir: Path) -> dict[str, str]:
59
+ """Map every URL path a page answers to (with and without the trailing
60
+ slash) to that page's canonical path."""
61
+ # redirect stubs aren't pages: they never win over x/index.html
62
+ canonicals = {
63
+ _canonical_path(PurePosixPath(f.relative_to(build_dir).as_posix()))
64
+ for f in build_dir.rglob("*.html")
65
+ if not _is_redirect(f.read_text(encoding="utf-8"))
66
+ }
67
+ mapping: dict[str, str] = {}
68
+ for canonical in sorted(canonicals):
69
+ bare = canonical.rstrip("/") or "/"
70
+ # `x.html` wins over `x/index.html` when both exist: it's what
71
+ # SvelteKit prerenders for routes like /faq and /blog
72
+ if canonical != "/" and canonical.endswith("/") and bare in canonicals:
73
+ continue
74
+ mapping[bare] = canonical
75
+ mapping[bare.rstrip("/") + "/"] = canonical
76
+ return mapping
77
+
78
+
79
+ def _rewrite_href(
80
+ match: re.Match,
81
+ page_dir: str,
82
+ base_path: str,
83
+ canonical_by_path: dict[str, str],
84
+ ) -> str:
85
+ """Fix the trailing slash of an internal link so it doesn't redirect.
86
+
87
+ Only the slash changes, so absolute (`/doc/x`) and relative (`./doc`, how
88
+ SvelteKit writes links) hrefs both keep their form.
89
+ """
90
+ prefix, quote, url = match.group(1), match.group(2), match.group(3)
91
+ path, sep, rest = _split_url(url)
92
+ if not path or path.startswith("//"):
93
+ return match.group(0)
94
+ if path.startswith("/"):
95
+ if base_path:
96
+ if path != base_path and not path.startswith(base_path + "/"):
97
+ return match.group(0)
98
+ local = path[len(base_path) :] or "/"
99
+ else:
100
+ local = path
101
+ else:
102
+ local = posixpath.normpath(posixpath.join(page_dir, path))
103
+ if path.endswith("/") and not local.endswith("/"):
104
+ local += "/"
105
+ canonical = canonical_by_path.get(html.unescape(local))
106
+ if canonical is None or canonical == local:
107
+ return match.group(0)
108
+ new_path = path + "/" if canonical.endswith("/") else path.rstrip("/")
109
+ return f"{prefix}{quote}{new_path}{sep}{rest}{quote}"
110
+
111
+
112
+ def _split_url(url: str) -> tuple[str, str, str]:
113
+ """Split '/a/b?x#y' into ('/a/b', '?', 'x#y')."""
114
+ for i, ch in enumerate(url):
115
+ if ch in "?#":
116
+ return url[:i], ch, url[i + 1 :]
117
+ return url, "", ""
118
+
119
+
120
+ def _read_website_url() -> str:
121
+ from afterpython._io.toml import _from_tomlkit
122
+ from afterpython.tools._afterpython import read_afterpython
123
+
124
+ website = _from_tomlkit(read_afterpython().get("website", {}))
125
+ return str(website.get("url", "")).strip().rstrip("/")
126
+
127
+
128
+ def build_seo(base_path: str = ""):
129
+ """Add canonical tags, fix internal links and write sitemap.xml/robots.txt.
130
+
131
+ Args:
132
+ base_path: BASE_PATH the site was built with ("" for a custom domain,
133
+ "/repo" for a default GitHub Pages URL); internal links carry it.
134
+ """
135
+ build_dir = ap.paths.website_path / "build"
136
+ if not build_dir.exists():
137
+ return
138
+ website_url = _read_website_url()
139
+ if not website_url:
140
+ click.echo(
141
+ "Warning: [website].url is not set in afterpython.toml, "
142
+ "skipping canonical tags and sitemap.xml"
143
+ )
144
+ return
145
+ # website.url already includes the base path for github.io sites
146
+ site_root = website_url
147
+ if base_path and website_url.endswith(base_path):
148
+ site_root = website_url[: -len(base_path)]
149
+
150
+ click.echo("Adding canonical tags and building sitemap.xml...")
151
+ canonical_by_path = _canonical_map(build_dir)
152
+
153
+ sitemap_urls: list[str] = []
154
+ for file in sorted(build_dir.rglob("*.html")):
155
+ rel = PurePosixPath(file.relative_to(build_dir).as_posix())
156
+ text = file.read_text(encoding="utf-8")
157
+ original = text
158
+ if _is_redirect(text):
159
+ continue
160
+ noindex = rel.as_posix() in NOINDEX_FILES or bool(_ROBOTS_NOINDEX.search(text))
161
+
162
+ page_path = _canonical_path(rel)
163
+ # directory relative links resolve against: /x/ for x/index.html, / for x.html
164
+ page_dir = (
165
+ page_path if page_path.endswith("/") else posixpath.dirname(page_path)
166
+ )
167
+ text = _HREF.sub(
168
+ partial(
169
+ _rewrite_href,
170
+ page_dir=page_dir,
171
+ base_path=base_path,
172
+ canonical_by_path=canonical_by_path,
173
+ ),
174
+ text,
175
+ )
176
+ # a shadowed x/index.html points at its x.html twin
177
+ canonical_url = (
178
+ site_root + base_path + canonical_by_path.get(page_path, page_path)
179
+ )
180
+
181
+ head = _HEAD_OPEN.search(text)
182
+ if head:
183
+ if rel.as_posix() in NOINDEX_FILES and not _ROBOTS_NOINDEX.search(text):
184
+ tag = '<meta name="robots" content="noindex">'
185
+ text = text[: head.end()] + tag + text[head.end() :]
186
+ elif not noindex and not _CANONICAL.search(text):
187
+ tag = f'<link rel="canonical" href="{html.escape(canonical_url)}">'
188
+ text = text[: head.end()] + tag + text[head.end() :]
189
+
190
+ if not noindex and head:
191
+ sitemap_urls.append(canonical_url)
192
+ if text != original:
193
+ file.write_text(text, encoding="utf-8")
194
+
195
+ _write_sitemap(build_dir, sitemap_urls)
196
+ _write_robots_txt(build_dir, f"{site_root}{base_path}/sitemap.xml")
197
+ click.echo(f"✓ sitemap.xml lists {len(sitemap_urls)} pages")
198
+
199
+
200
+ def _write_sitemap(build_dir: Path, urls: list[str]):
201
+ lines = ['<?xml version="1.0" encoding="UTF-8"?>']
202
+ lines.append('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">')
203
+ lines.extend(f" <url><loc>{escape(url)}</loc></url>" for url in sorted(set(urls)))
204
+ lines.append("</urlset>")
205
+ (build_dir / "sitemap.xml").write_text("\n".join(lines) + "\n", encoding="utf-8")
206
+
207
+
208
+ def _write_robots_txt(build_dir: Path, sitemap_url: str):
209
+ """Write robots.txt, or add the Sitemap line to a user-provided one."""
210
+ robots = build_dir / "robots.txt"
211
+ line = f"Sitemap: {sitemap_url}"
212
+ if robots.exists():
213
+ text = robots.read_text(encoding="utf-8")
214
+ if "sitemap:" in text.lower():
215
+ return
216
+ robots.write_text(text.rstrip("\n") + f"\n\n{line}\n", encoding="utf-8")
217
+ else:
218
+ robots.write_text(f"User-agent: *\nAllow: /\n\n{line}\n", encoding="utf-8")
@@ -26,6 +26,7 @@ from afterpython.builders import (
26
26
  build_markdown,
27
27
  build_metadata,
28
28
  build_pdoc,
29
+ build_seo,
29
30
  build_url_md,
30
31
  create_placeholder_index_md_files,
31
32
  delete_placeholder_index_md_files,
@@ -103,8 +104,9 @@ def prebuild(dev_build: bool = False, build_readme_py: bool = True):
103
104
  content_build_paths = [
104
105
  website_static_path / content_type for content_type in CONTENT_TYPES
105
106
  ]
106
- # Also wipe the API reference static dir so a `--skip-api` build doesn't
107
- # leave stale pages from a prior run live on the deployed site.
107
+ # Also wipe the API reference static dir so a build with
108
+ # `api_reference = false` doesn't leave stale pages from a prior run
109
+ # live on the deployed site.
108
110
  api_static_path = website_static_path / "api_reference"
109
111
  for path in [
110
112
  build_path,
@@ -339,3 +341,6 @@ def build(ctx: click.Context, execute: bool):
339
341
  )
340
342
  if result.returncode != 0:
341
343
  raise Exit(result.returncode)
344
+
345
+ # on the final HTML, so it covers both SvelteKit and MyST pages
346
+ build_seo(base_path=base_path)
@@ -67,6 +67,10 @@ def sync():
67
67
  company_name = str(_from_tomlkit(afterpython.get("company", {})).get("name", ""))
68
68
  company_url = str(_from_tomlkit(afterpython.get("company", {})).get("url", ""))
69
69
  website_url = str(_from_tomlkit(afterpython.get("website", {})).get("url", ""))
70
+ # empty string disables analytics: MyST only emits gtag for a truthy id
71
+ google_analytics_id = str(
72
+ _from_tomlkit(afterpython.get("website", {})).get("google_analytics_id", "")
73
+ ).strip()
70
74
  try:
71
75
  website_favicon = normalize_static_path(
72
76
  str(_from_tomlkit(afterpython.get("website", {})).get("favicon", ""))
@@ -151,6 +155,7 @@ def sync():
151
155
  else "",
152
156
  "logo_text": project_name,
153
157
  "logo_url": website_url,
158
+ "analytics_google": google_analytics_id,
154
159
  },
155
160
  # FIXME: disable nav bar for now until myst fixes the issue with the nav bar
156
161
  # the current issue is they prepend the BASE_URL to the nav bar links even they are external
@@ -5,10 +5,12 @@ url = "" # used in myst.yml's venue.url
5
5
 
6
6
  [website]
7
7
  url = ""
8
+ title = "" # homepage <title>, put your main search keywords here, e.g. "pytrade - Python Trading Resources & Tutorials"
9
+ google_analytics_id = "" # e.g. "G-XXXXXXXXXX"; empty disables Google Analytics on doc/blog/... pages
8
10
  favicon = "favicon.ico"
9
11
  logo = "logo.svg"
10
12
  logo_dark = "logo.svg"
11
- thumbnail = "thumbnail.png" # thumbnail for the website, also used as default thumbnail for all content types, e.g. blog posts, tutorials, examples, and guides
13
+ thumbnail = "thumbnail.png" # thumbnail for the website itself, not used for content; set [website.<content_type>].thumbnail for a default per content type
12
14
  announcement = ""
13
15
  readme_py = "wasm" # marimo html export format: "wasm" or "static"
14
16
  execute_readme_py = false # execute README.py cells at build time and embed outputs as a preview (wasm mode only)
@@ -24,7 +24,6 @@ def get_default_thumbnail(
24
24
 
25
25
  Reads default thumbnail configuration from afterpython.toml:
26
26
  - Content type specific thumbnail: [website.{content_type}.thumbnail]
27
- - Website-wide default thumbnail: [website.thumbnail]
28
27
  - Falls back to empty string if no default is configured
29
28
 
30
29
  Args:
@@ -39,6 +38,7 @@ def get_default_thumbnail(
39
38
 
40
39
  afterpython = read_afterpython()
41
40
  try:
41
+ # DEPRECATED: [website].thumbnail is not a default for content types
42
42
  # website_default_thumbnail = normalize_static_path(
43
43
  # str(_from_tomlkit(afterpython.get("website", {})).get("thumbnail", ""))
44
44
  # )
@@ -62,7 +62,7 @@ def get_default_thumbnail(
62
62
 
63
63
  if content_type_default_thumbnail:
64
64
  return f"{static_prefix}static{content_type_default_thumbnail}"
65
- # use "thumbnail" set in afterpython.toml [website]
65
+ # DEPRECATED: use "thumbnail" set in afterpython.toml [website]
66
66
  # elif website_default_thumbnail:
67
67
  # Website-wide static is one level up from content_type folder
68
68
  # return f"{static_prefix}../static{website_default_thumbnail}"
afterpython/tools/myst.py CHANGED
@@ -234,12 +234,9 @@ def init_myst(content_types: Iterable[tContentType] | None = None):
234
234
  env=node_env,
235
235
  check=True,
236
236
  )
237
- site_defaults: dict[str, Any] = {
238
- "options": {
239
- "analytics_google": "{{ GOOGLE_ANALYTICS_ID }}",
240
- # "twitter": "",
241
- },
242
- }
237
+ # analytics_google is filled in by `ap sync` from
238
+ # [website].google_analytics_id in afterpython.toml
239
+ site_defaults: dict[str, Any] = {"options": {}}
243
240
  # keep `myst init`'s book-theme for every content type, blog included:
244
241
  # article-theme v2.0.0 (2026-11-10) fails `myst build --html` with
245
242
  # 'No route matches URL "/_public/..."'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: afterpython
3
- Version: 0.4.9
3
+ Version: 0.5.1
4
4
  Summary: CLI tool to streamline Python package maintenance and generate a dedicated project website
5
5
  Keywords: package-maintenance,project-website,static-site-generator,developer-tools,documentation,cli-tool,ci/cd,mystmd,semantic-release,python-packaging
6
6
  Author: Stephen Yau
@@ -3,23 +3,24 @@ afterpython/_io/toml.py,sha256=dvmq6n4MhlJ02u_YjfC3mOnCWatfCn_J1lugavigoJw,3410
3
3
  afterpython/_io/yaml.py,sha256=raksve_gaIFJim8lQrq-kQHkRjTloed7CT2FY0oUJSg,654
4
4
  afterpython/_paths.py,sha256=FTwQ7necKYuRosCyMZPfv1eqaEmGIsyqd3yXpm-WQTA,1584
5
5
  afterpython/_typing.py,sha256=kDO25BbJCdNNkqoP9-JYC1zsOuNvzhqvSOCcam3yuAk,128
6
- afterpython/builders/__init__.py,sha256=A8LWY4ESeH3SuhkjRcwrCgIAAZXnwHk4asNGGTmVQ9g,1166
7
- afterpython/builders/build_pdoc.py,sha256=OzCy4H_jfKT7VPh76PfzwNxjmyypkHMEYzQ-6xPKMgc,2868
6
+ afterpython/builders/__init__.py,sha256=yLIzSEcyUjL2IkT7_pX7s2yNcje0DBTLefxBXmNXjY4,1230
7
+ afterpython/builders/build_pdoc.py,sha256=NDpFJPw8ZfWWvTXZFSo8eUnTl76LAKErcv-9KAuZIEI,2918
8
8
  afterpython/builders/comments_json.py,sha256=7gY1wy78wqSscTIFlDhwDKNYN6ioLzpDpACLBmwB9rw,3603
9
9
  afterpython/builders/content_json.py,sha256=yem8qhVjy5-aTnmUIING5ttNZFsuTQ-r5M_dYKGRyTk,5362
10
10
  afterpython/builders/faq_json.py,sha256=v4s_v-BJ16O7U9_tlc4NT92d1gtqdTONF-DwTxlGod0,1168
11
11
  afterpython/builders/index_md.py,sha256=ZpBA1FIHgw9MXD8kRaq2OBaEAKnf94_sJmB2cG68iag,6021
12
- afterpython/builders/jupyter_notebook.py,sha256=6PBz-jYPRMhk_1MsM8pfoyVbbvCKqSr1FIp7n8xQO8g,10580
12
+ afterpython/builders/jupyter_notebook.py,sha256=bIdli7sXU1wgHwmLWWjCv4lP0cQU6J0TzgOSukYjOdo,12723
13
13
  afterpython/builders/llms_txt.py,sha256=9x-B1i1buTDJt4zGs8nugyto_pI5QIp7WUBcv-zpcso,9226
14
- afterpython/builders/marimo_content.py,sha256=2LgNUnNh0flhjisYWIH4DVSX73xb75kABuOSJ9w-cEo,20000
14
+ afterpython/builders/marimo_content.py,sha256=NEsvgomB8Dc90iirxsMMc2m0eXDemc05PtemYqre844,21215
15
15
  afterpython/builders/marimo_notebook.py,sha256=MwcXu5fz5Mvf3-SR_o6phw-UNwDz12IAH3txiM0yoeM,6662
16
16
  afterpython/builders/markdown.py,sha256=0ExfRqvOTWsgUkAVaGGNkiNDtNedRr7JR1yTGxpbsmA,8736
17
- afterpython/builders/metadata.py,sha256=EueKoYWM__Hb9MwX0KYejxJvouoaAxD1oz9AP-Na-ZI,3830
17
+ afterpython/builders/metadata.py,sha256=ms17MJ4QD2PNtyDwQAPRTpFs-qBjT-1iKuIGUOjAseY,4042
18
+ afterpython/builders/seo.py,sha256=pQfSerum1OqCPwKKKr0sTzhhWEr4oS7GDR-N1dVPlyY,8378
18
19
  afterpython/builders/site_data.py,sha256=29p2Hg1RBraZLd9l4jofvCq_QT43ny209-2TP5MDQBU,7133
19
20
  afterpython/builders/url_md.py,sha256=MfXSy0f44J72OlHASir-Xscqq1onA10vtqUO_L4b1xM,3949
20
21
  afterpython/cli/__init__.py,sha256=G4AB-rllhmr7tURFc5cXJfkjZZ2bXtMBg3oy4zUGEFw,84
21
22
  afterpython/cli/commands/add.py,sha256=Ppp4msdvOwN9_-fdG5-b0-IV9p0Eef9CiIEU3srUjYk,1792
22
- afterpython/cli/commands/build.py,sha256=C5Mee6hykCrF8Z9xMXws3kSDDwmMJhpaTI1aeIugCZ0,12454
23
+ afterpython/cli/commands/build.py,sha256=DtieJxK02QGw95-iqXCLrLfYQvWPSMxd6XvlZOeyJzs,12599
23
24
  afterpython/cli/commands/bump.py,sha256=ULrZmQuQ-oJSYXNyEyCg3VxrHDhzwOSMv37Uk1fQlgs,13354
24
25
  afterpython/cli/commands/changelog.py,sha256=R4GdvJlnfd8joVnRRon9y-eM8RfSIxE1GCOspMrxXEw,1597
25
26
  afterpython/cli/commands/check.py,sha256=QBt_KHlD72QJmBordcsoGKvyX4Iuj7ezjFStuNZVaOk,1694
@@ -38,14 +39,14 @@ afterpython/cli/commands/release.py,sha256=9pfBpg3NlVQ1r6x5hYURje0BrmDhyTmF9fJMJ
38
39
  afterpython/cli/commands/remove.py,sha256=Fl79JSI9IdHyzYflocXxcxgBkBPkNFAW98Yuijly26g,1812
39
40
  afterpython/cli/commands/serve.py,sha256=L0LIhMGByQA_mNTOAGHQTQ8TcBfi5sgmO1_iGI24QgI,822
40
41
  afterpython/cli/commands/start.py,sha256=edbPWsgr4m5P4w-0z12ObwkdD60HGzV5jFQlbwlbyyQ,4119
41
- afterpython/cli/commands/sync.py,sha256=Rx_Wmf8toys3FjENtcKVCw22ejEvOzyuqblWKA04dl0,6467
42
+ afterpython/cli/commands/sync.py,sha256=bQJRRS4S13H_F-4EJLWytXjywGkpRDD2J9525oxGYZ4,6734
42
43
  afterpython/cli/commands/update.py,sha256=q_ZxbPC-4fyUPlX3Ohoz5f3cJrz5j3d5-1AH453_VTQ,9649
43
44
  afterpython/cli/main.py,sha256=MYv7NthSmRyr5AQfOBrXjng0QB3Zem6jLlSgjXi1o9I,5121
44
45
  afterpython/const.py,sha256=R4G-rq_1sZ35aQR0eXxpNgIjbk2Aw5lvhMSKNNjiyA4,225
45
46
  afterpython/main.py,sha256=w0z6mTib3u4p2HxMrk-tIJlZtur7uRaqsbE0ewlYlSs,490
46
47
  afterpython/pcu.py,sha256=nfdY2uKgOxHQ1AqUN9Y-L5BxDLd7NiuZf3tt_ef2wvA,6500
47
48
  afterpython/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- afterpython/templates/afterpython-template.toml,sha256=c4lEl8B6ObhNHBKqlQNl1nS-47azH2Jg6YUj-494JCc,1725
49
+ afterpython/templates/afterpython-template.toml,sha256=pUGrLa4SwGwSq0Fv0W6SYXgq9WW8MCKIyW_MCGXYWAI,1946
49
50
  afterpython/templates/ci-workflow-template.yml,sha256=gcxaaFW4OztMhtfEyraiGAJ0FBFg7A0J_3LiG7Lpa6U,8943
50
51
  afterpython/templates/cliff-template.toml,sha256=HVemOBXIAvxz_8IMMAUcSRqYVmC0etfHleVeTG6woHg,5248
51
52
  afterpython/templates/dependabot-template.yml,sha256=CBQEgh8EsXw2X7IqzGtFI7lVT9liF6PW4DvGLB0X2LY,1136
@@ -59,16 +60,16 @@ afterpython/templates/pre-commit-config-template.yaml,sha256=1dW_CEWyfgL_VeTWE8F
59
60
  afterpython/templates/release-workflow-template.yml,sha256=9vd9C3-pWOHhA5WWgSG4PuH4bCBZs7EWmCc1kDIIVJM,4150
60
61
  afterpython/templates/ruff-template.toml,sha256=IU33i84L7IhcLFYZ7Cfdg8EVlpq6YVAQJ3vLQGLXOxk,1316
61
62
  afterpython/templates/ty-template.toml,sha256=8Z5jTnedzrNBgPaWYHY0RSVdXfg_SeNt1HO1OLnSA7E,666
62
- afterpython/tools/_afterpython.py,sha256=y0-3IbKe1DV3JVJlKoIztoSyQs2K73LxNCgEyf1vitc,4946
63
+ afterpython/tools/_afterpython.py,sha256=UGa8zeZeicZA2AMLfEq7bjuVOP3CQwg_I-A-rbH2L2Q,4977
63
64
  afterpython/tools/_git.py,sha256=qUrunBNFwkbn8J1fJDXgiIaA2xNDuRCNryhbBPX2ReQ,6063
64
65
  afterpython/tools/branch_rules.py,sha256=zrlN1FFl8gv9sKMbV7Ri5EuPhiUK3dTMOtMJRpZoRUE,3244
65
66
  afterpython/tools/github_actions.py,sha256=0xzOc41QF1PKagD1CW7BAt_Rugy0KCEx_KfcrPKVl3c,3168
66
- afterpython/tools/myst.py,sha256=iVvddJQ_4qjkIebpQ0mFg4BF0XEVSS30QqpVaMI-r0k,10160
67
+ afterpython/tools/myst.py,sha256=mp_aMEZq013A-Bf1QcpPNOBj3sUneS9uucmSyZiNvks,10144
67
68
  afterpython/tools/prek.py,sha256=NEEGf8alTt9MIelAJ8yxWD-V4mnM_pJ7oHgVQG8pbzo,3543
68
69
  afterpython/tools/pyproject.py,sha256=Slhxo-Z9M7Gn9ZGL2BKmbPONpDgAJ1g33TdiulxwEyQ,3700
69
70
  afterpython/utils.py,sha256=JyNFhanWllmuE3Ax5URi6_UxVgM9GsqgGwceg4PbFlo,12572
70
71
  afterpython/version.py,sha256=hihRV1S-gc1m46OaXD32ikkEkqzs-Gtq7AcAqOQV-wY,1603
71
- afterpython-0.4.9.dist-info/WHEEL,sha256=MWx7psoF7KNST9G72pGtiBYuaXRXQXBk9pw5R6FzYko,80
72
- afterpython-0.4.9.dist-info/entry_points.txt,sha256=roa0PDgBueM1JPbRG0G2OSxzaN394OUL_oS9iEwVLBc,80
73
- afterpython-0.4.9.dist-info/METADATA,sha256=tDCyP2evUQhLLXGAEDNNb_iXLte_OLMc2l9IpqAHVZ4,6416
74
- afterpython-0.4.9.dist-info/RECORD,,
72
+ afterpython-0.5.1.dist-info/WHEEL,sha256=MWx7psoF7KNST9G72pGtiBYuaXRXQXBk9pw5R6FzYko,80
73
+ afterpython-0.5.1.dist-info/entry_points.txt,sha256=roa0PDgBueM1JPbRG0G2OSxzaN394OUL_oS9iEwVLBc,80
74
+ afterpython-0.5.1.dist-info/METADATA,sha256=hjrOb11BEcKtsFW-me9zkeahaGlveJkJ8WN2RnGE8Bk,6416
75
+ afterpython-0.5.1.dist-info/RECORD,,