@concordance-wiki/plugin-reader-vtt 0.1.0 → 0.3.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 +85 -7
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,10 +1,88 @@
1
- # @concordance-wiki/plugin-reader-vtt
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
- Reader for meeting transcripts and subtitles in WebVTT (`.vtt`) and SubRip (`.srt`), so that what was said can be read, searched and cited without replaying the recording.
5
+ <h1 align="center">@concordance-wiki/plugin-reader-vtt</h1>
4
6
 
5
- Today: the plugin contributes a `reader` for `.vtt` and `.srt`. `parseTranscript(text, format)` turns a transcript into its cues (index, start and end in seconds, speaker, text), the unique speakers in order of first appearance, the duration (end of the last cue) and, for VTT, the `Language:` header. `renderTranscript` produces static HTML: one `<article>` per run of consecutive cues of the same speaker, headed by the speaker's name, and one `<p id="t-<milliseconds>">` per cue whose timecode links to its own anchor, so that a timecode is shareable as a URL fragment. `transcriptText` gives the spoken text, one line per speaker turn, with the character range of every cue, so that a position in the text maps back to a timecode. The reader returns `{ metadata: { format, language, duration, cues, speakers }, text, units }`, where `units` (`transcriptUnits`) cuts the text into one addressable unit per speaker turn, `{ label, text, anchor, speaker? }`, labelled by the timecode of its first cue, named after its speaker when the cues name one and anchored like the rendering; the build reads them as the positions of the transcript, so that its text goes through term recognition like any other content and a mention in it cites `00:12:05` where a note cites a line.
7
+ <p align="center"><strong>Reads meeting transcripts and subtitles, so what was said can be searched and cited by timecode.</strong></p>
6
8
 
7
- ## Parsing rules
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@concordance-wiki/plugin-reader-vtt"><img alt="npm" src="https://img.shields.io/npm/v/@concordance-wiki/plugin-reader-vtt?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/publishing-transcripts.md">Publishing transcripts</a> ·
19
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/plugins/reader-vtt/CHANGELOG.md">Changelog</a>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## Why
25
+
26
+ The transcript of a meeting is where a decision was actually taken, and nobody replays the recording to find the minute. This plugin reads WebVTT (`.vtt`) and SubRip (`.srt`) files in your repositories and makes each of them a page of the wiki: the speakers, the duration and the language as properties, the text cut into one addressable unit per speaker turn, so that a mention of a term in it cites `00:12:05` where a note cites a line. Transcripts stay out of the published site until the configuration says otherwise, pseudonymised or not. 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-vtt
32
+ ```
33
+
34
+ Then declare it in `concordance.yaml`:
35
+
36
+ ```yaml
37
+ plugins:
38
+ - "@concordance-wiki/plugin-reader-vtt"
39
+ ```
40
+
41
+ Every `.vtt` and `.srt` file of a source becomes a transcript entity. To publish the transcripts, and the names in them, say so:
42
+
43
+ ```yaml
44
+ privacy:
45
+ publish_transcripts: true
46
+ pseudonymize:
47
+ enabled: true
48
+ dictionary: ./pseudonyms.yaml
49
+ ```
50
+
51
+ The transcript as a library, without the build:
52
+
53
+ ```ts
54
+ import { parseTranscript, renderTranscript, transcriptUnits } from "@concordance-wiki/plugin-reader-vtt";
55
+
56
+ const transcript = parseTranscript("WEBVTT\n\n00:00:01.000 --> 00:00:04.000\n<v Reviewer>The occurrence scan reads every note.\n", "vtt");
57
+ transcript.speakers; // ["Reviewer"]
58
+ transcriptUnits(transcript).map((unit) => unit.label); // ["00:00:01"]
59
+ renderTranscript(transcript); // one <article> per speaker turn, one <p id="t-1000"> per cue
60
+ ```
61
+
62
+ ## What you get
63
+
64
+ - **A page per transcript**: speakers, duration and language as properties, the text readable turn by turn.
65
+ - **Citations by timecode**: every mention of a term in a transcript points at the cue where it was said, with a shareable anchor.
66
+ - **Private by default**: a transcript is read but never published, pseudonymised or not, until `privacy.publish_transcripts` lets it into the site and its search index.
67
+ - **Pseudonymisation at build**: `rewriteTranscript` writes the file again with every speaker and every text passed through your dictionary, so the file offered for download never carries a real name.
68
+ - **Two formats, one parser**: `parseTranscript` reads WebVTT and SubRip into cues, speakers in order of first appearance, duration and the `Language:` header; `writeTranscript` writes either back.
69
+ - **Static HTML**: `renderTranscript`, one `<article>` per speaker turn, one paragraph per cue, no script needed.
70
+
71
+ ## Documentation
72
+
73
+ - [Publishing transcripts](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/publishing-transcripts.md): what to settle before the first build that publishes one
74
+ - [Configuration reference](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/configuration.md), the `privacy` block
75
+ - [Plugins](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/plugins.md), the reader contribution point
76
+ - [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-vtt/CHANGELOG.md)
77
+
78
+ Part of [Concordance](https://github.com/concordance-wiki/concordance), GNU GPL v3 or later.
79
+
80
+ <details>
81
+ <summary>Inside the package</summary>
82
+
83
+ The plugin contributes a `reader` for `.vtt` and `.srt`. `parseTranscript(text, format)` turns a transcript into its cues (index, start and end in seconds, speaker, text), the unique speakers in order of first appearance, the duration (end of the last cue) and, for VTT, the `Language:` header. `renderTranscript` produces static HTML: one `<article>` per run of consecutive cues of the same speaker, headed by the speaker's name, and one `<p id="t-<milliseconds>">` per cue whose timecode links to its own anchor, so that a timecode is shareable as a URL fragment. `transcriptText` gives the spoken text, one line per speaker turn, with the character range of every cue, so that a position in the text maps back to a timecode. The reader returns `{ metadata: { format, language, duration, cues, speakers }, text, units }`, where `units` (`transcriptUnits`) cuts the text into one addressable unit per speaker turn, `{ label, text, anchor, speaker? }`, labelled by the timecode of its first cue, named after its speaker when the cues name one and anchored like the rendering; the build reads them as the positions of the transcript, so that its text goes through term recognition like any other content and a mention in it cites `00:12:05` where a note cites a line. `rewriteTranscript` writes the file again with every speaker and every text passed through the substitution the pseudonymisation gives, timecodes kept, so that the file offered for download never carries a real name.
84
+
85
+ ### Parsing rules
8
86
 
9
87
  | Rule | VTT | SRT |
10
88
  |---|---|---|
@@ -18,8 +96,8 @@ Today: the plugin contributes a `reader` for `.vtt` and `.srt`. `parseTranscript
18
96
 
19
97
  A malformed timing line throws an `Error` naming its line number; a VTT file without `WEBVTT` header throws `line 1: missing WEBVTT header`. The lines of a multi-line cue are joined with a space.
20
98
 
21
- ## Later
99
+ ### Privacy
22
100
 
23
- Speaker names are returned as they appear: pseudonymisation is a separate step that runs before anything is published or indexed. A passage from which a decision note was extracted will carry a reference to that note; the cue anchors are what such a reference points at.
101
+ Speaker names are returned as they appear by the reader: pseudonymisation is a separate step of the build, `privacy.pseudonymize`, that runs before anything of a transcript is rendered, indexed or offered for download, and `privacy.publish_transcripts` is what lets a transcript into the published site at all. A passage from which a decision note was extracted will carry a reference to that note; the cue anchors are what such a reference points at.
24
102
 
25
- Part of [Concordance](../../README.md).
103
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concordance-wiki/plugin-reader-vtt",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Reader for VTT and SRT transcripts: cues, speakers, duration, language, HTML rendering with addressable timecodes.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -29,10 +29,10 @@
29
29
  "README.md",
30
30
  "LICENSE"
31
31
  ],
32
+ "dependencies": {
33
+ "@concordance-wiki/core": "0.3.0"
34
+ },
32
35
  "scripts": {
33
36
  "typecheck": "tsc -b tsconfig.json"
34
- },
35
- "dependencies": {
36
- "@concordance-wiki/core": "workspace:*"
37
37
  }
38
- }
38
+ }