@geml/geml 1.7.1 → 1.7.2
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 +20 -4
- package/dist/block-edit.js +15 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2433 -0
- package/dist/from-md.js +1 -1
- package/dist/geml.d.ts +32 -0
- package/dist/geml.js +172 -2038
- package/dist/history.js +7 -3
- package/dist/mcp.js +46 -8
- package/dist/render-html.d.ts +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +180 -15
- package/dist/selector.d.ts +7 -0
- package/dist/selector.js +41 -1
- package/package.json +67 -67
- package/skill/SKILL.md +25 -0
- package/skill/references/authoring.geml +6 -1
package/dist/from-md.js
CHANGED
|
@@ -187,7 +187,7 @@ export function mdToGeml(source) {
|
|
|
187
187
|
// the same character is content — this is what lets a document *show*
|
|
188
188
|
// nested ``` fences without ending the block early.
|
|
189
189
|
const indent = raw.length - raw.trimStart().length;
|
|
190
|
-
const c = raw.
|
|
190
|
+
const c = raw.trimEnd().trimStart();
|
|
191
191
|
if (indent <= 3 && c.length >= marker.length && c[0] === marker[0] && /^[`~]+$/.test(c))
|
|
192
192
|
break;
|
|
193
193
|
body.push(raw);
|
package/dist/geml.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { type Value } from "./attrs.js";
|
|
|
4
4
|
import { type Inline } from "./inline.js";
|
|
5
5
|
import { type TableModel } from "./table.js";
|
|
6
6
|
import { type ChartModel } from "./chart.js";
|
|
7
|
+
import { type Addressed } from "./selector.js";
|
|
7
8
|
export { type Value } from "./attrs.js";
|
|
8
9
|
export { type Inline } from "./inline.js";
|
|
9
10
|
export { type TableModel } from "./table.js";
|
|
@@ -12,6 +13,7 @@ export { renderHtml, pageAssets } from "./render-html.js";
|
|
|
12
13
|
export { type RenderOptions } from "./render.js";
|
|
13
14
|
export { serialize } from "./serialize.js";
|
|
14
15
|
export { gemlToMd } from "./to-md.js";
|
|
16
|
+
export declare function reLit(s: string): string;
|
|
15
17
|
export type BodyMode = "raw" | "flow" | "data";
|
|
16
18
|
export type DataValue = null | boolean | number | string | DataValue[] | {
|
|
17
19
|
[key: string]: DataValue;
|
|
@@ -68,15 +70,45 @@ export interface Document {
|
|
|
68
70
|
}
|
|
69
71
|
export interface ParseOptions {
|
|
70
72
|
resolveDoc?: (doc: string) => string | null;
|
|
73
|
+
docExists?: (doc: string) => boolean;
|
|
71
74
|
self?: string;
|
|
72
75
|
}
|
|
76
|
+
export declare const FENCE_OPEN: RegExp;
|
|
77
|
+
export declare function isCloseFence(line: string, openLen: number): boolean;
|
|
78
|
+
export declare const EMBED_DEPTH_LIMIT = 8;
|
|
73
79
|
export declare function projectableInlines(blocks: Block[], id: string): {
|
|
74
80
|
inlines: Inline[];
|
|
75
81
|
} | "not-inline" | null;
|
|
82
|
+
export declare function relJoinPath(base: string, target: string): string;
|
|
83
|
+
export declare function relDirPath(p: string): string;
|
|
84
|
+
export declare function gatherEmbeds(source: string): {
|
|
85
|
+
doc: string;
|
|
86
|
+
anchor?: string;
|
|
87
|
+
}[];
|
|
76
88
|
export declare function parse(source: string, opts?: ParseOptions): Document;
|
|
77
89
|
export interface Span {
|
|
78
90
|
start: number;
|
|
79
91
|
end: number;
|
|
80
92
|
}
|
|
93
|
+
export declare function stripEol(line: string): string;
|
|
94
|
+
export declare function trimSpaceTabEnd(s: string): string;
|
|
81
95
|
export declare function blockSpans(source: string): Map<string, Span>;
|
|
96
|
+
export declare function addressedUnits(source: string): Addressed[];
|
|
97
|
+
export declare function splitLines(source: string): string[];
|
|
98
|
+
export declare function newlineOf(text: string): string;
|
|
99
|
+
export declare function toLf(text: string): string;
|
|
100
|
+
export declare function toNewline(text: string, nl: string): string;
|
|
101
|
+
export declare function narrowToHead(span: Span): Span;
|
|
102
|
+
export declare function closeFenceLine(lines: string[], span: Span): string | null;
|
|
103
|
+
export declare function narrowToIntro(source: string, span: Span): Span;
|
|
104
|
+
/** Which part of one unit to output. `intro` applies to headings only. */
|
|
105
|
+
export type UnitPart = "whole" | "head" | "body" | "intro";
|
|
106
|
+
export declare function sliceUnit(source: string, span: Span, part?: UnitPart): string;
|
|
107
|
+
export declare function findBlockSite(blocks: Block[], id: string): {
|
|
108
|
+
siblings: Block[];
|
|
109
|
+
index: number;
|
|
110
|
+
} | undefined;
|
|
111
|
+
export declare function sectionEndIndex(siblings: Block[], k: number): number;
|
|
112
|
+
export declare function historyPathFor(geml: string): string;
|
|
113
|
+
export declare const VERSION = "1.0";
|
|
82
114
|
export declare const PARSER_VERSION: string;
|