@podlite/publisher 0.0.50 → 0.0.52
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/CHANGELOG.podlite +25 -0
- package/esm/dump-pages-plugin.js +2 -2
- package/esm/images-plugin.js +2 -2
- package/esm/include-resolve-plugin.js +64 -7
- package/esm/include-resolve-plugin.js.map +1 -1
- package/esm/index.js +3 -3
- package/esm/links-plugin.js +1 -1
- package/esm/node-utils.d.ts +2 -1
- package/esm/node-utils.js +24 -9
- package/esm/node-utils.js.map +1 -1
- package/esm/node.js +2 -2
- package/esm/prev-next-plugin.js +1 -1
- package/esm/pubdate-plugin.js +9 -7
- package/esm/pubdate-plugin.js.map +1 -1
- package/esm/react-plugin.js +3 -3
- package/esm/record.d.ts +2 -0
- package/esm/record.js +1 -0
- package/esm/record.js.map +1 -1
- package/esm/site-data-plugin.js +3 -3
- package/esm/source.d.ts +13 -0
- package/esm/source.js +58 -0
- package/esm/source.js.map +1 -0
- package/esm/state-version-plugin.js +1 -1
- package/esm/terms-index-plugin.js +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/include-resolve-plugin.js +63 -6
- package/lib/node-utils.d.ts +2 -1
- package/lib/node-utils.js +28 -12
- package/lib/pubdate-plugin.js +7 -5
- package/lib/record.d.ts +2 -0
- package/lib/record.js +5 -1
- package/lib/source.d.ts +13 -0
- package/lib/source.js +66 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.podlite
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
=head1 Upcoming
|
|
4
4
|
|
|
5
|
+
=head1 0.0.52
|
|
6
|
+
|
|
7
|
+
=item a record keeps the text it was read from: C<recordSource> returns the text, the file name and the type given for it, C<recordOrigin> returns the same for a record the pubdate plugin cut out of a file, and C<isParsedTree> tells whether the tree is still the one that was parsed. C<parseText> parses a given text as a file of that name is read. The source is held under a symbol key, so it is absent from JSON and from C<Object.keys>, and present when a record is printed or compared deeply
|
|
8
|
+
|
|
9
|
+
=item on the first block an C<=include> brings, a C<=set> of the included file wins over a C<=set> written before the include for the same key; the one before the include won
|
|
10
|
+
|
|
11
|
+
=item a C<=set> written before C<=include> reaches the first block the include places, and the record the block comes from is left unchanged; the block after the include received it. When the include fails, the warning names the assignment it lost. When it places no block, or its first block is an include inside what was placed, a warning says the assignment has no target. An include whose selector cannot be read, or whose scheme is neither C<doc:> nor C<file:>, says so; it was reported as not found
|
|
12
|
+
|
|
13
|
+
=item C<=include> whose source or address does not resolve is left in place with one warning; it gave two. An address is found by the text of a heading as well as by C<:id>
|
|
14
|
+
|
|
15
|
+
=item C<=include> places a found block once: a block inside another found block comes with it and is not placed again
|
|
16
|
+
|
|
17
|
+
=item an include whose selector has an operand of C<in> that does not resolve is left in place with a warning, rather than stopping the run
|
|
18
|
+
|
|
19
|
+
=head1 0.0.51
|
|
20
|
+
|
|
21
|
+
=item the C<./node> entry can be reached with C<import> as well. Its ESM build called C<require>, which a module does not have, so loading it died on the first line
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
=item declare C<glob> as a runtime dependency, so that C<< require('@podlite/publisher/node') >> loads where the package is installed on its own. It was declared for development only, and worked until now because something else happened to install it.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
=item the package needs Node 20.19 or newer. Its ESM build relies on the loader recognising module syntax in a .js file, which older versions do not do
|
|
28
|
+
|
|
29
|
+
|
|
5
30
|
=head1 0.0.50
|
|
6
31
|
|
|
7
32
|
=item the record contract, its types and the entry-or-page predicate, moved into its own module and is reachable as C<@podlite/publisher/record>
|
package/esm/dump-pages-plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BUILT_PATH } from './constants';
|
|
1
|
+
import { BUILT_PATH } from './constants.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
|
-
import { streamWriteLines } from './node-utils';
|
|
3
|
+
import { streamWriteLines } from './node-utils.js';
|
|
4
4
|
// named fields only: leaving out the heavy ones by name lets the next heavy
|
|
5
5
|
// field slip in unnoticed, and one of them held 99 per cent of the weight
|
|
6
6
|
export const buildPagesIndex = (records, places, indexFields = []) => records.map((r, i) => ({
|
package/esm/images-plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { makeInterator } from '@podlite/schema';
|
|
2
|
-
import { ASSETS_PATH, IMAGE_LIB } from './constants';
|
|
2
|
+
import { ASSETS_PATH, IMAGE_LIB } from './constants.js';
|
|
3
3
|
import pathMod from 'path';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
|
-
import { getPathToOpen } from './node-utils';
|
|
5
|
+
import { getPathToOpen } from './node-utils.js';
|
|
6
6
|
const ORIENTATION_TAG = 0x0112;
|
|
7
7
|
export const readOrientation = (file) => {
|
|
8
8
|
let bytes;
|
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
import { getTextContentFromNode, makeInterator } from '@podlite/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { applySetToFirst, outermost, SelectorError } from '@podlite/schema';
|
|
3
|
+
import { parseSelector, runSelector } from './shared.js';
|
|
4
|
+
// A selector whose source, address or operand does not resolve brings nothing
|
|
5
|
+
// in, and says so once, naming the =set assignments lost with it.
|
|
6
|
+
const select = (selector, recs, lost = '') => {
|
|
7
|
+
// a selector that is not read, or a scheme not resolved here, finds nothing
|
|
8
|
+
// without saying why
|
|
9
|
+
const parsed = parseSelector(selector);
|
|
10
|
+
if (!parsed) {
|
|
11
|
+
console.warn(`[plugin: resolve ] selector ${selector} cannot be read${lost}`);
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (parsed.scheme && parsed.scheme !== 'doc' && parsed.scheme !== 'file') {
|
|
15
|
+
console.warn(`[plugin: resolve ] selector ${selector}: scheme ${parsed.scheme}: is not supported${lost}`);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
return runSelector(selector, recs);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
if (!(e instanceof SelectorError))
|
|
23
|
+
throw e;
|
|
24
|
+
console.warn(`[plugin: resolve ] selector ${selector} cannot be read: ${e.message}${lost}`);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const names = (set) => set.map(c => c.name).join(', ');
|
|
29
|
+
// The =set assignments written before an include go to the first block it
|
|
30
|
+
// brings; once placed or lost, the directive no longer carries them. When the
|
|
31
|
+
// include brings no block they stay without a target: carrying them on to the
|
|
32
|
+
// next block is not done here, nor through an include inside what was brought.
|
|
33
|
+
const assignments = (node) => {
|
|
34
|
+
const set = node.set || [];
|
|
35
|
+
const { set: _, ...rest } = node;
|
|
36
|
+
const lost = set.length ? `; =set assignments not applied: ${names(set)}` : '';
|
|
37
|
+
const place = (blocks) => {
|
|
38
|
+
if (!set.length)
|
|
39
|
+
return blocks;
|
|
40
|
+
const applied = applySetToFirst(blocks, set, { mode: 'include' });
|
|
41
|
+
if (applied.outcome !== 'block') {
|
|
42
|
+
console.warn(`[plugin: resolve ] =set before =include has no target block: ${names(set)}`);
|
|
43
|
+
}
|
|
44
|
+
return applied.outcome === 'block' ? applied.nodes : blocks;
|
|
45
|
+
};
|
|
46
|
+
return { node: rest, lost, place };
|
|
47
|
+
};
|
|
3
48
|
const plugin = () => {
|
|
4
49
|
const outCtx = {};
|
|
5
50
|
const docsMap = new Map();
|
|
@@ -7,29 +52,37 @@ const plugin = () => {
|
|
|
7
52
|
const processNode = (node, recs) => {
|
|
8
53
|
const rules = {
|
|
9
54
|
// TODO: remove 'Include' due to duplicate to 'include'
|
|
10
|
-
Include:
|
|
55
|
+
Include: written => {
|
|
56
|
+
const { node, lost, place } = assignments(written);
|
|
11
57
|
const { content } = node;
|
|
12
58
|
const selector = getTextContentFromNode(content).trim();
|
|
13
59
|
console.warn(`[include] start resolve selector: ${selector}`);
|
|
14
60
|
if (selector) {
|
|
15
61
|
// try to resolve selector
|
|
16
|
-
const
|
|
62
|
+
const result = select(selector, recs, lost);
|
|
63
|
+
if (!result)
|
|
64
|
+
return node;
|
|
65
|
+
const [block] = result;
|
|
17
66
|
if (typeof block === 'object' && !('file' in block)) {
|
|
18
|
-
const updated = { content: block };
|
|
67
|
+
const updated = { content: place([block])[0] };
|
|
19
68
|
return { ...node, ...updated };
|
|
20
69
|
}
|
|
21
70
|
if (!block) {
|
|
22
71
|
console.warn(`[plugin: resolve ] selector ${selector} not found`);
|
|
72
|
+
place([]);
|
|
23
73
|
}
|
|
24
74
|
}
|
|
25
75
|
return node;
|
|
26
76
|
},
|
|
27
|
-
include:
|
|
77
|
+
include: written => {
|
|
78
|
+
const { node, lost, place } = assignments(written);
|
|
28
79
|
const { content } = node;
|
|
29
80
|
const selector = getTextContentFromNode(content).trim();
|
|
30
81
|
console.warn(`[include] start resolve selector: ${selector}`);
|
|
31
82
|
if (selector) {
|
|
32
|
-
const result =
|
|
83
|
+
const result = select(selector, recs, lost);
|
|
84
|
+
if (!result)
|
|
85
|
+
return node;
|
|
33
86
|
const blocks = [];
|
|
34
87
|
for (const item of result) {
|
|
35
88
|
if (typeof item === 'object' && item !== null && !('file' in item)) {
|
|
@@ -37,9 +90,13 @@ const plugin = () => {
|
|
|
37
90
|
}
|
|
38
91
|
}
|
|
39
92
|
if (blocks.length > 0) {
|
|
40
|
-
return { ...node, content: blocks };
|
|
93
|
+
return { ...node, content: place(outermost(blocks)) };
|
|
41
94
|
}
|
|
42
95
|
console.warn(`[plugin: resolve ] selector ${selector} not found`);
|
|
96
|
+
place([]);
|
|
97
|
+
}
|
|
98
|
+
else if (lost) {
|
|
99
|
+
console.warn(`[plugin: resolve ] include selector cannot be read: (empty)${lost}`);
|
|
43
100
|
}
|
|
44
101
|
return node;
|
|
45
102
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include-resolve-plugin.js","sourceRoot":"","sources":["../src/include-resolve-plugin.ts"],"names":[],"mappings":"AAAA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CAAC,8DAA8D,IAAI,EAAE,CAAC,CAAA;gBACpF,CAAC;gBACD,OAAO,IAAI,CAAA;YACb,CAAC;SACF,CAAA;QACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACvC,CAAC,CAAA;IACD,MAAM,SAAS,GAAG,CAAC,IAAqB,EAAE,EAAE;QAC1C,yCAAyC;QACzC,MAAM,wBAAwB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC/C,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YACzC,2BAA2B;YAC3B,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAA;QAC1B,CAAC,CAAC,CAAA;QAEF,OAAO,wBAAwB,CAAA;IACjC,CAAC,CAAA;IAED,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC,CAAA;AACD,eAAe,MAAM,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './record';
|
|
2
|
-
export * from './plugins';
|
|
3
|
-
export * from './shared';
|
|
1
|
+
export * from './record.js';
|
|
2
|
+
export * from './plugins.js';
|
|
3
|
+
export * from './shared.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/esm/links-plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTextContentFromNode, makeAttrs, makeInterator } from '@podlite/schema';
|
|
2
|
-
import { convertFileLinksToUrl, getPathToOpen } from './node-utils';
|
|
2
|
+
import { convertFileLinksToUrl, getPathToOpen } from './node-utils.js';
|
|
3
3
|
const plugin = () => {
|
|
4
4
|
const outCtx = {};
|
|
5
5
|
const docsMap = new Map();
|
package/esm/node-utils.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ declare const MIME_TYPES_EXTENSIONS: {
|
|
|
22
22
|
'audio/mpeg': readonly [".mp3"];
|
|
23
23
|
};
|
|
24
24
|
type PartserTypes = typeof PARSER_TYPES[keyof typeof PARSER_TYPES];
|
|
25
|
-
type MimeTypes = keyof typeof MIME_TYPES_EXTENSIONS;
|
|
25
|
+
export type MimeTypes = keyof typeof MIME_TYPES_EXTENSIONS;
|
|
26
26
|
export declare function getParserTypeforFile(filePath: string, mime?: MimeTypes): PartserTypes;
|
|
27
|
+
export declare function parseText(filePath: string, text: string, mime?: MimeTypes): RootBlock;
|
|
27
28
|
export declare function parseFile(filePath: string, fileContent?: string, mime?: MimeTypes): RootBlock;
|
|
28
29
|
export declare function getDocumentAttributes(node: PodliteDocument, filePath?: string): {
|
|
29
30
|
header: any;
|
package/esm/node-utils.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { getFromTree, getTextContentFromNode, makeAttrs, makeInterator, } from '@podlite/schema';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import
|
|
4
|
+
import glob from 'glob';
|
|
5
|
+
import { getAllArticles, isExistsPubdate, makeAstFromSrc } from './shared.js';
|
|
5
6
|
import { parseMd } from '@podlite/markdown';
|
|
6
7
|
import { podlite } from 'podlite';
|
|
7
8
|
import matter from 'gray-matter';
|
|
8
|
-
|
|
9
|
+
import { withSource } from './source.js';
|
|
9
10
|
export const getPathToOpen = (filepath, parentDocPath) => {
|
|
10
11
|
const isRemoteReg = new RegExp(/^(https?|ftp):/);
|
|
11
12
|
const isRemote = isRemoteReg.test(filepath);
|
|
12
13
|
if (isRemote) {
|
|
13
14
|
return { isRemote, path: filepath };
|
|
14
15
|
}
|
|
15
|
-
const path = require('path');
|
|
16
16
|
const docDirPath = path.dirname(parentDocPath);
|
|
17
17
|
return {
|
|
18
18
|
isRemote,
|
|
@@ -164,7 +164,18 @@ export function getParserTypeforFile(filePath, mime) {
|
|
|
164
164
|
};
|
|
165
165
|
return parserTypeMap[ext] || PARSER_TYPES.DEFAULT;
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
/*
|
|
168
|
+
=begin pod :kind<export>
|
|
169
|
+
|
|
170
|
+
=head2 parseText
|
|
171
|
+
|
|
172
|
+
Parses a text the way a file of that name is read: the type comes from C<mime>,
|
|
173
|
+
else from the extension. The text is taken as given, an empty one included, and
|
|
174
|
+
nothing is read from disk.
|
|
175
|
+
|
|
176
|
+
=end pod
|
|
177
|
+
*/
|
|
178
|
+
export function parseText(filePath, text, mime) {
|
|
168
179
|
// check extension of file and parse it deepnds on mime type
|
|
169
180
|
const parser_type = getParserTypeforFile(filePath, mime);
|
|
170
181
|
const typeToParserMap = {
|
|
@@ -184,8 +195,10 @@ export function parseFile(filePath, fileContent, mime) {
|
|
|
184
195
|
return podlite_processor.toAstResult(tree).interator;
|
|
185
196
|
},
|
|
186
197
|
};
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
return typeToParserMap[parser_type](text);
|
|
199
|
+
}
|
|
200
|
+
export function parseFile(filePath, fileContent, mime) {
|
|
201
|
+
return parseText(filePath, fileContent || fs.readFileSync(filePath).toString(), mime);
|
|
189
202
|
}
|
|
190
203
|
// An address written without quotes is cut into a list at every space, and only
|
|
191
204
|
// its first word reaches the page. The page then lands on a short address, or on
|
|
@@ -320,13 +333,14 @@ export function getPublishAttributes(node, filePath) {
|
|
|
320
333
|
return props;
|
|
321
334
|
}
|
|
322
335
|
export function processFile(f, content, mime) {
|
|
323
|
-
const
|
|
336
|
+
const text = content || fs.readFileSync(f).toString();
|
|
337
|
+
const podlite_document = parseText(f, text, mime);
|
|
324
338
|
// now extract some extra meta inforamtion, like pubdate, puburl
|
|
325
339
|
// markdown front matter and pod attributes reach here as different shapes
|
|
326
340
|
const attr = ((f, node) => {
|
|
327
341
|
if (getParserTypeforFile(f, mime) === PARSER_TYPES.MARKDOWN) {
|
|
328
342
|
// try to extract from markdown front matter
|
|
329
|
-
const { data } = matter(
|
|
343
|
+
const { data } = matter(text);
|
|
330
344
|
return data;
|
|
331
345
|
}
|
|
332
346
|
else {
|
|
@@ -335,7 +349,7 @@ export function processFile(f, content, mime) {
|
|
|
335
349
|
})(f, podlite_document);
|
|
336
350
|
// prepare attributes
|
|
337
351
|
const { title, description, subtitle, author, footer, puburl, pubdate, header } = attr;
|
|
338
|
-
|
|
352
|
+
const record = {
|
|
339
353
|
type: 'page',
|
|
340
354
|
isPage: attr.isPage === true || attr.type === 'page',
|
|
341
355
|
title,
|
|
@@ -350,6 +364,7 @@ export function processFile(f, content, mime) {
|
|
|
350
364
|
sources: [],
|
|
351
365
|
node: podlite_document,
|
|
352
366
|
};
|
|
367
|
+
return withSource(record, f, text, mime);
|
|
353
368
|
}
|
|
354
369
|
export function parseSources(path) {
|
|
355
370
|
let count = 0;
|
package/esm/node-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-utils.js","sourceRoot":"","sources":["../src/node-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,SAAS,EACT,aAAa,GAMd,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE;IACvD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAChD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC3C,IAAI,QAAQ,EAAE,CAAC;QAC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AC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,SAAS,GAAG,KAAK,CAAC,EAAE;YACxB,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC1B,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBACtB,WAAW,CAAC,GAAG,EAAE,CAAA;gBACjB,OAAO,CAAC,CAAC,CAAC,CAAA;gBACV,OAAM;YACR,CAAC;YAED,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACjC,MAAM,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAA;YAE5C,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,YAAY,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;YAC1C,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;YACvD,CAAC;QACH,CAAC,CAAA;QAED,SAAS,CAAC,CAAC,CAAC,CAAA;QAEZ,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACjC,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/esm/node.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './node-utils';
|
|
2
|
-
export * from './state-version-plugin';
|
|
1
|
+
export * from './node-utils.js';
|
|
2
|
+
export * from './state-version-plugin.js';
|
|
3
3
|
//# sourceMappingURL=node.js.map
|
package/esm/prev-next-plugin.js
CHANGED
package/esm/pubdate-plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getFromTree, getTextContentFromNode, makeAttrs, mkRootBlock } from '@podlite/schema';
|
|
2
|
-
import { getPublishAttributes } from './node-utils';
|
|
3
|
-
import { addUrl } from './shared';
|
|
2
|
+
import { getPublishAttributes } from './node-utils.js';
|
|
3
|
+
import { addUrl } from './shared.js';
|
|
4
|
+
import { withOrigin } from './source.js';
|
|
4
5
|
export function getArticles(item) {
|
|
5
6
|
let articles = [];
|
|
6
7
|
const { file } = item;
|
|
@@ -25,7 +26,7 @@ export function getArticles(item) {
|
|
|
25
26
|
const description = getFromTree(articleContent, 'para')[0];
|
|
26
27
|
const pubdate = makeAttrs(nodePublished, {}).getFirstValue('pubdate');
|
|
27
28
|
//TODO: use footer and header of document for generated articles
|
|
28
|
-
articles.push({
|
|
29
|
+
articles.push(withOrigin({
|
|
29
30
|
pubdate,
|
|
30
31
|
title: getTextContentFromNode(nodePublished).trim(),
|
|
31
32
|
type: 'page',
|
|
@@ -35,7 +36,7 @@ export function getArticles(item) {
|
|
|
35
36
|
node: mkRootBlock({}, articleContent),
|
|
36
37
|
description,
|
|
37
38
|
file,
|
|
38
|
-
});
|
|
39
|
+
}, item));
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -63,7 +64,7 @@ export function getNotes(item) {
|
|
|
63
64
|
? a_pubdate.replace(' ', 'T')
|
|
64
65
|
: a_pubdate;
|
|
65
66
|
//TODO: use footer and header of document for generated notes
|
|
66
|
-
return {
|
|
67
|
+
return withOrigin({
|
|
67
68
|
pubdate,
|
|
68
69
|
type: 'note',
|
|
69
70
|
isPage: false,
|
|
@@ -73,7 +74,7 @@ export function getNotes(item) {
|
|
|
73
74
|
file,
|
|
74
75
|
publishUrl: '',
|
|
75
76
|
sources: [],
|
|
76
|
-
};
|
|
77
|
+
}, item);
|
|
77
78
|
});
|
|
78
79
|
return notes;
|
|
79
80
|
}
|
|
@@ -84,7 +85,7 @@ export function getPages(item) {
|
|
|
84
85
|
.map((n) => {
|
|
85
86
|
const { title, description, puburl, pubdate, isPage } = getPublishAttributes(n);
|
|
86
87
|
//TODO: use footer and header of document for generated pages
|
|
87
|
-
|
|
88
|
+
const page = {
|
|
88
89
|
pubdate: pubdate || '',
|
|
89
90
|
type: 'page',
|
|
90
91
|
isPage,
|
|
@@ -95,6 +96,7 @@ export function getPages(item) {
|
|
|
95
96
|
publishUrl: puburl || '',
|
|
96
97
|
sources,
|
|
97
98
|
};
|
|
99
|
+
return withOrigin(page, item);
|
|
98
100
|
});
|
|
99
101
|
return pages;
|
|
100
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubdate-plugin.js","sourceRoot":"","sources":["../src/pubdate-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAA;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"pubdate-plugin.js","sourceRoot":"","sources":["../src/pubdate-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAA;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAMrC,MAAM,UAAU,WAAW,CAAC,IAAmB;IAC7C,IAAI,QAAQ,GAAoB,EAAE,CAAA;IAClC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACrB,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE;QAC3B,mBAAmB;QACnB,uDAAuD;QACvD,8BAA8B;QAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,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EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAA;QACnG,MAAM,CAAC,eAAe,GAAG,eAAe,CAAA;QACxC,yCAAyC;QACzC,IAAI,QAAQ,GAAG,iBAAiB;aAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;aAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;aACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;QAE1C,IAAI,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC9G,MAAM,wBAAwB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;QACjD,MAAM,UAAU,GAAG,CAAC,GAAG,wBAAwB,EAAE,GAAG,KAAK,CAAC,CAAA;QAC1D,OAAO,UAAU,CAAA;IACnB,CAAC,CAAA;IAED,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/esm/react-plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getTextContentFromNode, makeInterator } from '@podlite/schema';
|
|
2
|
-
import { COMPONENTS_LIB } from './constants';
|
|
2
|
+
import { COMPONENTS_LIB } from './constants.js';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
|
-
import { getPathToOpen } from './node-utils';
|
|
5
|
-
import { makeAstFromSrc } from './shared';
|
|
4
|
+
import { getPathToOpen } from './node-utils.js';
|
|
5
|
+
import { makeAstFromSrc } from './shared.js';
|
|
6
6
|
const plugin = () => {
|
|
7
7
|
const componensMap = new Map();
|
|
8
8
|
const processedNodes = new WeakSet();
|
package/esm/record.d.ts
CHANGED
package/esm/record.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { recordSource, recordOrigin, isParsedTree } from './source.js';
|
|
1
2
|
// The record's `type` cannot answer this: it says whether the address was declared
|
|
2
3
|
// or built, and it is the letter the short url is made of. Only the author can call
|
|
3
4
|
// a document a page, with :type('page'); a document with no date is not published.
|
package/esm/record.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AA0BnE,mFAAmF;AACnF,oFAAoF;AACpF,mFAAmF;AACnF,iFAAiF;AACjF,qFAAqF;AACrF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAoE,EAAW,EAAE,CACvG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA"}
|
package/esm/site-data-plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getFromTree, getTextContentFromNode, makeAttrs, makeInterator } from '@podlite/schema';
|
|
2
|
-
import { BUILT_PATH, INDEX_PATH, POSTS_PATH, PUBLIC_PATH } from './constants';
|
|
2
|
+
import { BUILT_PATH, INDEX_PATH, POSTS_PATH, PUBLIC_PATH } from './constants.js';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
|
-
import { isEntry } from './record';
|
|
5
|
-
import { processFile } from './node-utils';
|
|
4
|
+
import { isEntry } from './record.js';
|
|
5
|
+
import { processFile } from './node-utils.js';
|
|
6
6
|
import pathFs from 'path';
|
|
7
7
|
export function buildStylesContent(theme, globalStylesPath) {
|
|
8
8
|
const imports = [];
|
package/esm/source.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MimeTypes } from './node-utils';
|
|
2
|
+
export type RecordSource = {
|
|
3
|
+
readonly file: string;
|
|
4
|
+
readonly mime?: MimeTypes;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const sourceKey: unique symbol;
|
|
8
|
+
export declare const originKey: unique symbol;
|
|
9
|
+
export declare const withSource: <T extends object>(record: T, file: string, text: string, mime?: MimeTypes) => T;
|
|
10
|
+
export declare const withOrigin: <T extends object>(record: T, from: object) => T;
|
|
11
|
+
export declare const recordSource: (record: object) => RecordSource | undefined;
|
|
12
|
+
export declare const recordOrigin: (record: object) => RecordSource | undefined;
|
|
13
|
+
export declare const isParsedTree: (record: object) => boolean;
|
package/esm/source.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Symbol.for shares the key between copies of the package in one process, so the
|
|
2
|
+
// shape of the value is fixed by the number in the name
|
|
3
|
+
export const sourceKey = Symbol.for('@podlite/publisher:source/1');
|
|
4
|
+
export const originKey = Symbol.for('@podlite/publisher:origin/1');
|
|
5
|
+
// the keys stay out of the record type: a declaration that spreads a record would have to name them
|
|
6
|
+
const held = (record) => record;
|
|
7
|
+
const hold = (file, text, mime, tree) => {
|
|
8
|
+
const source = { file, ...(mime ? { mime } : {}), text, parsed: (node) => node === tree };
|
|
9
|
+
Object.defineProperty(source, 'text', { enumerable: false });
|
|
10
|
+
Object.defineProperty(source, 'parsed', { enumerable: false });
|
|
11
|
+
return Object.freeze(source);
|
|
12
|
+
};
|
|
13
|
+
export const withSource = (record, file, text, mime) => ({
|
|
14
|
+
...record,
|
|
15
|
+
[sourceKey]: hold(file, text, mime, held(record).node),
|
|
16
|
+
});
|
|
17
|
+
export const withOrigin = (record, from) => {
|
|
18
|
+
const origin = held(from)[originKey] ?? held(from)[sourceKey];
|
|
19
|
+
return origin ? { ...record, [originKey]: origin } : record;
|
|
20
|
+
};
|
|
21
|
+
/*
|
|
22
|
+
=begin pod :kind<export>
|
|
23
|
+
|
|
24
|
+
=head2 recordSource
|
|
25
|
+
|
|
26
|
+
The source of a record that was read from a text, and of every copy of it. A
|
|
27
|
+
record a plugin built out of parts of another one has no source of its own; see
|
|
28
|
+
C<recordOrigin>. A plugin that replaces the tree of a record leaves the source
|
|
29
|
+
in place, so having a source does not mean the tree still matches it; see
|
|
30
|
+
C<isParsedTree>.
|
|
31
|
+
|
|
32
|
+
=end pod
|
|
33
|
+
*/
|
|
34
|
+
export const recordSource = (record) => held(record)[sourceKey];
|
|
35
|
+
/*
|
|
36
|
+
=begin pod :kind<export>
|
|
37
|
+
|
|
38
|
+
=head2 recordOrigin
|
|
39
|
+
|
|
40
|
+
The reading a record comes from: its own source, or the source of the record it
|
|
41
|
+
was cut from. Several records cut from one file share one origin, and that
|
|
42
|
+
origin holds the text of the whole file, not of the record.
|
|
43
|
+
|
|
44
|
+
=end pod
|
|
45
|
+
*/
|
|
46
|
+
export const recordOrigin = (record) => held(record)[originKey] ?? held(record)[sourceKey];
|
|
47
|
+
/*
|
|
48
|
+
=begin pod :kind<export>
|
|
49
|
+
|
|
50
|
+
=head2 isParsedTree
|
|
51
|
+
|
|
52
|
+
Whether the tree of the record is the very object its source was parsed into.
|
|
53
|
+
A tree changed in place still answers yes.
|
|
54
|
+
|
|
55
|
+
=end pod
|
|
56
|
+
*/
|
|
57
|
+
export const isParsedTree = (record) => held(record)[sourceKey]?.parsed(held(record).node) ?? false;
|
|
58
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],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AAI,CAAC,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAA;IAC7D,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC7D,CAAC,CAAA;AAED;;;;;;;;;;;;EAYE;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAA4B,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;AAEjG;;;;;;;;;;EAUE;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAA4B,EAAE,CACvE,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;AAEpD;;;;;;;;;EASE;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAA"}
|
|
@@ -2,7 +2,7 @@ import * as CRC32 from 'crc-32';
|
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import pathFs from 'path';
|
|
4
4
|
import { getFromTree, getTextContentFromNode, makeAttrs } from '@podlite/schema';
|
|
5
|
-
import { version } from './version';
|
|
5
|
+
import { version } from './version.js';
|
|
6
6
|
const plugin = (appVersion, indexFilePath) => {
|
|
7
7
|
const outCtx = {};
|
|
8
8
|
let crc_sum = '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTextContentFromNode, makeInterator, toFragment, } from '@podlite/schema';
|
|
2
|
-
import { BUILT_PATH } from './constants';
|
|
2
|
+
import { BUILT_PATH } from './constants.js';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
const plugin = ({ built_path = BUILT_PATH }) => {
|
|
5
5
|
const outCtx = {};
|
package/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.52";
|
package/esm/version.js
CHANGED
|
@@ -1,7 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_1 = require("@podlite/schema");
|
|
4
|
+
const schema_2 = require("@podlite/schema");
|
|
4
5
|
const shared_1 = require("./shared");
|
|
6
|
+
// A selector whose source, address or operand does not resolve brings nothing
|
|
7
|
+
// in, and says so once, naming the =set assignments lost with it.
|
|
8
|
+
const select = (selector, recs, lost = '') => {
|
|
9
|
+
// a selector that is not read, or a scheme not resolved here, finds nothing
|
|
10
|
+
// without saying why
|
|
11
|
+
const parsed = (0, shared_1.parseSelector)(selector);
|
|
12
|
+
if (!parsed) {
|
|
13
|
+
console.warn(`[plugin: resolve ] selector ${selector} cannot be read${lost}`);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (parsed.scheme && parsed.scheme !== 'doc' && parsed.scheme !== 'file') {
|
|
17
|
+
console.warn(`[plugin: resolve ] selector ${selector}: scheme ${parsed.scheme}: is not supported${lost}`);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return (0, shared_1.runSelector)(selector, recs);
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
if (!(e instanceof schema_2.SelectorError))
|
|
25
|
+
throw e;
|
|
26
|
+
console.warn(`[plugin: resolve ] selector ${selector} cannot be read: ${e.message}${lost}`);
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const names = (set) => set.map(c => c.name).join(', ');
|
|
31
|
+
// The =set assignments written before an include go to the first block it
|
|
32
|
+
// brings; once placed or lost, the directive no longer carries them. When the
|
|
33
|
+
// include brings no block they stay without a target: carrying them on to the
|
|
34
|
+
// next block is not done here, nor through an include inside what was brought.
|
|
35
|
+
const assignments = (node) => {
|
|
36
|
+
const set = node.set || [];
|
|
37
|
+
const { set: _, ...rest } = node;
|
|
38
|
+
const lost = set.length ? `; =set assignments not applied: ${names(set)}` : '';
|
|
39
|
+
const place = (blocks) => {
|
|
40
|
+
if (!set.length)
|
|
41
|
+
return blocks;
|
|
42
|
+
const applied = (0, schema_2.applySetToFirst)(blocks, set, { mode: 'include' });
|
|
43
|
+
if (applied.outcome !== 'block') {
|
|
44
|
+
console.warn(`[plugin: resolve ] =set before =include has no target block: ${names(set)}`);
|
|
45
|
+
}
|
|
46
|
+
return applied.outcome === 'block' ? applied.nodes : blocks;
|
|
47
|
+
};
|
|
48
|
+
return { node: rest, lost, place };
|
|
49
|
+
};
|
|
5
50
|
const plugin = () => {
|
|
6
51
|
const outCtx = {};
|
|
7
52
|
const docsMap = new Map();
|
|
@@ -9,29 +54,37 @@ const plugin = () => {
|
|
|
9
54
|
const processNode = (node, recs) => {
|
|
10
55
|
const rules = {
|
|
11
56
|
// TODO: remove 'Include' due to duplicate to 'include'
|
|
12
|
-
Include:
|
|
57
|
+
Include: written => {
|
|
58
|
+
const { node, lost, place } = assignments(written);
|
|
13
59
|
const { content } = node;
|
|
14
60
|
const selector = (0, schema_1.getTextContentFromNode)(content).trim();
|
|
15
61
|
console.warn(`[include] start resolve selector: ${selector}`);
|
|
16
62
|
if (selector) {
|
|
17
63
|
// try to resolve selector
|
|
18
|
-
const
|
|
64
|
+
const result = select(selector, recs, lost);
|
|
65
|
+
if (!result)
|
|
66
|
+
return node;
|
|
67
|
+
const [block] = result;
|
|
19
68
|
if (typeof block === 'object' && !('file' in block)) {
|
|
20
|
-
const updated = { content: block };
|
|
69
|
+
const updated = { content: place([block])[0] };
|
|
21
70
|
return { ...node, ...updated };
|
|
22
71
|
}
|
|
23
72
|
if (!block) {
|
|
24
73
|
console.warn(`[plugin: resolve ] selector ${selector} not found`);
|
|
74
|
+
place([]);
|
|
25
75
|
}
|
|
26
76
|
}
|
|
27
77
|
return node;
|
|
28
78
|
},
|
|
29
|
-
include:
|
|
79
|
+
include: written => {
|
|
80
|
+
const { node, lost, place } = assignments(written);
|
|
30
81
|
const { content } = node;
|
|
31
82
|
const selector = (0, schema_1.getTextContentFromNode)(content).trim();
|
|
32
83
|
console.warn(`[include] start resolve selector: ${selector}`);
|
|
33
84
|
if (selector) {
|
|
34
|
-
const result = (
|
|
85
|
+
const result = select(selector, recs, lost);
|
|
86
|
+
if (!result)
|
|
87
|
+
return node;
|
|
35
88
|
const blocks = [];
|
|
36
89
|
for (const item of result) {
|
|
37
90
|
if (typeof item === 'object' && item !== null && !('file' in item)) {
|
|
@@ -39,9 +92,13 @@ const plugin = () => {
|
|
|
39
92
|
}
|
|
40
93
|
}
|
|
41
94
|
if (blocks.length > 0) {
|
|
42
|
-
return { ...node, content: blocks };
|
|
95
|
+
return { ...node, content: place((0, schema_2.outermost)(blocks)) };
|
|
43
96
|
}
|
|
44
97
|
console.warn(`[plugin: resolve ] selector ${selector} not found`);
|
|
98
|
+
place([]);
|
|
99
|
+
}
|
|
100
|
+
else if (lost) {
|
|
101
|
+
console.warn(`[plugin: resolve ] include selector cannot be read: (empty)${lost}`);
|
|
45
102
|
}
|
|
46
103
|
return node;
|
|
47
104
|
},
|
package/lib/node-utils.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ declare const MIME_TYPES_EXTENSIONS: {
|
|
|
22
22
|
'audio/mpeg': readonly [".mp3"];
|
|
23
23
|
};
|
|
24
24
|
type PartserTypes = typeof PARSER_TYPES[keyof typeof PARSER_TYPES];
|
|
25
|
-
type MimeTypes = keyof typeof MIME_TYPES_EXTENSIONS;
|
|
25
|
+
export type MimeTypes = keyof typeof MIME_TYPES_EXTENSIONS;
|
|
26
26
|
export declare function getParserTypeforFile(filePath: string, mime?: MimeTypes): PartserTypes;
|
|
27
|
+
export declare function parseText(filePath: string, text: string, mime?: MimeTypes): RootBlock;
|
|
27
28
|
export declare function parseFile(filePath: string, fileContent?: string, mime?: MimeTypes): RootBlock;
|
|
28
29
|
export declare function getDocumentAttributes(node: PodliteDocument, filePath?: string): {
|
|
29
30
|
header: any;
|
package/lib/node-utils.js
CHANGED
|
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.convertFileLinksToUrl = exports.makeLinksMap = exports.getPathToOpen = void 0;
|
|
40
40
|
exports.parseFiles = parseFiles;
|
|
41
41
|
exports.getParserTypeforFile = getParserTypeforFile;
|
|
42
|
+
exports.parseText = parseText;
|
|
42
43
|
exports.parseFile = parseFile;
|
|
43
44
|
exports.getDocumentAttributes = getDocumentAttributes;
|
|
44
45
|
exports.getPublishAttributes = getPublishAttributes;
|
|
@@ -49,22 +50,22 @@ exports.streamWriteArray = streamWriteArray;
|
|
|
49
50
|
const schema_1 = require("@podlite/schema");
|
|
50
51
|
const fs = __importStar(require("fs"));
|
|
51
52
|
const path_1 = __importDefault(require("path"));
|
|
53
|
+
const glob_1 = __importDefault(require("glob"));
|
|
52
54
|
const shared_1 = require("./shared");
|
|
53
55
|
const markdown_1 = require("@podlite/markdown");
|
|
54
56
|
const podlite_1 = require("podlite");
|
|
55
57
|
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
56
|
-
const
|
|
58
|
+
const source_1 = require("./source");
|
|
57
59
|
const getPathToOpen = (filepath, parentDocPath) => {
|
|
58
60
|
const isRemoteReg = new RegExp(/^(https?|ftp):/);
|
|
59
61
|
const isRemote = isRemoteReg.test(filepath);
|
|
60
62
|
if (isRemote) {
|
|
61
63
|
return { isRemote, path: filepath };
|
|
62
64
|
}
|
|
63
|
-
const
|
|
64
|
-
const docDirPath = path.dirname(parentDocPath);
|
|
65
|
+
const docDirPath = path_1.default.dirname(parentDocPath);
|
|
65
66
|
return {
|
|
66
67
|
isRemote,
|
|
67
|
-
path:
|
|
68
|
+
path: path_1.default.isAbsolute(filepath) ? filepath : path_1.default.normalize(path_1.default.join(docDirPath, filepath)),
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
exports.getPathToOpen = getPathToOpen;
|
|
@@ -117,7 +118,7 @@ const convertFileLinksToUrl = (records, additinalMap = {}) => {
|
|
|
117
118
|
exports.convertFileLinksToUrl = convertFileLinksToUrl;
|
|
118
119
|
function parseFiles(path) {
|
|
119
120
|
let count = 0;
|
|
120
|
-
const allFiles =
|
|
121
|
+
const allFiles = glob_1.default
|
|
121
122
|
.sync(path)
|
|
122
123
|
.map((f) => {
|
|
123
124
|
count++;
|
|
@@ -215,7 +216,18 @@ function getParserTypeforFile(filePath, mime) {
|
|
|
215
216
|
};
|
|
216
217
|
return parserTypeMap[ext] || PARSER_TYPES.DEFAULT;
|
|
217
218
|
}
|
|
218
|
-
|
|
219
|
+
/*
|
|
220
|
+
=begin pod :kind<export>
|
|
221
|
+
|
|
222
|
+
=head2 parseText
|
|
223
|
+
|
|
224
|
+
Parses a text the way a file of that name is read: the type comes from C<mime>,
|
|
225
|
+
else from the extension. The text is taken as given, an empty one included, and
|
|
226
|
+
nothing is read from disk.
|
|
227
|
+
|
|
228
|
+
=end pod
|
|
229
|
+
*/
|
|
230
|
+
function parseText(filePath, text, mime) {
|
|
219
231
|
// check extension of file and parse it deepnds on mime type
|
|
220
232
|
const parser_type = getParserTypeforFile(filePath, mime);
|
|
221
233
|
const typeToParserMap = {
|
|
@@ -235,8 +247,10 @@ function parseFile(filePath, fileContent, mime) {
|
|
|
235
247
|
return podlite_processor.toAstResult(tree).interator;
|
|
236
248
|
},
|
|
237
249
|
};
|
|
238
|
-
|
|
239
|
-
|
|
250
|
+
return typeToParserMap[parser_type](text);
|
|
251
|
+
}
|
|
252
|
+
function parseFile(filePath, fileContent, mime) {
|
|
253
|
+
return parseText(filePath, fileContent || fs.readFileSync(filePath).toString(), mime);
|
|
240
254
|
}
|
|
241
255
|
// An address written without quotes is cut into a list at every space, and only
|
|
242
256
|
// its first word reaches the page. The page then lands on a short address, or on
|
|
@@ -371,13 +385,14 @@ function getPublishAttributes(node, filePath) {
|
|
|
371
385
|
return props;
|
|
372
386
|
}
|
|
373
387
|
function processFile(f, content, mime) {
|
|
374
|
-
const
|
|
388
|
+
const text = content || fs.readFileSync(f).toString();
|
|
389
|
+
const podlite_document = parseText(f, text, mime);
|
|
375
390
|
// now extract some extra meta inforamtion, like pubdate, puburl
|
|
376
391
|
// markdown front matter and pod attributes reach here as different shapes
|
|
377
392
|
const attr = ((f, node) => {
|
|
378
393
|
if (getParserTypeforFile(f, mime) === PARSER_TYPES.MARKDOWN) {
|
|
379
394
|
// try to extract from markdown front matter
|
|
380
|
-
const { data } = (0, gray_matter_1.default)(
|
|
395
|
+
const { data } = (0, gray_matter_1.default)(text);
|
|
381
396
|
return data;
|
|
382
397
|
}
|
|
383
398
|
else {
|
|
@@ -386,7 +401,7 @@ function processFile(f, content, mime) {
|
|
|
386
401
|
})(f, podlite_document);
|
|
387
402
|
// prepare attributes
|
|
388
403
|
const { title, description, subtitle, author, footer, puburl, pubdate, header } = attr;
|
|
389
|
-
|
|
404
|
+
const record = {
|
|
390
405
|
type: 'page',
|
|
391
406
|
isPage: attr.isPage === true || attr.type === 'page',
|
|
392
407
|
title,
|
|
@@ -401,10 +416,11 @@ function processFile(f, content, mime) {
|
|
|
401
416
|
sources: [],
|
|
402
417
|
node: podlite_document,
|
|
403
418
|
};
|
|
419
|
+
return (0, source_1.withSource)(record, f, text, mime);
|
|
404
420
|
}
|
|
405
421
|
function parseSources(path) {
|
|
406
422
|
let count = 0;
|
|
407
|
-
const allFiles =
|
|
423
|
+
const allFiles = glob_1.default
|
|
408
424
|
.sync(path)
|
|
409
425
|
.map((f) => {
|
|
410
426
|
count++;
|
package/lib/pubdate-plugin.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.getPages = getPages;
|
|
|
6
6
|
const schema_1 = require("@podlite/schema");
|
|
7
7
|
const node_utils_1 = require("./node-utils");
|
|
8
8
|
const shared_1 = require("./shared");
|
|
9
|
+
const source_1 = require("./source");
|
|
9
10
|
function getArticles(item) {
|
|
10
11
|
let articles = [];
|
|
11
12
|
const { file } = item;
|
|
@@ -30,7 +31,7 @@ function getArticles(item) {
|
|
|
30
31
|
const description = (0, schema_1.getFromTree)(articleContent, 'para')[0];
|
|
31
32
|
const pubdate = (0, schema_1.makeAttrs)(nodePublished, {}).getFirstValue('pubdate');
|
|
32
33
|
//TODO: use footer and header of document for generated articles
|
|
33
|
-
articles.push({
|
|
34
|
+
articles.push((0, source_1.withOrigin)({
|
|
34
35
|
pubdate,
|
|
35
36
|
title: (0, schema_1.getTextContentFromNode)(nodePublished).trim(),
|
|
36
37
|
type: 'page',
|
|
@@ -40,7 +41,7 @@ function getArticles(item) {
|
|
|
40
41
|
node: (0, schema_1.mkRootBlock)({}, articleContent),
|
|
41
42
|
description,
|
|
42
43
|
file,
|
|
43
|
-
});
|
|
44
|
+
}, item));
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -68,7 +69,7 @@ function getNotes(item) {
|
|
|
68
69
|
? a_pubdate.replace(' ', 'T')
|
|
69
70
|
: a_pubdate;
|
|
70
71
|
//TODO: use footer and header of document for generated notes
|
|
71
|
-
return {
|
|
72
|
+
return (0, source_1.withOrigin)({
|
|
72
73
|
pubdate,
|
|
73
74
|
type: 'note',
|
|
74
75
|
isPage: false,
|
|
@@ -78,7 +79,7 @@ function getNotes(item) {
|
|
|
78
79
|
file,
|
|
79
80
|
publishUrl: '',
|
|
80
81
|
sources: [],
|
|
81
|
-
};
|
|
82
|
+
}, item);
|
|
82
83
|
});
|
|
83
84
|
return notes;
|
|
84
85
|
}
|
|
@@ -89,7 +90,7 @@ function getPages(item) {
|
|
|
89
90
|
.map((n) => {
|
|
90
91
|
const { title, description, puburl, pubdate, isPage } = (0, node_utils_1.getPublishAttributes)(n);
|
|
91
92
|
//TODO: use footer and header of document for generated pages
|
|
92
|
-
|
|
93
|
+
const page = {
|
|
93
94
|
pubdate: pubdate || '',
|
|
94
95
|
type: 'page',
|
|
95
96
|
isPage,
|
|
@@ -100,6 +101,7 @@ function getPages(item) {
|
|
|
100
101
|
publishUrl: puburl || '',
|
|
101
102
|
sources,
|
|
102
103
|
};
|
|
104
|
+
return (0, source_1.withOrigin)(page, item);
|
|
103
105
|
});
|
|
104
106
|
return pages;
|
|
105
107
|
}
|
package/lib/record.d.ts
CHANGED
package/lib/record.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEntry = void 0;
|
|
3
|
+
exports.isEntry = exports.isParsedTree = exports.recordOrigin = exports.recordSource = void 0;
|
|
4
|
+
var source_1 = require("./source");
|
|
5
|
+
Object.defineProperty(exports, "recordSource", { enumerable: true, get: function () { return source_1.recordSource; } });
|
|
6
|
+
Object.defineProperty(exports, "recordOrigin", { enumerable: true, get: function () { return source_1.recordOrigin; } });
|
|
7
|
+
Object.defineProperty(exports, "isParsedTree", { enumerable: true, get: function () { return source_1.isParsedTree; } });
|
|
4
8
|
// The record's `type` cannot answer this: it says whether the address was declared
|
|
5
9
|
// or built, and it is the letter the short url is made of. Only the author can call
|
|
6
10
|
// a document a page, with :type('page'); a document with no date is not published.
|
package/lib/source.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MimeTypes } from './node-utils';
|
|
2
|
+
export type RecordSource = {
|
|
3
|
+
readonly file: string;
|
|
4
|
+
readonly mime?: MimeTypes;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const sourceKey: unique symbol;
|
|
8
|
+
export declare const originKey: unique symbol;
|
|
9
|
+
export declare const withSource: <T extends object>(record: T, file: string, text: string, mime?: MimeTypes) => T;
|
|
10
|
+
export declare const withOrigin: <T extends object>(record: T, from: object) => T;
|
|
11
|
+
export declare const recordSource: (record: object) => RecordSource | undefined;
|
|
12
|
+
export declare const recordOrigin: (record: object) => RecordSource | undefined;
|
|
13
|
+
export declare const isParsedTree: (record: object) => boolean;
|
package/lib/source.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isParsedTree = exports.recordOrigin = exports.recordSource = exports.withOrigin = exports.withSource = exports.originKey = exports.sourceKey = void 0;
|
|
4
|
+
// Symbol.for shares the key between copies of the package in one process, so the
|
|
5
|
+
// shape of the value is fixed by the number in the name
|
|
6
|
+
exports.sourceKey = Symbol.for('@podlite/publisher:source/1');
|
|
7
|
+
exports.originKey = Symbol.for('@podlite/publisher:origin/1');
|
|
8
|
+
// the keys stay out of the record type: a declaration that spreads a record would have to name them
|
|
9
|
+
const held = (record) => record;
|
|
10
|
+
const hold = (file, text, mime, tree) => {
|
|
11
|
+
const source = { file, ...(mime ? { mime } : {}), text, parsed: (node) => node === tree };
|
|
12
|
+
Object.defineProperty(source, 'text', { enumerable: false });
|
|
13
|
+
Object.defineProperty(source, 'parsed', { enumerable: false });
|
|
14
|
+
return Object.freeze(source);
|
|
15
|
+
};
|
|
16
|
+
const withSource = (record, file, text, mime) => ({
|
|
17
|
+
...record,
|
|
18
|
+
[exports.sourceKey]: hold(file, text, mime, held(record).node),
|
|
19
|
+
});
|
|
20
|
+
exports.withSource = withSource;
|
|
21
|
+
const withOrigin = (record, from) => {
|
|
22
|
+
const origin = held(from)[exports.originKey] ?? held(from)[exports.sourceKey];
|
|
23
|
+
return origin ? { ...record, [exports.originKey]: origin } : record;
|
|
24
|
+
};
|
|
25
|
+
exports.withOrigin = withOrigin;
|
|
26
|
+
/*
|
|
27
|
+
=begin pod :kind<export>
|
|
28
|
+
|
|
29
|
+
=head2 recordSource
|
|
30
|
+
|
|
31
|
+
The source of a record that was read from a text, and of every copy of it. A
|
|
32
|
+
record a plugin built out of parts of another one has no source of its own; see
|
|
33
|
+
C<recordOrigin>. A plugin that replaces the tree of a record leaves the source
|
|
34
|
+
in place, so having a source does not mean the tree still matches it; see
|
|
35
|
+
C<isParsedTree>.
|
|
36
|
+
|
|
37
|
+
=end pod
|
|
38
|
+
*/
|
|
39
|
+
const recordSource = (record) => held(record)[exports.sourceKey];
|
|
40
|
+
exports.recordSource = recordSource;
|
|
41
|
+
/*
|
|
42
|
+
=begin pod :kind<export>
|
|
43
|
+
|
|
44
|
+
=head2 recordOrigin
|
|
45
|
+
|
|
46
|
+
The reading a record comes from: its own source, or the source of the record it
|
|
47
|
+
was cut from. Several records cut from one file share one origin, and that
|
|
48
|
+
origin holds the text of the whole file, not of the record.
|
|
49
|
+
|
|
50
|
+
=end pod
|
|
51
|
+
*/
|
|
52
|
+
const recordOrigin = (record) => held(record)[exports.originKey] ?? held(record)[exports.sourceKey];
|
|
53
|
+
exports.recordOrigin = recordOrigin;
|
|
54
|
+
/*
|
|
55
|
+
=begin pod :kind<export>
|
|
56
|
+
|
|
57
|
+
=head2 isParsedTree
|
|
58
|
+
|
|
59
|
+
Whether the tree of the record is the very object its source was parsed into.
|
|
60
|
+
A tree changed in place still answers yes.
|
|
61
|
+
|
|
62
|
+
=end pod
|
|
63
|
+
*/
|
|
64
|
+
const isParsedTree = (record) => held(record)[exports.sourceKey]?.parsed(held(record).node) ?? false;
|
|
65
|
+
exports.isParsedTree = isParsedTree;
|
|
66
|
+
//# sourceMappingURL=source.js.map
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.52";
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podlite/publisher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"description": "Publishing toolkit for Podlite — transform documents to HTML, generate sites",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"CHANGELOG.md"
|
|
58
58
|
],
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
60
|
+
"node": ">=20.19"
|
|
61
61
|
},
|
|
62
62
|
"engineStrict": true,
|
|
63
63
|
"publishConfig": {
|
|
@@ -84,17 +84,17 @@
|
|
|
84
84
|
"transform"
|
|
85
85
|
],
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@podlite/markdown": "0.0.
|
|
88
|
-
"@podlite/schema": "0.0.
|
|
87
|
+
"@podlite/markdown": "0.0.64",
|
|
88
|
+
"@podlite/schema": "0.0.71",
|
|
89
89
|
"crc-32": "^1.2.2",
|
|
90
|
+
"glob": "^7.2.0",
|
|
90
91
|
"gray-matter": "^4.0.3",
|
|
91
92
|
"iso_9": "^1.0.4",
|
|
92
93
|
"newbase60": "^1.3.1",
|
|
93
|
-
"podlite": "0.0.
|
|
94
|
+
"podlite": "0.0.84"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
97
|
"@types/node": "^17.0.7",
|
|
97
|
-
"glob": "^7.2.0",
|
|
98
98
|
"npm-run-all": "^4.1.5",
|
|
99
99
|
"ts-node": "^9.1.1",
|
|
100
100
|
"typescript": "4.5.5"
|