rapier-html 1.1.14 → 1.1.19
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/BUILD.json +4 -4
- package/README.md +8 -8
- package/package.json +1 -1
- package/page.mjs +4 -1
- package/rapier.html +216 -27
package/BUILD.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "rapier-html",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"path": "rapier.html",
|
|
5
|
-
"bytes":
|
|
6
|
-
"sha256": "
|
|
7
|
-
"builtAt": "2026-09-
|
|
5
|
+
"bytes": 1538239,
|
|
6
|
+
"sha256": "b955f177413a2b179cfb93cba5651d8912cd8e14bc6d223ab9d82cb613ca2772",
|
|
7
|
+
"builtAt": "2026-09-30T08:23:40.102Z",
|
|
8
8
|
"node": "v22.22.2",
|
|
9
9
|
"canonical": true,
|
|
10
10
|
"packing": "zopfli",
|
package/README.md
CHANGED
|
@@ -4,14 +4,14 @@ Rapier, the offline Markdown editor, as one HTML page with your document inside
|
|
|
4
4
|
install, nothing fetched to open, edit or save. Node 22 or newer.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
npx -- rapier-html@1.1.
|
|
8
|
-
npx -- rapier-html@1.1.
|
|
9
|
-
npx -- rapier-html@1.1.
|
|
10
|
-
npx -- rapier-html@1.1.
|
|
11
|
-
npx -- rapier-html@1.1.
|
|
12
|
-
npx -- rapier-html@1.1.
|
|
13
|
-
npx -- rapier-html@1.1.
|
|
14
|
-
npm install rapier-html@1.1.
|
|
7
|
+
npx -- rapier-html@1.1.19 notes.md # the editor, notes.md inside it, written beside the file
|
|
8
|
+
npx -- rapier-html@1.1.19 notes.md --view draw # opens on Draw: sketch and paint, the document behind it
|
|
9
|
+
npx -- rapier-html@1.1.19 notes.md --view notes # opens on Notes: the document as cards
|
|
10
|
+
npx -- rapier-html@1.1.19 notes.md --drawing sketch.svg # carries a drawing, opened on Draw over the document
|
|
11
|
+
npx -- rapier-html@1.1.19 proposal.md --base original.md # opens on the diff of a proposed change
|
|
12
|
+
npx -- rapier-html@1.1.19 notes.md --return "$RETURN_URL" --return-expires-at "$RETURN_EXPIRES_AT" # Send back
|
|
13
|
+
npx -- rapier-html@1.1.19 notes.md out.html # a named output
|
|
14
|
+
npm install rapier-html@1.1.19 # as a library: wrap, unwrap
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
The first `--` is for npm, so `--help` reaches the command. It never overwrites a file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-html",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "Rapier, the offline Markdown editor, as one HTML page with your document inside it: write, draw and paint, notes, the diff of a change; no account, nothing fetched.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
package/page.mjs
CHANGED
|
@@ -7,6 +7,9 @@ const DRAWING_START = '<script type="text/plain" id="rapier-drawing"';
|
|
|
7
7
|
// The text the document was proposed against (docs/page-door.md, "2. A change carried"): the page opens on its diff.
|
|
8
8
|
const BASE_START = '<script type="text/markdown" id="rapier-base"';
|
|
9
9
|
const END = '</script>';
|
|
10
|
+
// The page's search words (rapier.html's RAPIER_SEO regions: description, canonical address, previews, structured data and the plain guide
|
|
11
|
+
// a crawler reads) are rapier.website's own. A page that carries someone's document never claims that address or that description.
|
|
12
|
+
const SEARCH_WORDS = /<!-- RAPIER_SEO_BEGIN -->[\s\S]*?<!-- RAPIER_SEO_END -->\n?/g;
|
|
10
13
|
|
|
11
14
|
// One encoding, exactly reversible (docs/page-door.md, "What a block may hold"): no `<` before `/` or `!`, no CR, no NUL.
|
|
12
15
|
// engine.js _rapierDecodeCarried is its inverse.
|
|
@@ -46,7 +49,7 @@ export function wrap(pageHtml, text, name, options) {
|
|
|
46
49
|
if (typeof opts.base !== 'string') throw new Error('the base must be text');
|
|
47
50
|
carriedBlocks += '\n' + BASE_START + ' data-name="' + safeName(opts.baseName, docName) + '">' + encodeCarried(opts.base) + END;
|
|
48
51
|
}
|
|
49
|
-
const stripped = unwrap(pageHtml).html;
|
|
52
|
+
const stripped = unwrap(pageHtml).html.replace(SEARCH_WORDS, '');
|
|
50
53
|
// Before Rapier's scripts: parsed before the engine boots.
|
|
51
54
|
const bodyTag = /<body[^>]*>/.exec(stripped);
|
|
52
55
|
if (!bodyTag) throw new Error('not a Rapier page: no <body>');
|