rapier-markdown-kit 1.2.16 → 1.2.18
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
CHANGED
|
@@ -59,7 +59,7 @@ import {parseAssets} from 'rapier-markdown-kit/assets'; // the picture appendi
|
|
|
59
59
|
Rapier is a phone-first Markdown editor for notes, diagrams, drawing and watercolor painting. It runs offline
|
|
60
60
|
as one HTML file on Android, Web and Windows.
|
|
61
61
|
|
|
62
|
-
1. **Work together live.** Connect to `https://mcp.rapier.website/
|
|
62
|
+
1. **Work together live.** Connect to `https://mcp.rapier.website/mcp`, then call `open` to share one document with the person.
|
|
63
63
|
2. **Deliver an offline editor.** Run `npx rapier-html notes.md` to put the document and editor in one HTML file ([rapier-html](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-html)).
|
|
64
64
|
3. **Embed in your app.** Install [rapier-embed](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-embed); mount the editor or reader, with your app's agent over WebMCP in the editor.
|
|
65
65
|
4. **Keep portable Markdown.** Use [rapier-markdown-kit](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-markdown-kit) for pictures, editable SVG drawings and layout in one `.md` file. Respect [Will/1](https://github.com/jackskip22/will) `keep`, `append` and `edit` regions.
|
|
@@ -5,6 +5,8 @@ export interface DocumentParts { ledger?: LedgerEnvelope | null; authorship?: Au
|
|
|
5
5
|
export interface ReadParts { text: string; ledger: LedgerEnvelope | null; authorship: AuthorshipEnvelope | null; }
|
|
6
6
|
/** The text with its parts appended as one EOF comment; the text alone when there are none. */
|
|
7
7
|
export function writeDocument(text: string, parts?: DocumentParts): string;
|
|
8
|
+
/** The verified EOF comment without copying the source; empty when there are no carried parts. */
|
|
9
|
+
export function documentTrailer(text: string, parts?: DocumentParts): string;
|
|
8
10
|
/** Splits a saved file into its exact text and verified parts; throws on a damaged or mismatched comment. */
|
|
9
11
|
export function readDocument(source: string): ReadParts;
|
|
10
12
|
export function writeParts(text: string, parts?: DocumentParts): string;
|
|
@@ -47,11 +47,14 @@ export function takeParts(html, text) {
|
|
|
47
47
|
return {html: stripped, ...readParts(text ?? '', elements)};
|
|
48
48
|
}
|
|
49
49
|
const OPEN = '\n\n<!-- rapier-carried/1\n', CLOSE = '\n-->\n';
|
|
50
|
-
export function
|
|
50
|
+
export function documentTrailer(text, options) {
|
|
51
51
|
const parts = validateParts(text, options);
|
|
52
|
-
if (!parts.ledger && !parts.authorship) return
|
|
52
|
+
if (!parts.ledger && !parts.authorship) return '';
|
|
53
53
|
const json = JSON.stringify(parts).replace(/</g, '\\u003c').replace(/>/g, '\\u003e');
|
|
54
|
-
return
|
|
54
|
+
return OPEN + json + CLOSE;
|
|
55
|
+
}
|
|
56
|
+
export function writeDocument(text, options) {
|
|
57
|
+
return text + documentTrailer(text, options);
|
|
55
58
|
}
|
|
56
59
|
export function readDocument(source) {
|
|
57
60
|
if (!source.endsWith(CLOSE)) {
|
|
@@ -10,8 +10,8 @@ export {_rapierTransformSplices, _rapierRecordSplices, _rapierValidLedgerRecord,
|
|
|
10
10
|
import {replayHistory, sourceBefore, historyProjection, historyProjections, historyPlaces, selectiveUndo, groupHistoryActs, pictureHistorySplices} from './ledger/history.mjs';
|
|
11
11
|
export {replayHistory, sourceBefore, historyProjection, historyProjections, historyPlaces, selectiveUndo, groupHistoryActs, pictureHistorySplices};
|
|
12
12
|
|
|
13
|
-
import {sha256State} from './ledger/hash.mjs';
|
|
14
|
-
export {sha256State};
|
|
13
|
+
import {sha256State, sha256} from './ledger/hash.mjs';
|
|
14
|
+
export {sha256State, sha256};
|
|
15
15
|
import {transposeSource} from './ledger/transport.mjs';
|
|
16
16
|
export {transposeSource};
|
|
17
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-markdown-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"description": "Read, render and write Self-contained Markdown: one .md file that carries its pictures, drawings and layout, and that any Markdown app can read. HTML renderer, stylesheet, text layout, Will/1 agent permissions, and an edit history with authorship and offline merge. MIT, no dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|