lens-content-processor 0.2.1 → 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.
- package/dist/bundler/video.js +4 -4
- package/dist/bundler/video.js.map +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +11 -9
- package/dist/cli.js.map +1 -1
- package/dist/content-schema.d.ts +34 -0
- package/dist/content-schema.js +62 -0
- package/dist/content-schema.js.map +1 -0
- package/dist/flattener/index.d.ts +21 -1
- package/dist/flattener/index.js +316 -33
- package/dist/flattener/index.js.map +1 -1
- package/dist/fs/read-vault.d.ts +1 -4
- package/dist/fs/read-vault.js +4 -8
- package/dist/fs/read-vault.js.map +1 -1
- package/dist/index.d.ts +25 -2
- package/dist/index.js +231 -6
- package/dist/index.js.map +1 -1
- package/dist/parser/article.d.ts +16 -0
- package/dist/parser/article.js +70 -0
- package/dist/parser/article.js.map +1 -0
- package/dist/parser/course.d.ts +2 -2
- package/dist/parser/course.js +18 -35
- package/dist/parser/course.js.map +1 -1
- package/dist/parser/frontmatter.js +2 -0
- package/dist/parser/frontmatter.js.map +1 -1
- package/dist/parser/learning-outcome.d.ts +4 -2
- package/dist/parser/learning-outcome.js +65 -23
- package/dist/parser/learning-outcome.js.map +1 -1
- package/dist/parser/lens.d.ts +38 -1
- package/dist/parser/lens.js +173 -18
- package/dist/parser/lens.js.map +1 -1
- package/dist/parser/module.d.ts +11 -5
- package/dist/parser/module.js +172 -76
- package/dist/parser/module.js.map +1 -1
- package/dist/parser/sections.js +116 -13
- package/dist/parser/sections.js.map +1 -1
- package/dist/parser/video-transcript.d.ts +11 -0
- package/dist/parser/video-transcript.js +39 -0
- package/dist/parser/video-transcript.js.map +1 -0
- package/dist/parser/wikilink.d.ts +2 -0
- package/dist/parser/wikilink.js +88 -24
- package/dist/parser/wikilink.js.map +1 -1
- package/dist/utils/slug.d.ts +5 -0
- package/dist/utils/slug.js +16 -0
- package/dist/utils/slug.js.map +1 -0
- package/dist/validator/chat-precedence.d.ts +9 -0
- package/dist/validator/chat-precedence.js +32 -0
- package/dist/validator/chat-precedence.js.map +1 -0
- package/dist/validator/duplicates.d.ts +13 -0
- package/dist/validator/duplicates.js +27 -0
- package/dist/validator/duplicates.js.map +1 -0
- package/dist/validator/field-typos.d.ts +11 -0
- package/dist/validator/field-typos.js +36 -28
- package/dist/validator/field-typos.js.map +1 -1
- package/dist/validator/field-values.d.ts +14 -0
- package/dist/validator/field-values.js +61 -7
- package/dist/validator/field-values.js.map +1 -1
- package/dist/validator/output-integrity.d.ts +7 -0
- package/dist/validator/output-integrity.js +57 -0
- package/dist/validator/output-integrity.js.map +1 -0
- package/dist/validator/segment-fields.js +1 -15
- package/dist/validator/segment-fields.js.map +1 -1
- package/dist/validator/tier.d.ts +18 -0
- package/dist/validator/tier.js +74 -0
- package/dist/validator/tier.js.map +1 -0
- package/dist/validator/timestamps.d.ts +2 -0
- package/dist/validator/timestamps.js +91 -0
- package/dist/validator/timestamps.js.map +1 -0
- package/dist/validator/url-reachability.d.ts +8 -0
- package/dist/validator/url-reachability.js +60 -0
- package/dist/validator/url-reachability.js.map +1 -0
- package/dist/validator/validate-frontmatter.d.ts +9 -0
- package/dist/validator/validate-frontmatter.js +53 -0
- package/dist/validator/validate-frontmatter.js.map +1 -0
- package/package.json +5 -5
package/dist/parser/module.js
CHANGED
|
@@ -1,77 +1,173 @@
|
|
|
1
1
|
import { parseFrontmatter } from './frontmatter.js';
|
|
2
2
|
import { parseSections, MODULE_SECTION_TYPES } from './sections.js';
|
|
3
|
+
import { validateSlugFormat } from '../validator/field-values.js';
|
|
4
|
+
import { validateFrontmatter } from '../validator/validate-frontmatter.js';
|
|
5
|
+
const VALID_PAGE_SUBSECTION_TYPES = new Set(['text', 'chat']);
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param body - The body text of a # Page: section
|
|
8
|
-
* @returns Array of TextSegment objects extracted from ## Text subsections
|
|
7
|
+
* Collect raw subsections from a Page section body.
|
|
8
|
+
* Each ## header starts a new subsection whose fields are collected generically.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
function collectRawSubsections(body, baseLineNum) {
|
|
11
|
+
const subsections = [];
|
|
12
|
+
const unknownHeaders = [];
|
|
13
|
+
const warnings = [];
|
|
12
14
|
const lines = body.split('\n');
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
let current = null;
|
|
16
|
+
let freeTextWarned = false;
|
|
17
|
+
let currentFieldName = null;
|
|
18
|
+
let currentFieldLines = [];
|
|
19
|
+
function finalizeField() {
|
|
20
|
+
if (current && currentFieldName) {
|
|
21
|
+
current.fields[currentFieldName] = currentFieldLines.join('\n').trim();
|
|
22
|
+
}
|
|
23
|
+
currentFieldName = null;
|
|
24
|
+
currentFieldLines = [];
|
|
25
|
+
}
|
|
26
|
+
function finalizeSubsection() {
|
|
27
|
+
finalizeField();
|
|
28
|
+
if (current) {
|
|
29
|
+
subsections.push(current);
|
|
30
|
+
}
|
|
31
|
+
current = null;
|
|
32
|
+
}
|
|
33
|
+
for (let i = 0; i < lines.length; i++) {
|
|
34
|
+
const line = lines[i];
|
|
35
|
+
const lineNum = baseLineNum + i + 1;
|
|
36
|
+
// Check for ## header
|
|
37
|
+
const headerMatch = line.match(/^##\s+(\S.*?)\s*$/);
|
|
38
|
+
if (headerMatch) {
|
|
39
|
+
finalizeSubsection();
|
|
40
|
+
freeTextWarned = false;
|
|
41
|
+
const rawType = headerMatch[1].trim();
|
|
42
|
+
const normalizedType = rawType.toLowerCase();
|
|
43
|
+
if (VALID_PAGE_SUBSECTION_TYPES.has(normalizedType)) {
|
|
44
|
+
current = { type: normalizedType, fields: {}, line: lineNum };
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
unknownHeaders.push({ rawType, line: lineNum });
|
|
22
48
|
}
|
|
23
|
-
inTextSection = true;
|
|
24
|
-
currentContent = '';
|
|
25
|
-
collectingContent = false;
|
|
26
49
|
continue;
|
|
27
50
|
}
|
|
28
|
-
|
|
29
|
-
if (line.match(/^##\s+\S/)) {
|
|
30
|
-
// Save current content if any
|
|
31
|
-
if (collectingContent && currentContent.trim()) {
|
|
32
|
-
segments.push({ type: 'text', content: currentContent.trim() });
|
|
33
|
-
}
|
|
34
|
-
inTextSection = false;
|
|
35
|
-
currentContent = '';
|
|
36
|
-
collectingContent = false;
|
|
51
|
+
if (!current)
|
|
37
52
|
continue;
|
|
53
|
+
// Check for field:: value
|
|
54
|
+
const fieldMatch = line.match(/^(\w+)::\s*(.*)$/);
|
|
55
|
+
if (fieldMatch) {
|
|
56
|
+
finalizeField();
|
|
57
|
+
currentFieldName = fieldMatch[1];
|
|
58
|
+
const inlineValue = fieldMatch[2].trim();
|
|
59
|
+
currentFieldLines = inlineValue ? [inlineValue] : [];
|
|
60
|
+
}
|
|
61
|
+
else if (currentFieldName) {
|
|
62
|
+
// Continue multiline field value
|
|
63
|
+
currentFieldLines.push(line);
|
|
64
|
+
}
|
|
65
|
+
else if (line.trim() && !freeTextWarned) {
|
|
66
|
+
freeTextWarned = true;
|
|
67
|
+
const preview = line.trim().length > 60 ? line.trim().slice(0, 60) + '...' : line.trim();
|
|
68
|
+
warnings.push({
|
|
69
|
+
file: '',
|
|
70
|
+
line: lineNum,
|
|
71
|
+
message: `Text outside of a field:: definition will be ignored: "${preview}"`,
|
|
72
|
+
suggestion: 'Place this text inside a field (e.g., content:: your text), or remove it',
|
|
73
|
+
severity: 'warning',
|
|
74
|
+
});
|
|
38
75
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
76
|
+
}
|
|
77
|
+
finalizeSubsection();
|
|
78
|
+
return { subsections, unknownHeaders, warnings };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Convert raw subsections into typed segments, validating required fields.
|
|
82
|
+
*/
|
|
83
|
+
function convertSubsections(subsections, file) {
|
|
84
|
+
const segments = [];
|
|
85
|
+
const errors = [];
|
|
86
|
+
for (const sub of subsections) {
|
|
87
|
+
switch (sub.type) {
|
|
88
|
+
case 'text': {
|
|
89
|
+
const hasContentField = 'content' in sub.fields;
|
|
90
|
+
const content = sub.fields.content;
|
|
91
|
+
if (!hasContentField) {
|
|
92
|
+
errors.push({
|
|
93
|
+
file,
|
|
94
|
+
line: sub.line,
|
|
95
|
+
message: 'Text section missing content:: field',
|
|
96
|
+
suggestion: "Add 'content::' followed by your text content",
|
|
97
|
+
severity: 'error',
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
if (content.trim()) {
|
|
102
|
+
segments.push({ type: 'text', content: content.trim() });
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
47
105
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
106
|
+
case 'chat': {
|
|
107
|
+
const hasInstructionsField = 'instructions' in sub.fields;
|
|
108
|
+
const instructions = sub.fields.instructions;
|
|
109
|
+
if (!hasInstructionsField) {
|
|
110
|
+
errors.push({
|
|
111
|
+
file,
|
|
112
|
+
line: sub.line,
|
|
113
|
+
message: 'Chat segment missing instructions:: field',
|
|
114
|
+
suggestion: "Add 'instructions:: Your instructions here' to the chat segment",
|
|
115
|
+
severity: 'error',
|
|
116
|
+
});
|
|
117
|
+
break;
|
|
57
118
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
119
|
+
if (!instructions || instructions.trim() === '') {
|
|
120
|
+
errors.push({
|
|
121
|
+
file,
|
|
122
|
+
line: sub.line,
|
|
123
|
+
message: 'Chat segment has empty instructions:: field',
|
|
124
|
+
suggestion: 'Add instructions text after instructions::',
|
|
125
|
+
severity: 'warning',
|
|
126
|
+
});
|
|
66
127
|
}
|
|
128
|
+
const segment = {
|
|
129
|
+
type: 'chat',
|
|
130
|
+
instructions: instructions || '',
|
|
131
|
+
hidePreviousContentFromUser: sub.fields.hidePreviousContentFromUser?.toLowerCase() === 'true' ? true : undefined,
|
|
132
|
+
hidePreviousContentFromTutor: sub.fields.hidePreviousContentFromTutor?.toLowerCase() === 'true' ? true : undefined,
|
|
133
|
+
};
|
|
134
|
+
segments.push(segment);
|
|
135
|
+
break;
|
|
67
136
|
}
|
|
68
137
|
}
|
|
69
138
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
139
|
+
return { segments, errors };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Parse ## Text and ## Chat subsections from within a Page section body.
|
|
143
|
+
* Reports errors for unknown ## headers and missing required fields.
|
|
144
|
+
*
|
|
145
|
+
* @param body - The body text of a # Page: section
|
|
146
|
+
* @param file - File path for error reporting
|
|
147
|
+
* @param baseLineNum - Line number offset (body's position within the file)
|
|
148
|
+
* @returns Segment objects (TextSegment | ChatSegment) and any errors
|
|
149
|
+
*/
|
|
150
|
+
export function parsePageSegments(body, file = '', baseLineNum = 0) {
|
|
151
|
+
const errors = [];
|
|
152
|
+
const { subsections, unknownHeaders, warnings } = collectRawSubsections(body, baseLineNum);
|
|
153
|
+
// Forward free-text warnings with file path
|
|
154
|
+
for (const w of warnings) {
|
|
155
|
+
errors.push({ ...w, file });
|
|
156
|
+
}
|
|
157
|
+
// Report unknown headers
|
|
158
|
+
for (const unk of unknownHeaders) {
|
|
159
|
+
const capitalized = [...VALID_PAGE_SUBSECTION_TYPES].map(t => t[0].toUpperCase() + t.slice(1));
|
|
160
|
+
errors.push({
|
|
161
|
+
file,
|
|
162
|
+
line: unk.line,
|
|
163
|
+
message: `Unknown section type: ${unk.rawType}`,
|
|
164
|
+
suggestion: `Valid types: ${capitalized.join(', ')}`,
|
|
165
|
+
severity: 'error',
|
|
166
|
+
});
|
|
73
167
|
}
|
|
74
|
-
|
|
168
|
+
const result = convertSubsections(subsections, file);
|
|
169
|
+
errors.push(...result.errors);
|
|
170
|
+
return { segments: result.segments, errors };
|
|
75
171
|
}
|
|
76
172
|
export function parseModule(content, file) {
|
|
77
173
|
const errors = [];
|
|
@@ -82,26 +178,17 @@ export function parseModule(content, file) {
|
|
|
82
178
|
return { module: null, errors };
|
|
83
179
|
}
|
|
84
180
|
const { frontmatter, body, bodyStartLine } = frontmatterResult;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (!frontmatter.title) {
|
|
96
|
-
errors.push({
|
|
97
|
-
file,
|
|
98
|
-
line: 2,
|
|
99
|
-
message: 'Missing required field: title',
|
|
100
|
-
suggestion: "Add 'title: Your Module Title' to frontmatter",
|
|
101
|
-
severity: 'error',
|
|
102
|
-
});
|
|
181
|
+
const frontmatterErrors = validateFrontmatter(frontmatter, 'module', file);
|
|
182
|
+
errors.push(...frontmatterErrors);
|
|
183
|
+
// Module-specific: validate slug format (only if slug is present and non-empty)
|
|
184
|
+
const slug = frontmatter.slug;
|
|
185
|
+
if (typeof slug === 'string' && slug.trim() !== '') {
|
|
186
|
+
const slugFormatError = validateSlugFormat(slug, file, 2);
|
|
187
|
+
if (slugFormatError) {
|
|
188
|
+
errors.push(slugFormatError);
|
|
189
|
+
}
|
|
103
190
|
}
|
|
104
|
-
if (errors.
|
|
191
|
+
if (errors.some(e => e.severity === 'error')) {
|
|
105
192
|
return { module: null, errors };
|
|
106
193
|
}
|
|
107
194
|
// Parse sections (H1 headers for module files)
|
|
@@ -116,6 +203,15 @@ export function parseModule(content, file) {
|
|
|
116
203
|
for (const section of sectionsResult.sections) {
|
|
117
204
|
section.line += bodyStartLine - 1;
|
|
118
205
|
}
|
|
206
|
+
if (sectionsResult.sections.length === 0) {
|
|
207
|
+
errors.push({
|
|
208
|
+
file,
|
|
209
|
+
line: bodyStartLine,
|
|
210
|
+
message: 'Module has no sections',
|
|
211
|
+
suggestion: "Add sections like '# Page:', '# Learning Outcome:', or '# Uncategorized:'",
|
|
212
|
+
severity: 'warning',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
119
215
|
const module = {
|
|
120
216
|
slug: frontmatter.slug,
|
|
121
217
|
title: frontmatter.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/parser/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAsB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/parser/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAsB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAO3E,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAQ9D;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,IAAY,EACZ,WAAmB;IAEnB,MAAM,WAAW,GAAoB,EAAE,CAAC;IACxC,MAAM,cAAc,GAAwC,EAAE,CAAC;IAC/D,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,OAAO,GAAyB,IAAI,CAAC;IAC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a;YACnB,OAAO,EAAE,wBAAwB;YACjC,UAAU,EAAE,2EAA2E;YACvF,QAAQ,EAAE,SAAS;SACpB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAiB;QAC3B,IAAI,EAAE,WAAW,CAAC,IAAc;QAChC,KAAK,EAAE,WAAW,CAAC,KAAe;QAClC,uEAAuE;QACvE,SAAS,EAAG,WAAW,CAAC,SAAoB,IAAK,WAAW,CAAC,EAAa,IAAI,IAAI;QAClF,QAAQ,EAAE,cAAc,CAAC,QAAQ;KAClC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/parser/sections.js
CHANGED
|
@@ -1,29 +1,50 @@
|
|
|
1
|
+
import { ALL_KNOWN_FIELDS } from '../content-schema.js';
|
|
2
|
+
import { levenshtein } from '../validator/field-typos.js';
|
|
1
3
|
// Valid section types per file type (exported for use by other parsers)
|
|
2
4
|
export const MODULE_SECTION_TYPES = new Set(['learning outcome', 'page', 'uncategorized']);
|
|
3
5
|
export const LO_SECTION_TYPES = new Set(['lens', 'test']);
|
|
4
|
-
// Lens sections: input headers are `### Article:`, `### Video:`, `###
|
|
5
|
-
// Output types are `lens-article`, `lens-video`, `
|
|
6
|
-
export const LENS_SECTION_TYPES = new Set(['
|
|
6
|
+
// Lens sections: input headers are `### Article:`, `### Video:`, `### Page:`
|
|
7
|
+
// Output types are `lens-article`, `lens-video`, `page` (v2 format)
|
|
8
|
+
export const LENS_SECTION_TYPES = new Set(['page', 'article', 'video']);
|
|
9
|
+
// All known structural header types (sections + segments) for markdown heading detection
|
|
10
|
+
const ALL_STRUCTURAL_TYPES = new Set([
|
|
11
|
+
// Section types
|
|
12
|
+
'learning outcome', 'page', 'uncategorized', 'lens', 'test', 'module', 'meeting', 'article', 'video',
|
|
13
|
+
// Segment types
|
|
14
|
+
'text', 'chat', 'article-excerpt', 'video-excerpt', 'question',
|
|
15
|
+
]);
|
|
16
|
+
// Fields that commonly contain markdown with headings
|
|
17
|
+
const MARKDOWN_CONTENT_FIELDS = new Set(['content', 'instructions']);
|
|
7
18
|
// Map input section names to output types for Lens files
|
|
8
19
|
export const LENS_OUTPUT_TYPE = {
|
|
9
|
-
'
|
|
20
|
+
'page': 'page',
|
|
10
21
|
'article': 'lens-article',
|
|
11
22
|
'video': 'lens-video',
|
|
12
23
|
};
|
|
13
24
|
// Header pattern is parameterized by level (1-4)
|
|
14
25
|
function makeSectionPattern(level) {
|
|
15
26
|
const hashes = '#'.repeat(level);
|
|
16
|
-
// Match: ^#{level} <type>: <title
|
|
17
|
-
// Captures: group 1 = type, group 2 = title
|
|
18
|
-
return new RegExp(`^${hashes}\\s+([^:]
|
|
27
|
+
// Match: ^#{level} <type> OR ^#{level} <type>: <optional title>
|
|
28
|
+
// Captures: group 1 = type, group 2 = title (may be undefined)
|
|
29
|
+
return new RegExp(`^${hashes}\\s+([^:]+?)(?::\\s*(.*))?$`, 'i');
|
|
19
30
|
}
|
|
31
|
+
// Note: unrecognized headers are now caught by makeSectionPattern matching all
|
|
32
|
+
// ### headers, with unknown types reported as "Unknown section type" errors.
|
|
20
33
|
export function parseSections(content, headerLevel, validTypes, file = '') {
|
|
21
34
|
const SECTION_HEADER_PATTERN = makeSectionPattern(headerLevel);
|
|
35
|
+
// Build patterns for adjacent levels to detect wrong heading level
|
|
36
|
+
const wrongLevelPatterns = [];
|
|
37
|
+
for (const adjLevel of [headerLevel - 1, headerLevel + 1]) {
|
|
38
|
+
if (adjLevel >= 1 && adjLevel <= 4) {
|
|
39
|
+
wrongLevelPatterns.push({ pattern: makeSectionPattern(adjLevel), level: adjLevel });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
22
42
|
const lines = content.split('\n');
|
|
23
43
|
const sections = [];
|
|
24
44
|
const errors = [];
|
|
25
45
|
let currentSection = null;
|
|
26
46
|
let currentBody = [];
|
|
47
|
+
let preHeaderWarned = false;
|
|
27
48
|
for (let i = 0; i < lines.length; i++) {
|
|
28
49
|
const line = lines[i];
|
|
29
50
|
const lineNum = i + 1;
|
|
@@ -38,13 +59,14 @@ export function parseSections(content, headerLevel, validTypes, file = '') {
|
|
|
38
59
|
}
|
|
39
60
|
const rawType = headerMatch[1].trim();
|
|
40
61
|
const normalizedType = rawType.toLowerCase();
|
|
41
|
-
const title = headerMatch[2].trim();
|
|
62
|
+
const title = (headerMatch[2] ?? '').trim();
|
|
42
63
|
if (!validTypes.has(normalizedType)) {
|
|
64
|
+
const capitalized = [...validTypes].map(t => t.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join(' '));
|
|
43
65
|
errors.push({
|
|
44
66
|
file,
|
|
45
67
|
line: lineNum,
|
|
46
68
|
message: `Unknown section type: ${rawType}`,
|
|
47
|
-
suggestion: `Valid types: ${
|
|
69
|
+
suggestion: `Valid types: ${capitalized.join(', ')}`,
|
|
48
70
|
severity: 'error',
|
|
49
71
|
});
|
|
50
72
|
}
|
|
@@ -58,8 +80,42 @@ export function parseSections(content, headerLevel, validTypes, file = '') {
|
|
|
58
80
|
};
|
|
59
81
|
currentBody = [];
|
|
60
82
|
}
|
|
61
|
-
else
|
|
62
|
-
|
|
83
|
+
else {
|
|
84
|
+
if (currentSection) {
|
|
85
|
+
currentBody.push(line);
|
|
86
|
+
}
|
|
87
|
+
else if (!currentSection) {
|
|
88
|
+
// Check for headers at wrong level that match known section types
|
|
89
|
+
for (const { pattern, level } of wrongLevelPatterns) {
|
|
90
|
+
const wrongMatch = line.match(pattern);
|
|
91
|
+
if (wrongMatch) {
|
|
92
|
+
const rawType = wrongMatch[1].trim();
|
|
93
|
+
if (validTypes.has(rawType.toLowerCase())) {
|
|
94
|
+
const expected = '#'.repeat(headerLevel);
|
|
95
|
+
const actual = '#'.repeat(level);
|
|
96
|
+
errors.push({
|
|
97
|
+
file,
|
|
98
|
+
line: lineNum,
|
|
99
|
+
message: `Found '${actual} ${rawType}:' (heading level ${level}) but expected heading level ${headerLevel} (${expected} ${rawType}:)`,
|
|
100
|
+
suggestion: `Change '${actual}' to '${expected}'`,
|
|
101
|
+
severity: 'warning',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!currentSection && line.trim() && !preHeaderWarned) {
|
|
109
|
+
// Non-blank content before any section header — will be silently lost
|
|
110
|
+
preHeaderWarned = true;
|
|
111
|
+
errors.push({
|
|
112
|
+
file,
|
|
113
|
+
line: lineNum,
|
|
114
|
+
message: 'Content found before first section header — this text will be ignored',
|
|
115
|
+
suggestion: 'Move this text into a section, or remove it',
|
|
116
|
+
severity: 'warning',
|
|
117
|
+
});
|
|
118
|
+
}
|
|
63
119
|
}
|
|
64
120
|
}
|
|
65
121
|
// Don't forget last section
|
|
@@ -71,18 +127,39 @@ export function parseSections(content, headerLevel, validTypes, file = '') {
|
|
|
71
127
|
}
|
|
72
128
|
return { sections, errors };
|
|
73
129
|
}
|
|
74
|
-
const FIELD_PATTERN = /^(\w+)::\s*(.*)$/;
|
|
130
|
+
const FIELD_PATTERN = /^([\w-]+)::\s*(.*)$/;
|
|
75
131
|
function parseFields(section, file) {
|
|
76
132
|
const lines = section.body.split('\n');
|
|
77
133
|
const warnings = [];
|
|
78
134
|
const seenFields = new Set();
|
|
79
135
|
let currentField = null;
|
|
80
136
|
let currentValue = [];
|
|
137
|
+
let freeTextWarned = false;
|
|
81
138
|
for (let i = 0; i < lines.length; i++) {
|
|
82
139
|
const line = lines[i];
|
|
83
140
|
const lineNum = section.line + i + 1; // +1 because body starts after header
|
|
84
141
|
// Check for sub-header first - starts a new scope for field tracking
|
|
85
|
-
|
|
142
|
+
const headerMatch = line.match(/^(#{1,6})\s+(.*)$/);
|
|
143
|
+
if (headerMatch) {
|
|
144
|
+
// Before resetting, check if this looks like a markdown heading
|
|
145
|
+
// inside a content/instructions field (not a structural header)
|
|
146
|
+
if (currentField && MARKDOWN_CONTENT_FIELDS.has(currentField)) {
|
|
147
|
+
const headingText = headerMatch[2].trim();
|
|
148
|
+
// Extract type word: "Text", "Chat: title", "Article-excerpt" etc.
|
|
149
|
+
const typeWord = headingText.replace(/:.*$/, '').trim().toLowerCase();
|
|
150
|
+
// Also check if it's a typo of a structural type (levenshtein ≤ 2)
|
|
151
|
+
const isTypoOfStructural = [...ALL_STRUCTURAL_TYPES].some(st => levenshtein(typeWord, st) <= 2);
|
|
152
|
+
if (!ALL_STRUCTURAL_TYPES.has(typeWord) && !isTypoOfStructural) {
|
|
153
|
+
const hashes = headerMatch[1];
|
|
154
|
+
warnings.push({
|
|
155
|
+
file,
|
|
156
|
+
line: lineNum,
|
|
157
|
+
message: `'${hashes} ${headingText}' looks like a Markdown heading inside ${currentField}:: field`,
|
|
158
|
+
suggestion: `Escape it as '!${hashes} ${headingText}' so it's treated as content, not a section boundary`,
|
|
159
|
+
severity: 'warning',
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
86
163
|
// Save current field if any
|
|
87
164
|
if (currentField) {
|
|
88
165
|
section.fields[currentField] = currentValue.join('\n').trim();
|
|
@@ -91,6 +168,7 @@ function parseFields(section, file) {
|
|
|
91
168
|
}
|
|
92
169
|
// Reset seenFields for the new sub-section scope
|
|
93
170
|
seenFields.clear();
|
|
171
|
+
freeTextWarned = false;
|
|
94
172
|
continue;
|
|
95
173
|
}
|
|
96
174
|
const match = line.match(FIELD_PATTERN);
|
|
@@ -118,6 +196,31 @@ function parseFields(section, file) {
|
|
|
118
196
|
// Continue multiline value
|
|
119
197
|
currentValue.push(line);
|
|
120
198
|
}
|
|
199
|
+
else {
|
|
200
|
+
// Not inside a field — check for single-colon that should be double-colon
|
|
201
|
+
// Only suggest field:: if the word is a known field name
|
|
202
|
+
const singleColonMatch = line.match(/^(\w+):\s+(.*)$/);
|
|
203
|
+
if (singleColonMatch && !line.match(/^https?:/) && ALL_KNOWN_FIELDS.includes(singleColonMatch[1])) {
|
|
204
|
+
warnings.push({
|
|
205
|
+
file,
|
|
206
|
+
line: lineNum,
|
|
207
|
+
message: `Found '${singleColonMatch[1]}:' with single colon — did you mean '${singleColonMatch[1]}::'?`,
|
|
208
|
+
suggestion: `Change '${singleColonMatch[1]}:' to '${singleColonMatch[1]}::' (double colon)`,
|
|
209
|
+
severity: 'warning',
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
else if (line.trim() && !freeTextWarned) {
|
|
213
|
+
freeTextWarned = true;
|
|
214
|
+
const preview = line.trim().length > 60 ? line.trim().slice(0, 60) + '...' : line.trim();
|
|
215
|
+
warnings.push({
|
|
216
|
+
file,
|
|
217
|
+
line: lineNum,
|
|
218
|
+
message: `Text outside of a field:: definition will be ignored: "${preview}"`,
|
|
219
|
+
suggestion: 'Place this text inside a field (e.g., content:: your text), or remove it',
|
|
220
|
+
severity: 'warning',
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
121
224
|
}
|
|
122
225
|
// Save final field
|
|
123
226
|
if (currentField) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/parser/sections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/parser/sections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAgB1D,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1D,6EAA6E;AAC7E,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC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AAI,EAAE,CAAC;gBACzF,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI;oBACJ,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,0DAA0D,OAAO,GAAG;oBAC7E,UAAU,EAAE,0EAA0E;oBACtF,QAAQ,EAAE,SAAS;iBACpB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,mBAAmB;IACnB,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ContentError } from '../index.js';
|
|
2
|
+
export interface ParsedVideoTranscript {
|
|
3
|
+
title: string;
|
|
4
|
+
channel: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
export interface VideoTranscriptParseResult {
|
|
8
|
+
transcript: ParsedVideoTranscript | null;
|
|
9
|
+
errors: ContentError[];
|
|
10
|
+
}
|
|
11
|
+
export declare function parseVideoTranscript(content: string, file: string): VideoTranscriptParseResult;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { parseFrontmatter } from './frontmatter.js';
|
|
2
|
+
import { validateFrontmatter } from '../validator/validate-frontmatter.js';
|
|
3
|
+
export function parseVideoTranscript(content, file) {
|
|
4
|
+
const errors = [];
|
|
5
|
+
const frontmatterResult = parseFrontmatter(content, file);
|
|
6
|
+
if (frontmatterResult.error) {
|
|
7
|
+
errors.push(frontmatterResult.error);
|
|
8
|
+
return { transcript: null, errors };
|
|
9
|
+
}
|
|
10
|
+
const { frontmatter } = frontmatterResult;
|
|
11
|
+
// Validate frontmatter against schema (typo detection + required fields)
|
|
12
|
+
const frontmatterErrors = validateFrontmatter(frontmatter, 'video-transcript', file);
|
|
13
|
+
errors.push(...frontmatterErrors);
|
|
14
|
+
const hasRequiredError = frontmatterErrors.some(e => e.severity === 'error');
|
|
15
|
+
if (hasRequiredError) {
|
|
16
|
+
return { transcript: null, errors };
|
|
17
|
+
}
|
|
18
|
+
// Check text fields for wikilinks (not url — that's a URL)
|
|
19
|
+
const textFields = ['title', 'channel'];
|
|
20
|
+
for (const field of textFields) {
|
|
21
|
+
const value = String(frontmatter[field]);
|
|
22
|
+
if (/\[\[.+?\]\]/.test(value)) {
|
|
23
|
+
errors.push({
|
|
24
|
+
file,
|
|
25
|
+
line: 2,
|
|
26
|
+
message: `Field '${field}' contains a wikilink — use plain text`,
|
|
27
|
+
suggestion: `Remove [[...]] from '${field}'`,
|
|
28
|
+
severity: 'error',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const transcript = {
|
|
33
|
+
title: String(frontmatter.title),
|
|
34
|
+
channel: String(frontmatter.channel),
|
|
35
|
+
url: String(frontmatter.url),
|
|
36
|
+
};
|
|
37
|
+
return { transcript, errors };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=video-transcript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-transcript.js","sourceRoot":"","sources":["../../src/parser/video-transcript.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAa3E,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,IAAY;IAChE,MAAM,MAAM,GAAmB,EAAE,CAAC;IAElC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1D,IAAI,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACtC,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
|
3
3
|
display?: string;
|
|
4
4
|
isEmbed?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
correctedPath?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare function parseWikilink(text: string): WikilinkParts | null;
|
|
7
9
|
export declare function resolveWikilinkPath(linkPath: string, sourceFile: string): string;
|