@geml/geml 1.4.5 → 1.5.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/codemap/mcp-server.mjs +1 -1
- package/codemap/render-all.mjs +16 -3
- package/codemap/serve.mjs +8 -1
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js +10 -0
- package/dist/geml.d.ts +4 -0
- package/dist/geml.js +529 -57
- package/dist/inline.d.ts +20 -0
- package/dist/inline.js +29 -2
- package/dist/mcp.js +13 -5
- package/dist/render.d.ts +19 -0
- package/dist/render.js +349 -24
- package/dist/serialize.js +9 -1
- package/dist/table.js +5 -3
- package/dist/to-md.js +13 -2
- package/package.json +5 -2
package/dist/table.js
CHANGED
|
@@ -247,9 +247,11 @@ function parseSpan(s) {
|
|
|
247
247
|
export function parseTable(body, attrs, line, sink) {
|
|
248
248
|
const diagnostics = [];
|
|
249
249
|
const fmt = typeof attrs["format"] === "string" ? attrs["format"] : undefined;
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
//
|
|
250
|
+
// Data from elsewhere (§6): the caller has normalised `src=`/`data=` into `src`.
|
|
251
|
+
// A local or cross-document target is resolved after the scan (resolveTableSources
|
|
252
|
+
// in geml.ts calls back into this function with the resolved lines, so format,
|
|
253
|
+
// header, compute and summary behave identically); only an `http(s)` URL is still
|
|
254
|
+
// a render-time fetch. Either way the inline body must be empty.
|
|
253
255
|
const src = typeof attrs["src"] === "string" ? attrs["src"] : undefined;
|
|
254
256
|
if (src !== undefined) {
|
|
255
257
|
if (body.some((l) => l.trim() !== "")) {
|
package/dist/to-md.js
CHANGED
|
@@ -38,6 +38,10 @@ function inline(n) {
|
|
|
38
38
|
case "link": return `[${seq(n.children)}](${linkDest(n)})`;
|
|
39
39
|
// Markdown has no auto-reference; project to a plain link to the anchor.
|
|
40
40
|
case "autoref": return n.doc !== undefined ? `[${n.doc}#${n.anchor}](${n.doc}#${n.anchor})` : `[#${n.anchor}](#${n.anchor})`;
|
|
41
|
+
// An inline projection needs the target's body, which this projection has no
|
|
42
|
+
// resolver for. The link keeps the reference reachable; the loss is reported
|
|
43
|
+
// once for the document by gemlToMd.
|
|
44
|
+
case "project": return n.doc !== undefined ? `[${n.doc}#${n.anchor}](${n.doc}#${n.anchor})` : `[#${n.anchor}](#${n.anchor})`;
|
|
41
45
|
case "footnote": return `[^${n.ref}]`;
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -139,8 +143,6 @@ function typedToMd(b, notes) {
|
|
|
139
143
|
return fence(attr(b, "lang") ?? "", raw);
|
|
140
144
|
if (b.type === "math")
|
|
141
145
|
return ["$$", ...raw, "$$"].join("\n");
|
|
142
|
-
if (b.type === "output")
|
|
143
|
-
return fence("", raw);
|
|
144
146
|
if (b.type === "table" && b.table)
|
|
145
147
|
return tableToMd(b.table, notes);
|
|
146
148
|
if (b.type === "diagram") {
|
|
@@ -153,6 +155,15 @@ function typedToMd(b, notes) {
|
|
|
153
155
|
}
|
|
154
156
|
return fence(fmt, raw); // mermaid renders on GitHub; others stay as a code block
|
|
155
157
|
}
|
|
158
|
+
if (b.type === "embed") {
|
|
159
|
+
// Markdown has no transclusion, and the content lives in another file, so
|
|
160
|
+
// there is nothing to inline. A link to the target at least keeps the
|
|
161
|
+
// reference reachable; the unknown-type fallback below would emit an empty
|
|
162
|
+
// fence, which tells a reader nothing.
|
|
163
|
+
const target = typeof b.attrs["src"] === "string" ? b.attrs["src"].trim() : "";
|
|
164
|
+
notes.add("block transclusion projected as a link; the referenced content is not inlined (Markdown has no transclusion)");
|
|
165
|
+
return target === "" ? "" : `[${target}](${target})`;
|
|
166
|
+
}
|
|
156
167
|
// Unknown raw type: preserve the body in a fenced block tagged with the type.
|
|
157
168
|
notes.add(`unknown block type \`${b.type}\` emitted as a fenced code block`);
|
|
158
169
|
return fence(b.type, raw);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geml/geml",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"mcpName": "io.github.geml-spec/geml",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"description": "
|
|
8
|
+
"description": "CLI and parser for GEML, a plain-text document format where every block has an id — so an AI patches one block instead of rewriting the file; edits, reference checks and rollbacks are all per block. Ships an MCP server.",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bin": {
|
|
11
11
|
"geml": "dist/geml.js"
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"geml",
|
|
26
|
+
"general expressive markup language",
|
|
27
|
+
"mcp",
|
|
28
|
+
"mcp-server",
|
|
26
29
|
"markup",
|
|
27
30
|
"markdown",
|
|
28
31
|
"parser",
|