Skip to content

Commit bb7556d

Browse files
committed
Convert [ext] into a tag
Misc changes
1 parent 53d795f commit bb7556d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3375
-2061
lines changed

docs/build.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ def classify(m):
239239
return re.sub(r'<blockquote>\s*(.*?)\s*</blockquote>', classify, html_text, flags=re.DOTALL)
240240

241241

242+
# ── Tag formatting ───────────────────────────────────────────────────────────
243+
244+
def format_ext_tags(html_text):
245+
"""Replace [ext] with a styled badge span."""
246+
return html_text.replace('[ext]', '<span class="ext-tag">ext</span>')
247+
242248
# ── HTML template ────────────────────────────────────────────────────────────
243249

244250
def _section_key(name):
@@ -265,10 +271,12 @@ def build_sidebar_html(current_slug):
265271
' <ul class="sidebar-links">',
266272
)
267273
)
274+
is_ext = section_name == "Extensions"
268275
for slug, label in pages:
269276
active = ' class="active"' if slug == current_slug else ''
270277
href = "index.html" if slug == "index" else f"{slug}.html"
271-
parts.append(f' <li><a href="{href}"{active}>{label}</a></li>')
278+
display = f'{label} <span class="ext-tag">ext</span>' if is_ext else label
279+
parts.append(f' <li><a href="{href}"{active}>{display}</a></li>')
272280

273281
parts.extend((' </ul>', '</div>'))
274282
return "\n".join(parts)
@@ -389,8 +397,8 @@ def build_page(slug):
389397
meta, body_md = parse_frontmatter(raw)
390398
title = meta.get("title", slug.capitalize())
391399
subtitle = meta.get("subtitle", "")
392-
page_title = meta.get("page_title", title)
393-
og_title = meta.get("og_title", title)
400+
page_title = meta.get("page_title", title).replace("[ext]", "").strip()
401+
og_title = meta.get("og_title", title).replace("[ext]", "").strip()
394402

395403
# Convert markdown to HTML
396404
body_html, toc_tokens = convert_markdown(body_md)
@@ -399,6 +407,7 @@ def build_page(slug):
399407
body_html = rewrite_md_links(body_html)
400408
body_html = highlight_code_blocks(body_html)
401409
body_html = process_blockquotes(body_html)
410+
body_html = format_ext_tags(body_html)
402411

403412
# Build subtitle HTML
404413
subtitle_html = f'<p class="subtitle">{subtitle}</p>' if subtitle else ""

docs/site/ability.html

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

docs/site/actionbardisplay.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/advancement.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/attribute.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/bank.html

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

docs/site/block.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/blockdisplay.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/bossbar.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/site/bossbardisplay.html

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)