@concordance-wiki/plugin-reader-office 0.1.0 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +64 -7
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,8 +1,67 @@
1
- # @concordance-wiki/plugin-reader-office
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/concordance-wiki/concordance/main/brand/concordance-mark.svg" width="72" alt="Concordance">
3
+ </p>
2
4
 
3
- Metadata reader for Word, PowerPoint, Excel and PDF files. Contributes one `reader` for `.docx`, `.pptx`, `.xlsx` and `.pdf`; no system dependency.
5
+ <h1 align="center">@concordance-wiki/plugin-reader-office</h1>
4
6
 
5
- `read({ path, payload: { bytes } })` returns `{ metadata, text: "" }`. The text stays empty: extraction belongs to the conversion story. The metadata carries what the file states about itself:
7
+ <p align="center"><strong>Reads what your Word, PowerPoint, Excel and PDF files state about themselves, so every document gets a page.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@concordance-wiki/plugin-reader-office"><img alt="npm" src="https://img.shields.io/npm/v/@concordance-wiki/plugin-reader-office?style=flat-square"></a>
11
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/LICENSE"><img alt="Licence" src="https://img.shields.io/badge/licence-GPL--3.0--or--later-16181B?style=flat-square"></a>
12
+ <a href="https://github.com/concordance-wiki/concordance/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/concordance-wiki/concordance/ci.yml?branch=main&label=ci&style=flat-square"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/getting-started.md">Getting started</a> ·
17
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/configuration.md">Configuration</a> ·
18
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/plugins.md">Plugins</a> ·
19
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/plugins/reader-office/CHANGELOG.md">Changelog</a>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## Why
25
+
26
+ Half of what a team knows sits in office documents next to the markdown, and a wiki that ignores them is half a wiki. This plugin reads the metadata of `.docx`, `.pptx`, `.xlsx` and `.pdf` files in your repositories, title, author, subject, keywords, dates, page, word and slide counts, so that every document gets a page with what the file states about itself, is filed with the notes and shows up in the to-do list when nobody has summarised it. It is carried by [`@concordance-wiki/concordance`](https://www.npmjs.com/package/@concordance-wiki/concordance); install it on its own next to [`@concordance-wiki/cli`](https://www.npmjs.com/package/@concordance-wiki/cli). No system dependency.
27
+
28
+ ## Quick start
29
+
30
+ ```bash
31
+ npm install --save-dev @concordance-wiki/plugin-reader-office
32
+ ```
33
+
34
+ Then declare it in `concordance.yaml`, with the conversion plugin next to it when LibreOffice is available, for the preview and the text of every page:
35
+
36
+ ```yaml
37
+ plugins:
38
+ - "@concordance-wiki/plugin-reader-office"
39
+ - "@concordance-wiki/plugin-convert-libreoffice"
40
+ ```
41
+
42
+ Every `.docx`, `.pptx`, `.xlsx` and `.pdf` file of a source becomes a document entity whose properties come from the file.
43
+
44
+ ## What you get
45
+
46
+ - **A page per document**, with the properties the file carries: title, author, subject, keywords, creation and modification dates, application.
47
+ - **Counts that mean something**: the pages and words an office file declares, the page count of a PDF, the slides of a deck with their titles in order.
48
+ - **The document's own dates**, created and modified as the file says, kept apart from the git commit date of the file.
49
+ - **Only the bytes**: the reader never touches git, the file system or the clock; a corrupted file is a finding, not a failed build.
50
+ - **Twins reconciled**: the build matches a document with the note that describes it, and the page of that note offers the file for download; a document nobody wrote about is listed on the to-do page.
51
+ - **Usable alone**: `readOoxml(bytes, kind)` and `readPdf(bytes)` read the two families without the pipeline.
52
+
53
+ ## Documentation
54
+
55
+ - [Plugins](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/plugins.md), the reader contribution point
56
+ - [Configuration reference](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/configuration.md), `privacy.pseudonymize` for the authors a file names
57
+ - [Home page](https://concordance-wiki.github.io/concordance/), the [demo wiki](https://concordance-wiki.github.io/demo-wiki/) and the [changelog](https://github.com/concordance-wiki/concordance/blob/main/plugins/reader-office/CHANGELOG.md)
58
+
59
+ Part of [Concordance](https://github.com/concordance-wiki/concordance), GNU GPL v3 or later.
60
+
61
+ <details>
62
+ <summary>Inside the package</summary>
63
+
64
+ `read({ path, payload: { bytes } })` returns `{ metadata, text: "" }`. The text stays empty: extraction belongs to the conversion plugin, which reads it from the PDF. The metadata carries what the file states about itself:
6
65
 
7
66
  | Property | docx, pptx, xlsx | pdf |
8
67
  |---|---|---|
@@ -17,8 +76,6 @@ An absent property is absent from the record. A package without `docProps` yield
17
76
 
18
77
  The dates are the document's own and are kept apart from the git commit date the ingested file carries: the reader reads nothing but the bytes it is given, never git, the file system or the clock. Authors are returned raw; pseudonymisation applies downstream, on the model, when it is enabled.
19
78
 
20
- PDF objects stored in compressed object streams are not scanned: the page count is then a lower bound and an Info dictionary hidden there is not seen. The text extraction story brings a full parser.
21
-
22
- Exports: the default plugin manifest, `read`, `extensions`, `readOoxml(bytes, kind)`, `readPdf(bytes)`, `isoDate` and the `OfficeMetadata` type.
79
+ PDF objects stored in compressed object streams are not scanned: the page count is then a lower bound and an Info dictionary hidden there is not seen. The conversion plugin, which parses the whole PDF for its text, does not depend on that count.
23
80
 
24
- Part of [Concordance](../../README.md); see the [plugin guide](../../docs/guides/plugins.md).
81
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concordance-wiki/plugin-reader-office",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Metadata reader for docx, pptx, xlsx and pdf files: properties, dates, counts and slide titles.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -29,12 +29,12 @@
29
29
  "README.md",
30
30
  "LICENSE"
31
31
  ],
32
- "scripts": {
33
- "typecheck": "tsc -b tsconfig.json"
34
- },
35
32
  "dependencies": {
36
- "@concordance-wiki/core": "workspace:*",
37
33
  "fast-xml-parser": "5.11.1",
38
- "fflate": "0.8.3"
34
+ "fflate": "0.8.3",
35
+ "@concordance-wiki/core": "0.2.0"
36
+ },
37
+ "scripts": {
38
+ "typecheck": "tsc -b tsconfig.json"
39
39
  }
40
- }
40
+ }