podlite 0.0.86 → 0.0.88
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 +4 -0
- package/esm/lint/rules/index.js +2 -0
- package/esm/lint/rules/index.js.map +1 -1
- package/esm/lint/rules/notify-attribute.d.ts +3 -0
- package/esm/lint/rules/notify-attribute.js +33 -0
- package/esm/lint/rules/notify-attribute.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/lint/rules/index.js +2 -0
- package/lib/lint/rules/index.js.map +1 -1
- package/lib/lint/rules/notify-attribute.d.ts +3 -0
- package/lib/lint/rules/notify-attribute.js +36 -0
- package/lib/lint/rules/notify-attribute.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.podlite
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
=head1 Upcoming
|
|
4
4
|
|
|
5
|
+
=head1 0.0.87
|
|
6
|
+
|
|
7
|
+
=item C<lint> warns about C<:notify> on a C<=nested> block, written on the block or given by C<=set> or C<=config>; the specification writes the notification attribute C<:notice>, and a block with C<:notify> and without C<:notice> is drawn as a plain nested block (rule C<notify-attribute>)
|
|
8
|
+
|
|
5
9
|
=head1 0.0.85
|
|
6
10
|
|
|
7
11
|
=item C<lint> warns about a block named C<=Include>, C<=Set>, C<=Config> or C<=Alias>, which is a named block and not the directive (rule C<directive-named-block>), and about C<=Image>, which the specification writes as C<=picture> (rule C<image-named-block>); each rule can be turned off on its own
|
package/esm/lint/rules/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { tableShapeRule } from './table-shape.js';
|
|
|
10
10
|
import { deadDefinitionsRule } from './dead-definitions.js';
|
|
11
11
|
import { includeResolvesRule } from './include-resolves.js';
|
|
12
12
|
import { directiveNamedBlockRule, imageNamedBlockRule } from './named-blocks.js';
|
|
13
|
+
import { notifyAttributeRule } from './notify-attribute.js';
|
|
13
14
|
export const DEFAULT_RULES = [
|
|
14
15
|
syntaxValidRule,
|
|
15
16
|
headingHierarchyRule,
|
|
@@ -24,5 +25,6 @@ export const DEFAULT_RULES = [
|
|
|
24
25
|
includeResolvesRule,
|
|
25
26
|
directiveNamedBlockRule,
|
|
26
27
|
imageNamedBlockRule,
|
|
28
|
+
notifyAttributeRule,
|
|
27
29
|
];
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,eAAe;IACf,oBAAoB;IACpB,YAAY;IACZ,qBAAqB;IACrB,sBAAsB;IACtB,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,mBAAmB;IACnB,mBAAmB;IACnB,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;CACpB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getFromTree } from '@podlite/schema';
|
|
2
|
+
export const NOTIFY_ATTRIBUTE_RULE_ID = 'notify-attribute';
|
|
3
|
+
const isNested = (node) => typeof node === 'object' &&
|
|
4
|
+
node !== null &&
|
|
5
|
+
node.type === 'block' &&
|
|
6
|
+
node.name === 'nested';
|
|
7
|
+
// The parser already puts on a block what =set and =config give it, marked by
|
|
8
|
+
// where it came from, so one reading of the block covers all three sources and
|
|
9
|
+
// gives one warning. A =set or =config written before =include reaches its block
|
|
10
|
+
// only when the files are assembled: a block of the included file, or the next
|
|
11
|
+
// block of the including file when the included one gives none. The tree of
|
|
12
|
+
// either file does not hold it, and such a loss is not reported.
|
|
13
|
+
export const notifyAttributeRule = {
|
|
14
|
+
id: NOTIFY_ATTRIBUTE_RULE_ID,
|
|
15
|
+
severity: 'warning',
|
|
16
|
+
check: (ast, _ctx) => getFromTree(ast, () => true).flatMap(node => {
|
|
17
|
+
if (!isNested(node))
|
|
18
|
+
return [];
|
|
19
|
+
const entry = (node.config || []).find(c => c.name === 'notify');
|
|
20
|
+
if (!entry)
|
|
21
|
+
return [];
|
|
22
|
+
const source = entry.from === 'set' || entry.from === 'config' ? ` given by =${entry.from}` : '';
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
rule: NOTIFY_ATTRIBUTE_RULE_ID,
|
|
26
|
+
severity: 'warning',
|
|
27
|
+
message: `:notify${source} is not a notification attribute; a notification is written :notice`,
|
|
28
|
+
location: node.location,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=notify-attribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-attribute.js","sourceRoot":"","sources":["../../../src/lint/rules/notify-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAA;AAG9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAA;AAK1D,MAAM,QAAQ,GAAG,CAAC,IAAa,EAAsB,EAAE,CACrD,OAAO,IAAI,KAAK,QAAQ;IACxB,IAAI,KAAK,IAAI;IACZ,IAAmB,CAAC,IAAI,KAAK,OAAO;IACpC,IAAmB,CAAC,IAAI,KAAK,QAAQ,CAAA;AAExC,8EAA8E;AAC9E,+EAA+E;AAC/E,iFAAiF;AACjF,+EAA+E;AAC/E,4EAA4E;AAC5E,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,wBAAwB;IAC5B,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,CAAC,GAAoB,EAAE,IAAiB,EAAe,EAAE,CAC9D,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAA;QAC9B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;QAChE,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAA;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAChG,OAAO;YACL;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,SAAkB;gBAC5B,OAAO,EAAE,UAAU,MAAM,qEAAqE;gBAC9F,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB;SACF,CAAA;IACH,CAAC,CAAC;CACL,CAAA"}
|
package/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.88";
|
package/esm/version.js
CHANGED
package/lib/lint/rules/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const table_shape_1 = require("./table-shape");
|
|
|
13
13
|
const dead_definitions_1 = require("./dead-definitions");
|
|
14
14
|
const include_resolves_1 = require("./include-resolves");
|
|
15
15
|
const named_blocks_1 = require("./named-blocks");
|
|
16
|
+
const notify_attribute_1 = require("./notify-attribute");
|
|
16
17
|
exports.DEFAULT_RULES = [
|
|
17
18
|
syntax_valid_1.syntaxValidRule,
|
|
18
19
|
heading_hierarchy_1.headingHierarchyRule,
|
|
@@ -27,5 +28,6 @@ exports.DEFAULT_RULES = [
|
|
|
27
28
|
include_resolves_1.includeResolvesRule,
|
|
28
29
|
named_blocks_1.directiveNamedBlockRule,
|
|
29
30
|
named_blocks_1.imageNamedBlockRule,
|
|
31
|
+
notify_attribute_1.notifyAttributeRule,
|
|
30
32
|
];
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":";;;AACA,iDAAgD;AAChD,2DAA0D;AAC1D,2CAA0C;AAC1C,+DAA6D;AAC7D,iEAA+D;AAC/D,6DAA2D;AAC3D,qDAAmD;AACnD,6DAA2D;AAC3D,+CAA8C;AAC9C,yDAAwD;AACxD,yDAAwD;AACxD,iDAA6E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":";;;AACA,iDAAgD;AAChD,2DAA0D;AAC1D,2CAA0C;AAC1C,+DAA6D;AAC7D,iEAA+D;AAC/D,6DAA2D;AAC3D,qDAAmD;AACnD,6DAA2D;AAC3D,+CAA8C;AAC9C,yDAAwD;AACxD,yDAAwD;AACxD,iDAA6E;AAC7E,yDAAwD;AAE3C,QAAA,aAAa,GAAW;IACnC,8BAAe;IACf,wCAAoB;IACpB,wBAAY;IACZ,2CAAqB;IACrB,6CAAsB;IACtB,yCAAoB;IACpB,iCAAgB;IAChB,yCAAoB;IACpB,4BAAc;IACd,sCAAmB;IACnB,sCAAmB;IACnB,sCAAuB;IACvB,kCAAmB;IACnB,sCAAmB;CACpB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notifyAttributeRule = exports.NOTIFY_ATTRIBUTE_RULE_ID = void 0;
|
|
4
|
+
const schema_1 = require("@podlite/schema");
|
|
5
|
+
exports.NOTIFY_ATTRIBUTE_RULE_ID = 'notify-attribute';
|
|
6
|
+
const isNested = (node) => typeof node === 'object' &&
|
|
7
|
+
node !== null &&
|
|
8
|
+
node.type === 'block' &&
|
|
9
|
+
node.name === 'nested';
|
|
10
|
+
// The parser already puts on a block what =set and =config give it, marked by
|
|
11
|
+
// where it came from, so one reading of the block covers all three sources and
|
|
12
|
+
// gives one warning. A =set or =config written before =include reaches its block
|
|
13
|
+
// only when the files are assembled: a block of the included file, or the next
|
|
14
|
+
// block of the including file when the included one gives none. The tree of
|
|
15
|
+
// either file does not hold it, and such a loss is not reported.
|
|
16
|
+
exports.notifyAttributeRule = {
|
|
17
|
+
id: exports.NOTIFY_ATTRIBUTE_RULE_ID,
|
|
18
|
+
severity: 'warning',
|
|
19
|
+
check: (ast, _ctx) => (0, schema_1.getFromTree)(ast, () => true).flatMap(node => {
|
|
20
|
+
if (!isNested(node))
|
|
21
|
+
return [];
|
|
22
|
+
const entry = (node.config || []).find(c => c.name === 'notify');
|
|
23
|
+
if (!entry)
|
|
24
|
+
return [];
|
|
25
|
+
const source = entry.from === 'set' || entry.from === 'config' ? ` given by =${entry.from}` : '';
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
rule: exports.NOTIFY_ATTRIBUTE_RULE_ID,
|
|
29
|
+
severity: 'warning',
|
|
30
|
+
message: `:notify${source} is not a notification attribute; a notification is written :notice`,
|
|
31
|
+
location: node.location,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=notify-attribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-attribute.js","sourceRoot":"","sources":["../../../src/lint/rules/notify-attribute.ts"],"names":[],"mappings":";;;AAAA,4CAA8D;AAGjD,QAAA,wBAAwB,GAAG,kBAAkB,CAAA;AAK1D,MAAM,QAAQ,GAAG,CAAC,IAAa,EAAsB,EAAE,CACrD,OAAO,IAAI,KAAK,QAAQ;IACxB,IAAI,KAAK,IAAI;IACZ,IAAmB,CAAC,IAAI,KAAK,OAAO;IACpC,IAAmB,CAAC,IAAI,KAAK,QAAQ,CAAA;AAExC,8EAA8E;AAC9E,+EAA+E;AAC/E,iFAAiF;AACjF,+EAA+E;AAC/E,4EAA4E;AAC5E,iEAAiE;AACpD,QAAA,mBAAmB,GAAS;IACvC,EAAE,EAAE,gCAAwB;IAC5B,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,CAAC,GAAoB,EAAE,IAAiB,EAAe,EAAE,CAC9D,IAAA,oBAAW,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAA;QAC9B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;QAChE,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAA;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAChG,OAAO;YACL;gBACE,IAAI,EAAE,gCAAwB;gBAC9B,QAAQ,EAAE,SAAkB;gBAC5B,OAAO,EAAE,UAAU,MAAM,qEAAqE;gBAC9F,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB;SACF,CAAA;IACH,CAAC,CAAC;CACL,CAAA"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.88";
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "podlite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.88",
|
|
4
4
|
"description": "Podlite markup language parser — Markdown-compatible, with native support for diagrams, formulas, and custom blocks",
|
|
5
5
|
"homepage": "https://podlite.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
"url": "https://github.com/podlite/podlite/issues"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@podlite/diagram": "^0.0.
|
|
104
|
-
"@podlite/formula": "0.0.
|
|
105
|
-
"@podlite/image": "^0.0.
|
|
106
|
-
"@podlite/markdown": "0.0.
|
|
107
|
-
"@podlite/schema": "^0.0.
|
|
108
|
-
"@podlite/toc": "0.0.
|
|
103
|
+
"@podlite/diagram": "^0.0.79",
|
|
104
|
+
"@podlite/formula": "0.0.57",
|
|
105
|
+
"@podlite/image": "^0.0.74",
|
|
106
|
+
"@podlite/markdown": "0.0.68",
|
|
107
|
+
"@podlite/schema": "^0.0.75",
|
|
108
|
+
"@podlite/toc": "0.0.68",
|
|
109
109
|
"nanoid": "3.1.30"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|