document-cli 5.3.5 → 5.3.6
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 +2 -2
- package/dist/cli.js +6 -6
- package/dist/index.cjs +6 -6
- package/dist/index.js +6 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -161,14 +161,14 @@ document-cli docx-extras report.docx
|
|
|
161
161
|
document-cli metadata report.pdf
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
**`set-metadata <input> [output]`** — patches a document's own title/author/subject/keywords, leaving every other field untouched (`--set-title`, `--set-author`, `--set-subject`, `--set-keywords` — the last a comma-separated list); source and target format must match, so run `convert`/`from-package` first if a different target format is also needed. A `pdf` source/target patches the parsed PDF directly (`writePdf`) with no layout engine involved
|
|
164
|
+
**`set-metadata <input> [output]`** — patches a document's own title/author/subject/keywords, leaving every other field untouched (`--set-title`, `--set-author`, `--set-subject`, `--set-keywords` — the last a comma-separated list); source and target format must match, so run `convert`/`from-package` first if a different target format is also needed. A `pdf` source/target patches the parsed PDF directly (`writePdf`) with no layout engine involved, and a `docx` source/target patches `docProps/core.xml` directly on the decoded package (`patchDocxMetadata`) with no `ContentDocument` rebuild involved — both genuinely lossless for everything else in the document, the docx path included: comments, footnotes, headers/footers, and numbering definitions (everything `docx-extras` covers) survive untouched, since nothing but the metadata part itself is ever written. Every other format (pptx, xlsx, odt, odp, ods, odg, markdown, rtf) rebuilds a fresh package from that format's own `ContentDocument`; a `csv` or `svg` source/target is rejected outright, since plain text has no metadata container and a rebuild would silently drop the override:
|
|
165
165
|
|
|
166
166
|
```sh
|
|
167
167
|
document-cli set-metadata report.docx report.docx --set-title "Q3 Report" --set-author "Finance"
|
|
168
168
|
document-cli set-metadata report.docx report.odt --set-keywords "draft,internal"
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
**`outline <input>`** — prints a document's outline: the table-of-contents projection over the tree-form `DocumentTree` read straight off the source document's own bytes — headings nested by heading level, list items nested under their heading or slide, one group per slide (labelled `Slide N`), sheet (labelled with the sheet's own name), or draw page (labelled `Page N`) — rendered as indented text, two spaces per nesting depth. Leaves render their own text (a paragraph's runs, a table's cell text, an image's alt text, a formula's LaTeX) or their kind in brackets when they carry none (`[page-break]`, `[vector]`, `[embeddedObject]`). Works on any of the seventeen readable formats: the command reads the source's own native tree directly (documents.js's `readNativeDocumentTree`) — no bridging conversion runs and no output bytes are discarded — and projects that tree through [`document-outline.js`](../document-outline.js/README.md)'s own `buildOutline`, this command being that package's first real consumer. `--json` emits the outline tree itself — groups as `{ text, level, children }`, leaves as the package leaves they are — rather than a CLI-private shape; a `pdf` source's own `readPdf` parse diagnostics still reach stderr exactly as they would on the matching `pdf-to-docx` command. `--from <format>` names the source format when the input path carries no recognised extension to infer it from — the only way to outline a document read from stdin (`-`), which otherwise has no extension to read at all. Heading nesting depends on the source document
|
|
171
|
+
**`outline <input>`** — prints a document's outline: the table-of-contents projection over the tree-form `DocumentTree` read straight off the source document's own bytes — headings nested by heading level, list items nested under their heading or slide, one group per slide (labelled `Slide N`), sheet (labelled with the sheet's own name), or draw page (labelled `Page N`) — rendered as indented text, two spaces per nesting depth. Leaves render their own text (a paragraph's runs, a table's cell text, an image's alt text, a formula's LaTeX) or their kind in brackets when they carry none (`[page-break]`, `[vector]`, `[embeddedObject]`). Works on any of the seventeen readable formats: the command reads the source's own native tree directly (documents.js's `readNativeDocumentTree`) — no bridging conversion runs and no output bytes are discarded — and projects that tree through [`document-outline.js`](../document-outline.js/README.md)'s own `buildOutline`, this command being that package's first real consumer. `--json` emits the outline tree itself — groups as `{ text, level, children }`, leaves as the package leaves they are — rather than a CLI-private shape; a `pdf` source's own `readPdf` parse diagnostics still reach stderr exactly as they would on the matching `pdf-to-docx` command. `--from <format>` names the source format when the input path carries no recognised extension to infer it from — the only way to outline a document read from stdin (`-`), which otherwise has no extension to read at all. Heading nesting depends on the source document carrying a heading-level signal on disk (`w:outlineLvl` for docx, `text:outline-level` for odt) — present in anything authored by Word or LibreOffice, always present for a markdown source (whose own reader parses `#`/`##` headings directly), and also stamped by this ecosystem's own docx/odt writers (`buildDocxPackage`'s `w:outlineLvl`, `buildOdtPackage`'s promotion to a real `text:h`), so outlining a docx/odt this CLI's own conversions produce nests headings correctly too:
|
|
172
172
|
|
|
173
173
|
```sh
|
|
174
174
|
document-cli outline report.docx
|
package/dist/cli.js
CHANGED
|
@@ -1174,11 +1174,11 @@ async function runSetMetadata(input, output, options) {
|
|
|
1174
1174
|
function registerSetMetadataCommand(program) {
|
|
1175
1175
|
const command = program.command("set-metadata <input> [output]").description("patch a document's own title/author/subject/keywords, leaving every other field and every other flag as-is").addHelpText("after", [
|
|
1176
1176
|
"",
|
|
1177
|
-
"
|
|
1178
|
-
"
|
|
1179
|
-
"
|
|
1180
|
-
"
|
|
1181
|
-
"
|
|
1177
|
+
"Three write paths: a pdf source/target patches the metadata directly on the parsed PDF (writePdf), and a docx source/target",
|
|
1178
|
+
"patches docProps/core.xml directly on the decoded package -- both with no layout engine or ContentDocument rebuild involved",
|
|
1179
|
+
"at all, so everything else on the page (pdf) or in the package (docx -- comments, footnotes, headers/footers, numbering",
|
|
1180
|
+
"definitions included) survives byte-faithful. Every other supported format (pptx, xlsx, odt, odp, ods, odg, markdown, rtf)",
|
|
1181
|
+
"rebuilds a fresh package from that format's own ContentDocument instead.",
|
|
1182
1182
|
"",
|
|
1183
1183
|
"set-metadata does not convert format -- source and target must match. Run convert/from-package first, then",
|
|
1184
1184
|
"set-metadata on the result, if you need a different target format."
|
|
@@ -1199,7 +1199,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
//#endregion
|
|
1201
1201
|
//#region package.json
|
|
1202
|
-
var version = "5.3.
|
|
1202
|
+
var version = "5.3.6";
|
|
1203
1203
|
//#endregion
|
|
1204
1204
|
//#region src/program.ts
|
|
1205
1205
|
function createProgram() {
|
package/dist/index.cjs
CHANGED
|
@@ -1522,11 +1522,11 @@ async function runSetMetadata(input, output, options) {
|
|
|
1522
1522
|
function registerSetMetadataCommand(program) {
|
|
1523
1523
|
const command = program.command("set-metadata <input> [output]").description("patch a document's own title/author/subject/keywords, leaving every other field and every other flag as-is").addHelpText("after", [
|
|
1524
1524
|
"",
|
|
1525
|
-
"
|
|
1526
|
-
"
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
"
|
|
1525
|
+
"Three write paths: a pdf source/target patches the metadata directly on the parsed PDF (writePdf), and a docx source/target",
|
|
1526
|
+
"patches docProps/core.xml directly on the decoded package -- both with no layout engine or ContentDocument rebuild involved",
|
|
1527
|
+
"at all, so everything else on the page (pdf) or in the package (docx -- comments, footnotes, headers/footers, numbering",
|
|
1528
|
+
"definitions included) survives byte-faithful. Every other supported format (pptx, xlsx, odt, odp, ods, odg, markdown, rtf)",
|
|
1529
|
+
"rebuilds a fresh package from that format's own ContentDocument instead.",
|
|
1530
1530
|
"",
|
|
1531
1531
|
"set-metadata does not convert format -- source and target must match. Run convert/from-package first, then",
|
|
1532
1532
|
"set-metadata on the result, if you need a different target format."
|
|
@@ -1547,7 +1547,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region package.json
|
|
1550
|
-
var version = "5.3.
|
|
1550
|
+
var version = "5.3.6";
|
|
1551
1551
|
//#endregion
|
|
1552
1552
|
//#region src/program.ts
|
|
1553
1553
|
function createProgram() {
|
package/dist/index.js
CHANGED
|
@@ -1521,11 +1521,11 @@ async function runSetMetadata(input, output, options) {
|
|
|
1521
1521
|
function registerSetMetadataCommand(program) {
|
|
1522
1522
|
const command = program.command("set-metadata <input> [output]").description("patch a document's own title/author/subject/keywords, leaving every other field and every other flag as-is").addHelpText("after", [
|
|
1523
1523
|
"",
|
|
1524
|
-
"
|
|
1525
|
-
"
|
|
1526
|
-
"
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1524
|
+
"Three write paths: a pdf source/target patches the metadata directly on the parsed PDF (writePdf), and a docx source/target",
|
|
1525
|
+
"patches docProps/core.xml directly on the decoded package -- both with no layout engine or ContentDocument rebuild involved",
|
|
1526
|
+
"at all, so everything else on the page (pdf) or in the package (docx -- comments, footnotes, headers/footers, numbering",
|
|
1527
|
+
"definitions included) survives byte-faithful. Every other supported format (pptx, xlsx, odt, odp, ods, odg, markdown, rtf)",
|
|
1528
|
+
"rebuilds a fresh package from that format's own ContentDocument instead.",
|
|
1529
1529
|
"",
|
|
1530
1530
|
"set-metadata does not convert format -- source and target must match. Run convert/from-package first, then",
|
|
1531
1531
|
"set-metadata on the result, if you need a different target format."
|
|
@@ -1546,7 +1546,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
//#endregion
|
|
1548
1548
|
//#region package.json
|
|
1549
|
-
var version = "5.3.
|
|
1549
|
+
var version = "5.3.6";
|
|
1550
1550
|
//#endregion
|
|
1551
1551
|
//#region src/program.ts
|
|
1552
1552
|
function createProgram() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.6",
|
|
4
4
|
"description": "CLI and interactive Ink TUI for documents.js: every docx/pptx/odt/odp/ods/odg/odf/pdf/odm/odb/xlsx/csv/svg/markdown/rtf conversion, bridge, and editor as a scriptable command or a terminal app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"packageManager": "pnpm@11.6.0",
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"commander": "^15.0.0",
|
|
93
|
-
"document-outline.js": "^3.
|
|
94
|
-
"document-schema.js": "^
|
|
95
|
-
"documents.js": "^
|
|
93
|
+
"document-outline.js": "^3.3.0",
|
|
94
|
+
"document-schema.js": "^6.0.0",
|
|
95
|
+
"documents.js": "^7.0.0",
|
|
96
96
|
"ink": "^7.1.1",
|
|
97
97
|
"ink-text-input": "^6.0.0",
|
|
98
98
|
"react": "^19.2.8"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"eslint": "^10.8.0",
|
|
107
107
|
"husky": "^9.1.7",
|
|
108
108
|
"ink-testing-library": "^4.0.0",
|
|
109
|
-
"odf.js": "^
|
|
109
|
+
"odf.js": "^7.0.0",
|
|
110
110
|
"publint": "^0.3.22",
|
|
111
111
|
"semantic-release": "^25.0.8",
|
|
112
112
|
"tsdown": "^0.22.14",
|