orz-markdown 1.3.1 → 1.4.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/README.md +8 -0
- package/dist/doc-meta.d.ts +97 -0
- package/dist/doc-meta.d.ts.map +1 -0
- package/dist/doc-meta.js +191 -0
- package/dist/doc-meta.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/nyml-blocks.d.ts +33 -0
- package/dist/nyml-blocks.d.ts.map +1 -0
- package/dist/nyml-blocks.js +143 -0
- package/dist/nyml-blocks.js.map +1 -0
- package/package.json +3 -2
- package/themes/common.css +9 -2
package/README.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# orz-markdown
|
|
2
2
|
|
|
3
|
+
[](https://doi.org/10.5281/zenodo.21099237)
|
|
4
|
+
|
|
3
5
|
A deeply customized markdown-it parser configured with several official plugins and many custom plugins designed to render interactive objects, embedded rich media, and invisible data. Crafted alongside beautifully optimized CSS themes for an excellent out-of-the-box rendering experience. An agent skill is available for using this markdown parser with AI agents.
|
|
4
6
|
|
|
5
7
|
Rendered HTML is intended to live inside a `.markdown-body` container and be paired with one of the bundled themes.
|
|
6
8
|
|
|
9
|
+
## Citation
|
|
10
|
+
|
|
11
|
+
If you use or cite the orz-markdown website or editable document family, please cite the archived release:
|
|
12
|
+
|
|
13
|
+
Yu Wang. (2026). orz-markdown: a Markdown family that travels in one file. Zenodo. https://doi.org/10.5281/zenodo.21099237
|
|
14
|
+
|
|
7
15
|
## Installation
|
|
8
16
|
|
|
9
17
|
Install the package via npm:
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document metadata for the orz-family self-contained formats.
|
|
3
|
+
*
|
|
4
|
+
* A `.md.html` / `.slides.html` / `.paged.html` travels alone — that is the
|
|
5
|
+
* whole promise of the format. Until now it carried no author, no license and
|
|
6
|
+
* no link home, so someone who downloaded one held a file that said nothing
|
|
7
|
+
* about the terms under which they could reuse it.
|
|
8
|
+
*
|
|
9
|
+
* This module is the ONE place that knows how document metadata is written,
|
|
10
|
+
* read and emitted. It lives in orz-markdown because that is the only package
|
|
11
|
+
* all three tools already depend on; implementing it three times in three
|
|
12
|
+
* copy-pasted `template.ts` files is how the brand SVG and chrome CSS drifted.
|
|
13
|
+
*
|
|
14
|
+
* Two channels, one precedence rule:
|
|
15
|
+
*
|
|
16
|
+
* 1. **In the source** — a `{{nyml kind: meta … }}` block. Travels with the
|
|
17
|
+
* markdown, survives every round-trip, and a lone author can type it. nyml
|
|
18
|
+
* blocks are non-visible, so nothing leaks into the reader's view.
|
|
19
|
+
* 2. **Injected by a host** — the `metadata` build option.
|
|
20
|
+
*
|
|
21
|
+
* The **host wins, field by field**: a platform that knows the license
|
|
22
|
+
* authoritatively must not be overridden by a stale block someone pasted in.
|
|
23
|
+
* Fields the host leaves unset fall through to the source block.
|
|
24
|
+
*
|
|
25
|
+
* The builders emit `<meta>` / `<link rel="license">` tags plus a JSON island
|
|
26
|
+
* into `<head>`. That placement is load-bearing: every tool's `serializeDoc()`
|
|
27
|
+
* clones the whole `documentElement` and rewrites only the source island, so
|
|
28
|
+
* head tags survive an in-file edit *and* a framework self-update. Metadata
|
|
29
|
+
* written anywhere else would be silently dropped on save.
|
|
30
|
+
*/
|
|
31
|
+
/** The `kind:` value that marks a metadata block. */
|
|
32
|
+
export declare const DOC_META_KIND = "meta";
|
|
33
|
+
/** The id of the emitted JSON island (a host's reliable read-back channel). */
|
|
34
|
+
export declare const DOC_META_ISLAND_ID = "orz-meta";
|
|
35
|
+
/** MIME type of the JSON island. Distinct from the `nyml-data` script. */
|
|
36
|
+
export declare const DOC_META_ISLAND_TYPE = "application/orz-meta+json";
|
|
37
|
+
export interface DocLicense {
|
|
38
|
+
/** SPDX identifier, e.g. `CC-BY-4.0`. */
|
|
39
|
+
spdx?: string;
|
|
40
|
+
/** Human label, e.g. `CC BY 4.0`. */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** Canonical deed / legal-code URL. */
|
|
43
|
+
url?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Format-agnostic. Deliberately not license-only: a general host injects more
|
|
47
|
+
* than a license, and a field added here is available to all three tools at once.
|
|
48
|
+
*/
|
|
49
|
+
export interface DocMeta {
|
|
50
|
+
title?: string;
|
|
51
|
+
author?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
license?: DocLicense;
|
|
54
|
+
/** Canonical URL of the document, or of the repository it lives in. */
|
|
55
|
+
source?: string;
|
|
56
|
+
/** ISO date of publication. */
|
|
57
|
+
date?: string;
|
|
58
|
+
keywords?: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Read the FIRST `kind: meta` nyml block out of a source and remove it.
|
|
62
|
+
*
|
|
63
|
+
* Removal is not cosmetic. The nyml plugin renders every block to a
|
|
64
|
+
* `<script type="application/json" id="nyml-data">` with a FIXED id — leaving a
|
|
65
|
+
* meta block in the body would emit a second element with a duplicate id. And
|
|
66
|
+
* metadata belongs in `<head>`, not in the rendered body.
|
|
67
|
+
*
|
|
68
|
+
* Returns the parsed metadata (empty when there is no such block) and the body
|
|
69
|
+
* with the block spliced out. Any other nyml block is left untouched.
|
|
70
|
+
*/
|
|
71
|
+
export declare function extractDocMeta(source: string): {
|
|
72
|
+
meta: DocMeta;
|
|
73
|
+
body: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Merge source-declared metadata with host-injected metadata. The HOST wins,
|
|
77
|
+
* field by field; unset host fields fall through to the source.
|
|
78
|
+
*/
|
|
79
|
+
export declare function mergeDocMeta(fromSource: DocMeta, fromHost?: DocMeta): DocMeta;
|
|
80
|
+
/**
|
|
81
|
+
* `<head>` tags for the metadata. Emitted by each tool's `buildHtml`.
|
|
82
|
+
*
|
|
83
|
+
* `<link rel="license">` is the machine-readable channel search engines and
|
|
84
|
+
* reuse tooling look for. Nothing here asserts a copyright — a document under a
|
|
85
|
+
* public-domain dedication (CC0) must not carry a "©" claim, and this function
|
|
86
|
+
* therefore never emits one. A visible notice, if a tool ever adds one, has to
|
|
87
|
+
* make that distinction itself.
|
|
88
|
+
*/
|
|
89
|
+
export declare function renderDocMetaHead(meta: DocMeta): string;
|
|
90
|
+
/**
|
|
91
|
+
* The full metadata as a JSON island, for a host or tool to read back.
|
|
92
|
+
* `serializeDoc()` never touches it, so it survives in-file edits.
|
|
93
|
+
*/
|
|
94
|
+
export declare function renderDocMetaIsland(meta: DocMeta): string;
|
|
95
|
+
/** Read the island back out of a built document (host-side helper). */
|
|
96
|
+
export declare function parseDocMetaIsland(html: string): DocMeta | null;
|
|
97
|
+
//# sourceMappingURL=doc-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-meta.d.ts","sourceRoot":"","sources":["../src/doc-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,qDAAqD;AACrD,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAE7C,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAwBD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAyB9E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAY7E;AAUD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAmBvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAIzD;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAY/D"}
|
package/dist/doc-meta.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Document metadata for the orz-family self-contained formats.
|
|
4
|
+
*
|
|
5
|
+
* A `.md.html` / `.slides.html` / `.paged.html` travels alone — that is the
|
|
6
|
+
* whole promise of the format. Until now it carried no author, no license and
|
|
7
|
+
* no link home, so someone who downloaded one held a file that said nothing
|
|
8
|
+
* about the terms under which they could reuse it.
|
|
9
|
+
*
|
|
10
|
+
* This module is the ONE place that knows how document metadata is written,
|
|
11
|
+
* read and emitted. It lives in orz-markdown because that is the only package
|
|
12
|
+
* all three tools already depend on; implementing it three times in three
|
|
13
|
+
* copy-pasted `template.ts` files is how the brand SVG and chrome CSS drifted.
|
|
14
|
+
*
|
|
15
|
+
* Two channels, one precedence rule:
|
|
16
|
+
*
|
|
17
|
+
* 1. **In the source** — a `{{nyml kind: meta … }}` block. Travels with the
|
|
18
|
+
* markdown, survives every round-trip, and a lone author can type it. nyml
|
|
19
|
+
* blocks are non-visible, so nothing leaks into the reader's view.
|
|
20
|
+
* 2. **Injected by a host** — the `metadata` build option.
|
|
21
|
+
*
|
|
22
|
+
* The **host wins, field by field**: a platform that knows the license
|
|
23
|
+
* authoritatively must not be overridden by a stale block someone pasted in.
|
|
24
|
+
* Fields the host leaves unset fall through to the source block.
|
|
25
|
+
*
|
|
26
|
+
* The builders emit `<meta>` / `<link rel="license">` tags plus a JSON island
|
|
27
|
+
* into `<head>`. That placement is load-bearing: every tool's `serializeDoc()`
|
|
28
|
+
* clones the whole `documentElement` and rewrites only the source island, so
|
|
29
|
+
* head tags survive an in-file edit *and* a framework self-update. Metadata
|
|
30
|
+
* written anywhere else would be silently dropped on save.
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.DOC_META_ISLAND_TYPE = exports.DOC_META_ISLAND_ID = exports.DOC_META_KIND = void 0;
|
|
34
|
+
exports.extractDocMeta = extractDocMeta;
|
|
35
|
+
exports.mergeDocMeta = mergeDocMeta;
|
|
36
|
+
exports.renderDocMetaHead = renderDocMetaHead;
|
|
37
|
+
exports.renderDocMetaIsland = renderDocMetaIsland;
|
|
38
|
+
exports.parseDocMetaIsland = parseDocMetaIsland;
|
|
39
|
+
const nyml_blocks_js_1 = require("./nyml-blocks.js");
|
|
40
|
+
/** The `kind:` value that marks a metadata block. */
|
|
41
|
+
exports.DOC_META_KIND = 'meta';
|
|
42
|
+
/** The id of the emitted JSON island (a host's reliable read-back channel). */
|
|
43
|
+
exports.DOC_META_ISLAND_ID = 'orz-meta';
|
|
44
|
+
/** MIME type of the JSON island. Distinct from the `nyml-data` script. */
|
|
45
|
+
exports.DOC_META_ISLAND_TYPE = 'application/orz-meta+json';
|
|
46
|
+
function isEmpty(meta) {
|
|
47
|
+
return (!meta.title &&
|
|
48
|
+
!meta.author &&
|
|
49
|
+
!meta.description &&
|
|
50
|
+
!meta.source &&
|
|
51
|
+
!meta.date &&
|
|
52
|
+
!meta.license?.spdx &&
|
|
53
|
+
!meta.license?.name &&
|
|
54
|
+
!meta.license?.url &&
|
|
55
|
+
!(meta.keywords && meta.keywords.length));
|
|
56
|
+
}
|
|
57
|
+
/** Split `a, b , c` into `['a','b','c']`, dropping blanks. */
|
|
58
|
+
function splitList(value) {
|
|
59
|
+
return value
|
|
60
|
+
.split(',')
|
|
61
|
+
.map((s) => s.trim())
|
|
62
|
+
.filter(Boolean);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Read the FIRST `kind: meta` nyml block out of a source and remove it.
|
|
66
|
+
*
|
|
67
|
+
* Removal is not cosmetic. The nyml plugin renders every block to a
|
|
68
|
+
* `<script type="application/json" id="nyml-data">` with a FIXED id — leaving a
|
|
69
|
+
* meta block in the body would emit a second element with a duplicate id. And
|
|
70
|
+
* metadata belongs in `<head>`, not in the rendered body.
|
|
71
|
+
*
|
|
72
|
+
* Returns the parsed metadata (empty when there is no such block) and the body
|
|
73
|
+
* with the block spliced out. Any other nyml block is left untouched.
|
|
74
|
+
*/
|
|
75
|
+
function extractDocMeta(source) {
|
|
76
|
+
const block = (0, nyml_blocks_js_1.scanNymlBlocks)(source).find((b) => b.kind === exports.DOC_META_KIND);
|
|
77
|
+
if (!block)
|
|
78
|
+
return { meta: {}, body: source };
|
|
79
|
+
const f = block.fields;
|
|
80
|
+
const license = {};
|
|
81
|
+
if (f['license'])
|
|
82
|
+
license.spdx = f['license'];
|
|
83
|
+
if (f['license_name'])
|
|
84
|
+
license.name = f['license_name'];
|
|
85
|
+
// nyml keys are `[A-Za-z0-9_]+`, so `license-url` cannot be a key. Accept the
|
|
86
|
+
// snake_case spelling the grammar actually permits.
|
|
87
|
+
if (f['license_url'])
|
|
88
|
+
license.url = f['license_url'];
|
|
89
|
+
const meta = {};
|
|
90
|
+
if (f['title'])
|
|
91
|
+
meta.title = f['title'];
|
|
92
|
+
if (f['author'])
|
|
93
|
+
meta.author = f['author'];
|
|
94
|
+
if (f['description'])
|
|
95
|
+
meta.description = f['description'];
|
|
96
|
+
if (f['source'])
|
|
97
|
+
meta.source = f['source'];
|
|
98
|
+
if (f['date'])
|
|
99
|
+
meta.date = f['date'];
|
|
100
|
+
if (f['keywords'])
|
|
101
|
+
meta.keywords = splitList(f['keywords']);
|
|
102
|
+
if (license.spdx || license.name || license.url)
|
|
103
|
+
meta.license = license;
|
|
104
|
+
// Splice the block out, then collapse the blank lines it leaves behind so a
|
|
105
|
+
// leading meta block does not push the document down by two lines.
|
|
106
|
+
const body = (source.slice(0, block.start) + source.slice(block.end)).replace(/^\s*\n+/, '');
|
|
107
|
+
return { meta, body };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Merge source-declared metadata with host-injected metadata. The HOST wins,
|
|
111
|
+
* field by field; unset host fields fall through to the source.
|
|
112
|
+
*/
|
|
113
|
+
function mergeDocMeta(fromSource, fromHost) {
|
|
114
|
+
if (!fromHost)
|
|
115
|
+
return fromSource;
|
|
116
|
+
const license = {
|
|
117
|
+
...(fromSource.license ?? {}),
|
|
118
|
+
...(fromHost.license ?? {}),
|
|
119
|
+
};
|
|
120
|
+
const merged = {
|
|
121
|
+
...fromSource,
|
|
122
|
+
...Object.fromEntries(Object.entries(fromHost).filter(([, v]) => v !== undefined)),
|
|
123
|
+
};
|
|
124
|
+
if (license.spdx || license.name || license.url)
|
|
125
|
+
merged.license = license;
|
|
126
|
+
return merged;
|
|
127
|
+
}
|
|
128
|
+
function escapeAttr(value) {
|
|
129
|
+
return value
|
|
130
|
+
.replace(/&/g, '&')
|
|
131
|
+
.replace(/</g, '<')
|
|
132
|
+
.replace(/>/g, '>')
|
|
133
|
+
.replace(/"/g, '"');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* `<head>` tags for the metadata. Emitted by each tool's `buildHtml`.
|
|
137
|
+
*
|
|
138
|
+
* `<link rel="license">` is the machine-readable channel search engines and
|
|
139
|
+
* reuse tooling look for. Nothing here asserts a copyright — a document under a
|
|
140
|
+
* public-domain dedication (CC0) must not carry a "©" claim, and this function
|
|
141
|
+
* therefore never emits one. A visible notice, if a tool ever adds one, has to
|
|
142
|
+
* make that distinction itself.
|
|
143
|
+
*/
|
|
144
|
+
function renderDocMetaHead(meta) {
|
|
145
|
+
if (isEmpty(meta))
|
|
146
|
+
return '';
|
|
147
|
+
const tags = [];
|
|
148
|
+
if (meta.author)
|
|
149
|
+
tags.push(`<meta name="author" content="${escapeAttr(meta.author)}">`);
|
|
150
|
+
if (meta.description) {
|
|
151
|
+
tags.push(`<meta name="description" content="${escapeAttr(meta.description)}">`);
|
|
152
|
+
}
|
|
153
|
+
if (meta.keywords?.length) {
|
|
154
|
+
tags.push(`<meta name="keywords" content="${escapeAttr(meta.keywords.join(', '))}">`);
|
|
155
|
+
}
|
|
156
|
+
if (meta.date)
|
|
157
|
+
tags.push(`<meta name="dcterms.date" content="${escapeAttr(meta.date)}">`);
|
|
158
|
+
if (meta.license?.url) {
|
|
159
|
+
tags.push(`<link rel="license" href="${escapeAttr(meta.license.url)}">`);
|
|
160
|
+
}
|
|
161
|
+
if (meta.license?.spdx) {
|
|
162
|
+
tags.push(`<meta name="dcterms.license" content="${escapeAttr(meta.license.spdx)}">`);
|
|
163
|
+
}
|
|
164
|
+
if (meta.source)
|
|
165
|
+
tags.push(`<link rel="canonical" href="${escapeAttr(meta.source)}">`);
|
|
166
|
+
return tags.join('\n');
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The full metadata as a JSON island, for a host or tool to read back.
|
|
170
|
+
* `serializeDoc()` never touches it, so it survives in-file edits.
|
|
171
|
+
*/
|
|
172
|
+
function renderDocMetaIsland(meta) {
|
|
173
|
+
if (isEmpty(meta))
|
|
174
|
+
return '';
|
|
175
|
+
const json = JSON.stringify(meta, null, 2).replace(/<\/script>/gi, '<\\/script>');
|
|
176
|
+
return `<script type="${exports.DOC_META_ISLAND_TYPE}" id="${exports.DOC_META_ISLAND_ID}">\n${json}\n</script>`;
|
|
177
|
+
}
|
|
178
|
+
/** Read the island back out of a built document (host-side helper). */
|
|
179
|
+
function parseDocMetaIsland(html) {
|
|
180
|
+
const re = new RegExp(`<script[^>]*id="${exports.DOC_META_ISLAND_ID}"[^>]*>([\\s\\S]*?)</script>`, 'i');
|
|
181
|
+
const m = re.exec(html);
|
|
182
|
+
if (!m)
|
|
183
|
+
return null;
|
|
184
|
+
try {
|
|
185
|
+
return JSON.parse(m[1]);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=doc-meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-meta.js","sourceRoot":"","sources":["../src/doc-meta.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;AAuEH,wCAyBC;AAMD,oCAYC;AAmBD,8CAmBC;AAMD,kDAIC;AAGD,gDAYC;AA/KD,qDAAkD;AAElD,qDAAqD;AACxC,QAAA,aAAa,GAAG,MAAM,CAAC;AAEpC,+EAA+E;AAClE,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAE7C,0EAA0E;AAC7D,QAAA,oBAAoB,GAAG,2BAA2B,CAAC;AA2BhE,SAAS,OAAO,CAAC,IAAa;IAC5B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK;QACX,CAAC,IAAI,CAAC,MAAM;QACZ,CAAC,IAAI,CAAC,WAAW;QACjB,CAAC,IAAI,CAAC,MAAM;QACZ,CAAC,IAAI,CAAC,IAAI;QACV,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI;QACnB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI;QACnB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG;QAClB,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,8DAA8D;AAC9D,SAAS,S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IH,eAAe,EAAE,CAAC;AAClB,OAAO,EAAE,EAAE,EAAE,CAAC;AAId,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -161,4 +175,8 @@ md.renderer.rules['plugin_inline'] = (tokens, idx, _options, env) => {
|
|
|
161
175
|
return def.render(args, token.content || null, env);
|
|
162
176
|
};
|
|
163
177
|
exports.default = md;
|
|
178
|
+
// Document metadata (license, author, …) for the self-contained formats. The
|
|
179
|
+
// one implementation shared by orz-mdhtml / orz-slides / orz-paged.
|
|
180
|
+
__exportStar(require("./doc-meta.js"), exports);
|
|
181
|
+
__exportStar(require("./nyml-blocks.js"), exports);
|
|
164
182
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index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AE,CAAC;IACpB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC;IACtC,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,kBAAe,EAAE,CAAC;AAGlB,6EAA6E;AAC7E,oEAAoE;AACpE,gDAA8B;AAC9B,mDAAiC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic `{{nyml … }}` block scanner.
|
|
3
|
+
*
|
|
4
|
+
* Finds every nyml block in a source, parses its YAML-ish `key: value` body
|
|
5
|
+
* (including `key: |` multiline blocks), reads the `kind:` discriminator, and
|
|
6
|
+
* reports char offsets so a caller can splice the block out or replace it.
|
|
7
|
+
*
|
|
8
|
+
* Hoisted here from orz-paged (`src/doc/nyml.ts`, 2026-07-10) so that every
|
|
9
|
+
* orz-family tool can read block metadata from a source without reimplementing
|
|
10
|
+
* the grammar. orz-paged now imports it; `doc-meta.ts` builds on it. Values are
|
|
11
|
+
* always strings: surrounding quotes are stripped, multiline `|` blocks are
|
|
12
|
+
* dedented and joined with `\n`. Only the first `}}` terminates a block, so `}`
|
|
13
|
+
* may appear inside the body.
|
|
14
|
+
*/
|
|
15
|
+
/** One scanned `{{nyml … }}` block: its kind, parsed fields, and char range. */
|
|
16
|
+
export interface NymlBlock {
|
|
17
|
+
/** The `kind:` value (e.g. `'document'`, `'element'`), or `''` if absent. */
|
|
18
|
+
kind: string;
|
|
19
|
+
/** snake_case field → raw string value (multiline values preserved). */
|
|
20
|
+
fields: Record<string, string>;
|
|
21
|
+
/** Offset of the opening `{` of `{{nyml` in `source`. */
|
|
22
|
+
start: number;
|
|
23
|
+
/** Offset just past the closing `}}` (so `source.slice(start, end)` is the block). */
|
|
24
|
+
end: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Scan a source for every `{{nyml … }}` block, in document order. Each result
|
|
28
|
+
* carries its parsed `kind`, `fields`, and `[start, end)` char offsets. Blocks
|
|
29
|
+
* inside an HTML comment (`<!-- … -->`) are skipped — so a commented-out element
|
|
30
|
+
* (e.g. content the editor's template picker preserves) does not render.
|
|
31
|
+
*/
|
|
32
|
+
export declare function scanNymlBlocks(source: string): NymlBlock[];
|
|
33
|
+
//# sourceMappingURL=nyml-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nyml-blocks.d.ts","sourceRoot":"","sources":["../src/nyml-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,MAAM,WAAW,SAAS;IACxB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,GAAG,EAAE,MAAM,CAAC;CACb;AAmGD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAuB1D"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generic `{{nyml … }}` block scanner.
|
|
4
|
+
*
|
|
5
|
+
* Finds every nyml block in a source, parses its YAML-ish `key: value` body
|
|
6
|
+
* (including `key: |` multiline blocks), reads the `kind:` discriminator, and
|
|
7
|
+
* reports char offsets so a caller can splice the block out or replace it.
|
|
8
|
+
*
|
|
9
|
+
* Hoisted here from orz-paged (`src/doc/nyml.ts`, 2026-07-10) so that every
|
|
10
|
+
* orz-family tool can read block metadata from a source without reimplementing
|
|
11
|
+
* the grammar. orz-paged now imports it; `doc-meta.ts` builds on it. Values are
|
|
12
|
+
* always strings: surrounding quotes are stripped, multiline `|` blocks are
|
|
13
|
+
* dedented and joined with `\n`. Only the first `}}` terminates a block, so `}`
|
|
14
|
+
* may appear inside the body.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.scanNymlBlocks = scanNymlBlocks;
|
|
18
|
+
const OPEN = '{{nyml';
|
|
19
|
+
/** Find the index of the `}}` that closes a `{{nyml` opened at/after `from`. */
|
|
20
|
+
function findClosing(source, from) {
|
|
21
|
+
for (let i = from; i < source.length - 1; i++) {
|
|
22
|
+
if (source[i] === '}' && source[i + 1] === '}')
|
|
23
|
+
return i;
|
|
24
|
+
}
|
|
25
|
+
return -1;
|
|
26
|
+
}
|
|
27
|
+
/** Strip a single pair of matching surrounding quotes, if present. */
|
|
28
|
+
function stripQuotes(s) {
|
|
29
|
+
if (s.length >= 2) {
|
|
30
|
+
const first = s[0];
|
|
31
|
+
const last = s[s.length - 1];
|
|
32
|
+
if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
|
|
33
|
+
return s.slice(1, -1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return s;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse a nyml body into a flat `key: value` map plus its `kind`. Supports
|
|
40
|
+
* `key: |` multiline blocks: subsequent lines indented more than the key are
|
|
41
|
+
* dedented (block style) and joined with `\n`. The `kind:` line populates
|
|
42
|
+
* `kind` rather than `fields`.
|
|
43
|
+
*/
|
|
44
|
+
function parseBody(inner) {
|
|
45
|
+
const fields = {};
|
|
46
|
+
let kind = '';
|
|
47
|
+
const lines = inner.split('\n');
|
|
48
|
+
let i = 0;
|
|
49
|
+
while (i < lines.length) {
|
|
50
|
+
const line = lines[i];
|
|
51
|
+
const m = /^(\s*)([A-Za-z0-9_]+)\s*:\s?(.*)$/.exec(line);
|
|
52
|
+
if (!m) {
|
|
53
|
+
i++;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const indent = m[1].length;
|
|
57
|
+
const key = m[2];
|
|
58
|
+
const value = m[3];
|
|
59
|
+
if (value.trim() === '|') {
|
|
60
|
+
// Multiline block: gather following lines indented more than this key.
|
|
61
|
+
const collected = [];
|
|
62
|
+
let blockIndent = -1;
|
|
63
|
+
i++;
|
|
64
|
+
while (i < lines.length) {
|
|
65
|
+
const next = lines[i];
|
|
66
|
+
if (next.trim() === '') {
|
|
67
|
+
collected.push('');
|
|
68
|
+
i++;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const nextIndent = next.match(/^[ \t]*/)?.[0].length ?? 0;
|
|
72
|
+
if (nextIndent <= indent)
|
|
73
|
+
break;
|
|
74
|
+
if (blockIndent === -1)
|
|
75
|
+
blockIndent = nextIndent;
|
|
76
|
+
collected.push(next.slice(Math.min(blockIndent, nextIndent)));
|
|
77
|
+
i++;
|
|
78
|
+
}
|
|
79
|
+
while (collected.length && collected[collected.length - 1] === '') {
|
|
80
|
+
collected.pop();
|
|
81
|
+
}
|
|
82
|
+
const joined = collected.join('\n');
|
|
83
|
+
if (key === 'kind')
|
|
84
|
+
kind = joined.trim();
|
|
85
|
+
else
|
|
86
|
+
fields[key] = joined;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const v = stripQuotes(value.trim());
|
|
90
|
+
if (key === 'kind')
|
|
91
|
+
kind = v;
|
|
92
|
+
else
|
|
93
|
+
fields[key] = v;
|
|
94
|
+
i++;
|
|
95
|
+
}
|
|
96
|
+
return { kind, fields };
|
|
97
|
+
}
|
|
98
|
+
/** Char ranges `[start, end)` covered by HTML comments `<!-- … -->`. */
|
|
99
|
+
function commentRanges(source) {
|
|
100
|
+
const ranges = [];
|
|
101
|
+
let i = 0;
|
|
102
|
+
while (true) {
|
|
103
|
+
const open = source.indexOf('<!--', i);
|
|
104
|
+
if (open === -1)
|
|
105
|
+
break;
|
|
106
|
+
const close = source.indexOf('-->', open + 4);
|
|
107
|
+
if (close === -1) {
|
|
108
|
+
ranges.push([open, source.length]);
|
|
109
|
+
break;
|
|
110
|
+
} // unclosed → to end
|
|
111
|
+
ranges.push([open, close + 3]);
|
|
112
|
+
i = close + 3;
|
|
113
|
+
}
|
|
114
|
+
return ranges;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Scan a source for every `{{nyml … }}` block, in document order. Each result
|
|
118
|
+
* carries its parsed `kind`, `fields`, and `[start, end)` char offsets. Blocks
|
|
119
|
+
* inside an HTML comment (`<!-- … -->`) are skipped — so a commented-out element
|
|
120
|
+
* (e.g. content the editor's template picker preserves) does not render.
|
|
121
|
+
*/
|
|
122
|
+
function scanNymlBlocks(source) {
|
|
123
|
+
const out = [];
|
|
124
|
+
const comments = commentRanges(source);
|
|
125
|
+
const inComment = (pos) => comments.some(([a, b]) => pos >= a && pos < b);
|
|
126
|
+
let searchFrom = 0;
|
|
127
|
+
while (searchFrom < source.length) {
|
|
128
|
+
const open = source.indexOf(OPEN, searchFrom);
|
|
129
|
+
if (open === -1)
|
|
130
|
+
break;
|
|
131
|
+
const close = findClosing(source, open + OPEN.length);
|
|
132
|
+
if (close === -1)
|
|
133
|
+
break;
|
|
134
|
+
if (!inComment(open)) {
|
|
135
|
+
const inner = source.slice(open + OPEN.length, close);
|
|
136
|
+
const { kind, fields } = parseBody(inner);
|
|
137
|
+
out.push({ kind, fields, start: open, end: close + 2 });
|
|
138
|
+
}
|
|
139
|
+
searchFrom = close + 2;
|
|
140
|
+
}
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=nyml-blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nyml-blocks.js","sourceRoot":"","sources":["../src/nyml-blocks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAqHH,wCAuBC;AA9HD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB,gFAAgF;AAChF,SAAS,WAAW,CAAC,MAAc,EAAE,IAAY;IAC/C,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,M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,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;IAClF,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC9C,IAAI,IAAI,KAAK,CAAC,CAAC;YAAE,MAAM;QAEvB,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,MAAM;QAExB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;YAC1C,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;QAED,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orz-markdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Customized markdown-it parser with official and custom plugins",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
".": "./dist/index.js",
|
|
9
9
|
"./runtime": "./dist/runtime.js",
|
|
10
10
|
"./preview-frame": "./dist/preview-frame.js",
|
|
11
|
-
"./themes/*": "./themes/*"
|
|
11
|
+
"./themes/*": "./themes/*",
|
|
12
|
+
"./doc-meta": "./dist/doc-meta.js"
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
14
15
|
"dist",
|
package/themes/common.css
CHANGED
|
@@ -10,12 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
.markdown-body img {
|
|
12
12
|
display: block;
|
|
13
|
-
width: auto;
|
|
14
13
|
max-width: 100%;
|
|
15
14
|
max-height: 100%;
|
|
16
|
-
height: auto;
|
|
17
15
|
object-fit: contain;
|
|
18
16
|
}
|
|
17
|
+
/* Responsive by default, but explicit dimensions from ``
|
|
18
|
+
(markdown-it-imsize → width/height attributes) must win: only auto-size
|
|
19
|
+
images that DON'T carry an explicit width/height. */
|
|
20
|
+
.markdown-body img:not([width]) {
|
|
21
|
+
width: auto;
|
|
22
|
+
}
|
|
23
|
+
.markdown-body img:not([height]) {
|
|
24
|
+
height: auto;
|
|
25
|
+
}
|
|
19
26
|
|
|
20
27
|
.markdown-body p > img {
|
|
21
28
|
display: inline;
|