@kenjura/ursa 0.83.0 → 0.85.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.84.0
2
+ 2026-05-08
3
+
4
+ - Unified sticky headers are now standard
1
5
 
2
6
  # 0.83.0
3
7
  2026-05-07
@@ -50,6 +50,21 @@ h1 {
50
50
  text-overflow: ellipsis;
51
51
  }
52
52
 
53
+ figure {
54
+ margin: 0.5rem 0;
55
+ padding: 0;
56
+ max-width: 300px;
57
+ float: left;
58
+ margin-right: 1.5rem;
59
+ margin-bottom: 0.5rem;
60
+
61
+ &:nth-of-type(even) {
62
+ float: right;
63
+ margin-left: 1.5rem;
64
+ margin-right: 0;
65
+ }
66
+ }
67
+
53
68
  nav#nav-global {
54
69
  background-color: var(--nav-top-bg);
55
70
  height: var(--global-nav-height);
@@ -1264,4 +1279,40 @@ footer#site-footer {
1264
1279
  -webkit-text-size-adjust: 100%;
1265
1280
  text-size-adjust: 100%;
1266
1281
  }
1282
+ }
1283
+
1284
+
1285
+ /* sticky unified header */
1286
+ article#main-content {
1287
+ h1, h2, h3 {
1288
+ position: sticky;
1289
+ z-index: 90;
1290
+ margin: 0;
1291
+
1292
+ &.stuck {
1293
+ background: var(--nav-top-bg);
1294
+ }
1295
+ }
1296
+ h1 {
1297
+ top: var(--global-nav-height);
1298
+ height: 3rem;
1299
+ line-height: 3rem;
1300
+ }
1301
+ h2 {
1302
+ top: calc(var(--global-nav-height) + 3rem);
1303
+ height: 2.25rem;
1304
+ line-height: 2.25rem;
1305
+ }
1306
+ h3 {
1307
+ top: calc(var(--global-nav-height) + 5.25rem);
1308
+ height: 1.75rem;
1309
+ line-height: 1.75rem;
1310
+ }
1311
+
1312
+ /* Hide stuck h2/h3 — the breadcrumb on the stuck h1 carries their text.
1313
+ Use visibility (not max-height/display) to preserve layout and avoid
1314
+ the flicker loop where collapsing the heading un-sticks it. */
1315
+ h2.stuck, h3.stuck {
1316
+ visibility: hidden;
1317
+ }
1267
1318
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@kenjura/ursa",
3
3
  "author": "Andrew London <andrew@kenjura.com>",
4
4
  "type": "module",
5
- "version": "0.83.0",
5
+ "version": "0.85.0",
6
6
  "description": "static site generator from MD/wikitext/YML",
7
7
  "main": "lib/index.js",
8
8
  "bin": {
package/src/dev.js CHANGED
@@ -569,10 +569,12 @@ async function wrapInTemplate(body, title, fileMeta, urlPath, sourcePath, hydrat
569
569
  // Resolve relative URLs
570
570
  finalHtml = resolveRelativeUrls(finalHtml, docUrlPath);
571
571
 
572
- // Mark inactive links (only if validPaths is ready)
573
- if (validPaths) {
574
- finalHtml = markInactiveLinks(finalHtml, validPaths, docUrlPath, false);
575
- }
572
+ // Mark inactive links + rewrite .md/.mdx .html. We always run this even
573
+ // before validPaths is ready, because the optimistic .md→.html conversion
574
+ // inside resolveHref does not require validPaths. Without this, links to
575
+ // markdown files served before background caches finish would not be
576
+ // rewritten and the browser would request the source .md file directly.
577
+ finalHtml = markInactiveLinks(finalHtml, validPaths || new Map(), docUrlPath, false);
576
578
 
577
579
  return finalHtml;
578
580
  }
@@ -12,6 +12,25 @@ import remarkSupersub from "remark-supersub";
12
12
  import remarkGfm from "remark-gfm";
13
13
  import { visit } from "unist-util-visit";
14
14
 
15
+ /**
16
+ * remark-definition-list only registers the `:` (charcode 58) marker, but
17
+ * PHP Markdown Extra (and markdown-it-deflist) also support `~` (charcode 126).
18
+ * This sibling plugin must run AFTER remarkDefinitionList; it locates the
19
+ * already-registered defList construct and re-registers it under `~` so that
20
+ * .mdx files have parity with .md files.
21
+ */
22
+ function remarkDefinitionListTildeMarker() {
23
+ const data = this.data();
24
+ const micromarkExtensions = data.micromarkExtensions ?? (data.micromarkExtensions = []);
25
+ for (const ext of micromarkExtensions) {
26
+ const construct = ext?.document?.[58];
27
+ if (construct) {
28
+ micromarkExtensions.push({ document: { 126: construct } });
29
+ return;
30
+ }
31
+ }
32
+ }
33
+
15
34
  /**
16
35
  * Custom remark plugin that converts container directives (:::name ... :::)
17
36
  * into <aside> HTML elements, matching the markdown-it-container behavior
@@ -122,6 +141,7 @@ export async function renderMDX({ source, filePath, sourceRoot, hydrate = false
122
141
  remarkDirective,
123
142
  remarkAsideContainers,
124
143
  remarkDefinitionList,
144
+ remarkDefinitionListTildeMarker,
125
145
  remarkSupersub,
126
146
  ];
127
147
  // remark-definition-list needs custom handlers for remark-rehype conversion