pageproof 0.1.0 → 0.1.1

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
@@ -1,6 +1,6 @@
1
- # mdpreview
1
+ # Pageproof
2
2
 
3
- `mdpreview` opens a live, paginated browser preview for a Markdown document. It
3
+ `pageproof` opens a live, paginated browser preview for a Markdown document. It
4
4
  uses Pandoc for Markdown and citeproc citations, then uses Paged.js
5
5
  in the browser to render paginated output including footnotes. (Pandoc must be installed.)
6
6
 
@@ -13,13 +13,13 @@ Markdown can include scripts, so only preview Markdown you trust!
13
13
  ## Installation and usage
14
14
 
15
15
  ```sh
16
- npm install -g mdpreview
16
+ npm install -g pageproof
17
17
 
18
18
  # install as a skill for codex
19
- mkdir -p ~/.agents/skills/mdpreview && mdpreview --show-skill > ~/.agents/skills/mdpreview/SKILL.md
19
+ mkdir -p ~/.agents/skills/pageproof && pageproof --show-skill > ~/.agents/skills/pageproof/SKILL.md
20
20
 
21
21
  # install as a skill for Claude Code
22
- mkdir -p ~/.claude/skills/mdpreview && mdpreview --show-skill > ~/.claude/skills/mdpreview/SKILL.md
22
+ mkdir -p ~/.claude/skills/pageproof && pageproof --show-skill > ~/.claude/skills/pageproof/SKILL.md
23
23
  ```
24
24
 
25
25
  ## Usage
@@ -32,13 +32,13 @@ and it should know what to do.
32
32
  To use it at the command line,
33
33
 
34
34
  ```sh
35
- mdpreview FILE.md
36
- mdpreview --style=doublespaced --citations=chicago FILE.md
37
- mdpreview --styles
35
+ pageproof FILE.md
36
+ pageproof --style=doublespaced --citations=chicago FILE.md
37
+ pageproof --styles
38
38
  ```
39
39
 
40
40
  It will start up a browser viewing the compiled document. When the user
41
- closes the browser, `mdpreview` will automatically shut down.
41
+ closes the browser, `pageproof` will automatically shut down.
42
42
 
43
43
 
44
44
  ## Document and citation styles
@@ -49,7 +49,7 @@ The default base-style list consists of just one, `msword`.
49
49
  Other bundled mix-in styles include `doublespaced`, and `numbered` for numbered section headings.
50
50
  Thus, for example, to get double-spaced output, use
51
51
  ```sh
52
- mdpreview --style=doublespaced FILE.md
52
+ pageproof --style=doublespaced FILE.md
53
53
  ```
54
54
 
55
55
  **Citations** are handled by Pandoc. Your markdown document should include front-matter such as
@@ -61,18 +61,18 @@ bibliography: myrefs.bib
61
61
  ```
62
62
  and then you can cite using `[@citeref]`. To choose the citation format, use e.g.
63
63
  ```sh
64
- mdpreview --citations=chicago FILE.md
64
+ pageproof --citations=chicago FILE.md
65
65
  ```
66
- Available citation formats are listed by `mdpreview --styles`.
66
+ Available citation formats are listed by `pageproof --styles`.
67
67
 
68
68
  ## Configuration
69
69
 
70
- Add CSS stylesheets or CSL bibliography styles to `~/.mdpreview/`. They will be included
71
- in the `mdpreview --styles` list, and you can select them with `--style` or `--citations`.
70
+ Add CSS stylesheets or CSL bibliography styles to `~/.pageproof/`. They will be included
71
+ in the `pageproof --styles` list, and you can select them with `--style` or `--citations`.
72
72
  In the case of name conflict, user-provided files take precedence over the built-in styles.
73
73
 
74
74
  To specify the default document styles and citation style, specify the configuration
75
- in `~/.mdpreview/config.yaml`:
75
+ in `~/.pageproof/config.yaml`:
76
76
  ```yaml
77
77
  styles: [msword]
78
78
  citations: european-journal-of-international-law
package/assets/SKILL.md CHANGED
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: mdpreview
2
+ name: pageproof
3
3
  description: Use to open a live browser preview of a Markdown document, especially when the user wants to see it paginated and with citations and footnotes. Do not use for one-off Markdown-to-PDF conversion.
4
4
  ---
5
5
 
6
- # mdpreview
6
+ # Pageproof
7
7
 
8
- `mdpreview` is a CLI tool that opens a live, paginated browser preview of a Markdown
8
+ `pageproof` is a CLI tool that opens a live, paginated browser preview of a Markdown
9
9
  file. It handles footnotes and citations, and reloads automatically when the source file changes.
10
10
 
11
11
  ## Opening a preview
@@ -13,7 +13,7 @@ file. It handles footnotes and citations, and reloads automatically when the sou
13
13
  Use this skill when the user asks to preview a Markdown document.
14
14
  Always invoke in detached mode so the shell returns once the preview is up:
15
15
  ```sh
16
- mdpreview --detached "FILE.md"
16
+ pageproof --detached "FILE.md"
17
17
  ```
18
18
  It will launch a browser tab and start an HTTP server
19
19
  on a random localhost port. It will also print a status URL.
@@ -28,12 +28,12 @@ The status includes Pandoc warnings and errors for the current document.
28
28
 
29
29
  To choose a different document style, for example double-spaced output:
30
30
  ```sh
31
- mdpreview --detached --style=doublespaced FILE.md
31
+ pageproof --detached --style=doublespaced FILE.md
32
32
  ```
33
33
 
34
34
  Use this to list available styles:
35
35
  ```sh
36
- mdpreview --styles
36
+ pageproof --styles
37
37
  ```
38
38
 
39
39
  There are
@@ -42,7 +42,7 @@ when the user asks for a specific citation style.
42
42
 
43
43
  ## Permissions and lifecycle
44
44
 
45
- `mdpreview` launches a browser tab and binds an HTTP server on a random localhost
45
+ `pageproof` launches a browser tab and binds an HTTP server on a random localhost
46
46
  port. Under WSL the browser is opened via `cmd.exe`.
47
47
 
48
48
  The sandbox must permit spawning the browser opener and making localhost HTTP
package/assets/_paged.css CHANGED
@@ -1,4 +1,4 @@
1
- /* mdpreview-style: Page geometry, Paged.js support, footnote mechanics, and preview chrome. */
1
+ /* pageproof-style: Page geometry, Paged.js support, footnote mechanics, and preview chrome. */
2
2
  :root {
3
3
  color: black;
4
4
  background: #F0F0F0;
@@ -1,4 +1,4 @@
1
- /* mdpreview-style: Double-spaced text override for manuscript drafts. */
1
+ /* pageproof-style: Double-spaced text override for manuscript drafts. */
2
2
  html {
3
3
  line-height: 2;
4
4
  }
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="mdpreview">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Pageproof">
2
2
  <rect width="64" height="64" rx="10" fill="#3f3f3f"/>
3
3
  <rect x="18" y="-10" width="28" height="34" rx="2" fill="#f7f7f2"/>
4
4
  <rect x="18" y="40" width="28" height="34" rx="2" fill="#f7f7f2"/>
package/assets/latex.css CHANGED
@@ -1,4 +1,4 @@
1
- /* mdpreview-style: LaTeX-like document theme with Computer Modern-style typography. */
1
+ /* pageproof-style: LaTeX-like document theme with Computer Modern-style typography. */
2
2
  :root {
3
3
  color: black;
4
4
  font-family: "MJX-TEX-N", "MJXTEX", "CMU Serif", "Computer Modern Serif",
package/assets/msword.css CHANGED
@@ -1,4 +1,4 @@
1
- /* mdpreview-style: Default Times/Calibri document theme for academic prose. */
1
+ /* pageproof-style: Default Times/Calibri document theme for academic prose. */
2
2
  :root {
3
3
  color: black;
4
4
  font-family: "Times New Roman", Times, serif;
@@ -1,4 +1,4 @@
1
- /* mdpreview-style: Heading-numbering mix-in using legal-style nested counters. */
1
+ /* pageproof-style: Heading-numbering mix-in using legal-style nested counters. */
2
2
 
3
3
  /* Unnumbered headings (Pandoc `# heading {-}`) are treated transparently to
4
4
  the counter cascade (matching LaTeX section-star): they do not advance the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pageproof",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Live Pandoc Markdown preview with paginated browser output.",
5
5
  "type": "module",
6
6
  "author": "Damon Wischik <djw1005@cam.ac.uk>",
package/src/assets.js CHANGED
@@ -30,7 +30,7 @@ export async function resolveAsset(kind, name, options = {}) {
30
30
  const filename = `${name}.${selector.ext}`;
31
31
  const homeDir = options.homeDir ?? os.homedir();
32
32
  const candidates = [
33
- path.join(homeDir, '.mdpreview', filename),
33
+ path.join(homeDir, '.pageproof', filename),
34
34
  path.join(packageRoot, 'assets', filename)
35
35
  ];
36
36
 
@@ -70,12 +70,12 @@ export async function resolveAssets(selections, options = {}) {
70
70
  }
71
71
 
72
72
  async function loadConfig(homeDir) {
73
- const configPath = path.join(homeDir, '.mdpreview', 'config.yaml');
73
+ const configPath = path.join(homeDir, '.pageproof', 'config.yaml');
74
74
  if (!(await pathExists(configPath))) return { path: configPath, data: {} };
75
75
  try {
76
76
  return { path: configPath, data: parseYaml(await fs.readFile(configPath, 'utf8')) ?? {} };
77
77
  } catch (error) {
78
- throw new Error(`Invalid mdpreview config ${configPath}: ${error?.message || String(error)}`);
78
+ throw new Error(`Invalid pageproof config ${configPath}: ${error?.message || String(error)}`);
79
79
  }
80
80
  }
81
81
 
@@ -83,7 +83,7 @@ function configBaseStyles(config) {
83
83
  const base = config.data?.styles;
84
84
  if (base === undefined) return [...defaultBaseStyles];
85
85
  if (!Array.isArray(base) || base.some((item) => typeof item !== 'string')) {
86
- throw new Error(`Invalid mdpreview config ${config.path}: styles must be a list of style names.`);
86
+ throw new Error(`Invalid pageproof config ${config.path}: styles must be a list of style names.`);
87
87
  }
88
88
  return base;
89
89
  }
@@ -92,7 +92,7 @@ function configCitationStyle(config) {
92
92
  const value = config.data?.citations;
93
93
  if (value === undefined) return null;
94
94
  if (typeof value !== 'string') {
95
- throw new Error(`Invalid mdpreview config ${config.path}: citations must be a string.`);
95
+ throw new Error(`Invalid pageproof config ${config.path}: citations must be a string.`);
96
96
  }
97
97
  return value;
98
98
  }
@@ -119,7 +119,7 @@ async function listAvailableAssets(kind, homeDir) {
119
119
  if (!selector) throw new Error(`Unknown asset type: ${kind}`);
120
120
  const discovered = new Map();
121
121
  const roots = [
122
- { source: 'user', dir: path.join(homeDir, '.mdpreview') },
122
+ { source: 'user', dir: path.join(homeDir, '.pageproof') },
123
123
  { source: 'bundled', dir: path.join(packageRoot, 'assets') }
124
124
  ];
125
125
 
@@ -164,7 +164,7 @@ async function describeAsset(kind, assetPath) {
164
164
  }
165
165
 
166
166
  function cssDescription(text) {
167
- const match = text.match(/^\s*\/\*\s*mdpreview-style:\s*([^*]+?)\s*\*\//i);
167
+ const match = text.match(/^\s*\/\*\s*pageproof-style:\s*([^*]+?)\s*\*\//i);
168
168
  return match ? collapseWhitespace(match[1]) : '';
169
169
  }
170
170
 
package/src/cli.js CHANGED
@@ -142,8 +142,8 @@ export async function stylesText(options = {}) {
142
142
  }
143
143
 
144
144
  function configHelpText() {
145
- return `Additional styles (NAME.css) and citation styles (NAME.csl) can be placed in ~/.mdpreview/.
146
- Defaults can be overridden in ~/.mdpreview/config.yaml, e.g.
145
+ return `Additional styles (NAME.css) and citation styles (NAME.csl) can be placed in ~/.pageproof/.
146
+ Defaults can be overridden in ~/.pageproof/config.yaml, e.g.
147
147
  styles: [msword]
148
148
  citations: european-journal-of-international-law`;
149
149
  }
package/bin/mdpreview.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runCli } from '../src/cli.js';
4
-
5
- runCli(process.argv.slice(2)).catch((error) => {
6
- console.error(error?.message || String(error));
7
- process.exitCode = 1;
8
- });