wikiparser-node 1.17.0 → 1.18.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/README.md +20 -0
- package/bin/config.js +3 -0
- package/bundle/{bundle.es7.js → bundle-es7.min.js} +19 -19
- package/bundle/bundle-lsp.min.js +38 -0
- package/bundle/bundle.min.js +19 -19
- package/config/.schema.json +7 -3
- package/config/default.json +86 -23
- package/config/enwiki.json +20 -13
- package/config/llwiki.json +99 -7
- package/config/minimum.json +6 -3
- package/config/moegirl.json +12 -12
- package/config/zhwiki.json +52 -21
- package/data/.schema.json +7 -0
- package/data/ext/mapframe.json +4 -0
- package/data/ext/maplink.json +4 -0
- package/data/ext/score.json +1033 -0
- package/data/ext/templatedata.json +184 -0
- package/dist/addon/table.js +16 -10
- package/dist/addon/token.js +13 -9
- package/dist/addon/transclude.js +6 -3
- package/dist/base.d.mts +4 -2
- package/dist/base.d.ts +4 -2
- package/dist/base.js +2 -0
- package/dist/base.mjs +3 -1
- package/dist/bin/config.js +112 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +33 -21
- package/dist/lib/document.d.ts +54 -0
- package/dist/lib/document.js +126 -0
- package/dist/lib/element.js +6 -3
- package/dist/lib/lsp.d.ts +7 -7
- package/dist/lib/lsp.js +314 -47
- package/dist/lib/node.js +19 -9
- package/dist/lib/text.js +4 -1
- package/dist/lib/title.js +9 -6
- package/dist/mixin/attributesParent.d.ts +8 -0
- package/dist/mixin/attributesParent.js +4 -0
- package/dist/parser/links.js +4 -1
- package/dist/parser/redirect.js +4 -1
- package/dist/src/arg.js +10 -3
- package/dist/src/attribute.d.ts +12 -1
- package/dist/src/attribute.js +69 -1
- package/dist/src/attributes.d.ts +8 -0
- package/dist/src/attributes.js +14 -1
- package/dist/src/converter.d.ts +62 -3
- package/dist/src/converter.js +162 -129
- package/dist/src/converterFlags.js +2 -2
- package/dist/src/converterRule.js +4 -1
- package/dist/src/extLink.d.ts +19 -3
- package/dist/src/extLink.js +177 -194
- package/dist/src/gallery.js +7 -3
- package/dist/src/heading.js +9 -4
- package/dist/src/html.js +4 -1
- package/dist/src/imageParameter.js +9 -3
- package/dist/src/imagemap.js +4 -1
- package/dist/src/index.js +34 -4
- package/dist/src/link/base.js +8 -2
- package/dist/src/link/file.js +11 -2
- package/dist/src/link/galleryImage.d.ts +1 -0
- package/dist/src/link/galleryImage.js +15 -1
- package/dist/src/magicLink.js +4 -1
- package/dist/src/nested.js +4 -1
- package/dist/src/nowiki/comment.js +4 -1
- package/dist/src/nowiki/index.js +4 -1
- package/dist/src/nowiki/quote.js +4 -1
- package/dist/src/onlyinclude.js +4 -1
- package/dist/src/paramTag/index.js +5 -1
- package/dist/src/paramTag/inputbox.js +4 -1
- package/dist/src/parameter.js +4 -1
- package/dist/src/pre.js +4 -1
- package/dist/src/redirect.js +3 -1
- package/dist/src/table/base.js +4 -1
- package/dist/src/table/index.js +10 -3
- package/dist/src/table/td.js +4 -1
- package/dist/src/tagPair/ext.js +17 -5
- package/dist/src/tagPair/include.js +4 -1
- package/dist/src/tagPair/index.js +4 -1
- package/dist/src/transclude.js +16 -7
- package/dist/util/debug.js +1 -13
- package/dist/util/diff.js +20 -6
- package/dist/util/lint.js +4 -1
- package/dist/util/string.js +5 -2
- package/extensions/dist/base.js +30 -18
- package/extensions/dist/lsp.js +30 -22
- package/extensions/es7/base.js +30 -18
- package/extensions/typings.d.ts +6 -2
- package/package.json +27 -16
- package/bundle/bundle.lsp.js +0 -38
- package/dist/mixin/flagsParent.d.ts +0 -69
- package/dist/mixin/flagsParent.js +0 -64
- package/dist/mixin/magicLinkParent.d.ts +0 -25
- package/dist/mixin/magicLinkParent.js +0 -43
- package/dist/util/sharable.d.ts +0 -1
package/README.md
CHANGED
|
@@ -57,6 +57,25 @@ For more browser extensions, please refer to the corresponding [documentation](h
|
|
|
57
57
|
|
|
58
58
|
# Usage
|
|
59
59
|
|
|
60
|
+
## CLI usage
|
|
61
|
+
|
|
62
|
+
For MediaWiki sites hosted by the Wikimedia Foundation, such as different language editions of Wikipedia, you can use the following command to obtain the parser configuration:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx getParserConfig <site> <script path> [force]
|
|
66
|
+
# For example:
|
|
67
|
+
npx getParserConfig jawiki https://ja.wikipedia.org/w
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The generated configuration file will be saved in the `config` directory. You can then use the site name for [`Parser.config`](https://github.com/bhsd-harry/wikiparser-node/wiki/Parser-%28EN%29#config).
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
// For example:
|
|
74
|
+
Parser.config = 'jawiki';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## API usage
|
|
78
|
+
|
|
60
79
|
Please refer to the [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Home-%28EN%29).
|
|
61
80
|
|
|
62
81
|
# Known issues
|
|
@@ -73,3 +92,4 @@ Please refer to the [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Ho
|
|
|
73
92
|
1. Link trail is not supported ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#1.%20Interaction%20of%20linktrail%20and%20template%20encapsulation)).
|
|
74
93
|
1. Incomplete `<p>` wrapping (Examples [1](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [2](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily)).
|
|
75
94
|
1. URI encoding in free external links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
|
|
95
|
+
1. When the entire table content is fostered, the table does not have an empty `<td>` (Examples [1](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201a.%20Fostering%20of%20entire%20template%20content), [2](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201b.%20Fostering%20of%20entire%20template%20content), [3](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%202.%20Fostering%20of%20partial%20template%20content), [4](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%204.%20Templated%20tags%2C%20no%20content)).
|
package/bin/config.js
ADDED