rapier-html 1.1.88 → 1.1.91

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/dist/page.mjs CHANGED
@@ -4,14 +4,14 @@ import {basename, dirname, join} from 'node:path';
4
4
  import {wrap} from './wrap.mjs';
5
5
  import {returnAddress, returnExpiresAt} from './return-address.mjs';
6
6
  export {wrap, unwrap, encodeCarried, decodeCarried} from './wrap.mjs';
7
- // Unknown options, a bare --drawing or --propose and a third name are refused, never dropped.
8
- const USAGE = 'usage: rapier-html <document.md> [out.html] [--view draw|notes] [--drawing sketch.svg] [--propose original.md [--by <your name>]] [--return <url> --return-expires-at <timestamp>]\n' +
7
+ // Unknown options, a bare --drawing or --compare and a third name are refused.
8
+ const USAGE = 'usage: rapier-html <document.md> [out.html] [--view draw|notes] [--drawing sketch.svg] [--compare original.md [--by <your name>]] [--return <url> --return-expires-at <timestamp>]\n' +
9
9
  ' writes <document>.rapier.html beside the file: Rapier with the document inside it, one file, offline.\n' +
10
10
  ' It never overwrites: an output that already exists, the document itself included, is refused.\n' +
11
11
  ' --view opens the page on Draw (sketch and paint, the document behind it) or on Notes\n' +
12
12
  ' --drawing carries an SVG drawing alongside the document, opened on Draw as the page boots\n' +
13
- ' --propose carries the text the document was proposed against; the page opens on their diff for per-change review\n' +
14
- ' --by with --propose: who proposes it, shown on the diff with the time the page was made\n' +
13
+ ' --compare carries the original text; the page opens showing its diff from the current document\n' +
14
+ ' --by with --compare: the name shown on the diff with the time the page was made\n' +
15
15
  ' --return carries a one-use return URL from document.create_return; Share offers Send back\n' +
16
16
  ' --return-expires-at carries the same mint\'s expiry; Share offers Save once the return expires\n' +
17
17
  ' -- everything after it is a filename, even one that starts with a dash\n' +
@@ -28,8 +28,8 @@ export async function main(argv, pagesDir, {log = console.log} = {}) {
28
28
  if (view !== null || !['draw', 'notes'].includes(argv[i + 1])) throw new Error('--view takes draw or notes');
29
29
  view = argv[++i];
30
30
  }
31
- else if (arg === '--propose') {
32
- if (basePath !== null || !argv[i + 1] || argv[i + 1].startsWith('-')) throw new Error('--propose takes one text file (write a name that starts with a dash as ./-original.md)');
31
+ else if (arg === '--compare') {
32
+ if (basePath !== null || !argv[i + 1] || argv[i + 1].startsWith('-')) throw new Error('--compare takes one text file (write a name that starts with a dash as ./-original.md)');
33
33
  basePath = argv[++i];
34
34
  }
35
35
  else if (arg === '--by') {
@@ -56,7 +56,7 @@ export async function main(argv, pagesDir, {log = console.log} = {}) {
56
56
  const out = named || join(dirname(input), name.replace(/\.(md|markdown|txt)$/i, '') + '.rapier.html');
57
57
  const wrapOptions = {};
58
58
  if (drawingPath) { wrapOptions.drawing = await readFile(drawingPath, 'utf8'); wrapOptions.drawingName = basename(drawingPath); }
59
- if (by !== null && !basePath) throw new Error('--by names who proposes a change: give the --propose file it proposes over');
59
+ if (by !== null && !basePath) throw new Error('--by labels a comparison: give its --compare file');
60
60
  if (basePath) { wrapOptions.base = await readFile(basePath, 'utf8'); wrapOptions.baseName = basename(basePath); wrapOptions.at = new Date().toISOString(); }
61
61
  if (by !== null) { wrapOptions.by = by; wrapOptions.at = new Date().toISOString(); }
62
62
  if (view) wrapOptions.view = view;