wikiparser-node 0.8.0-b → 0.8.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 +39 -0
- package/config/default.json +832 -0
- package/config/llwiki.json +630 -0
- package/config/moegirl.json +728 -0
- package/config/zhwiki.json +1269 -0
- package/index.js +321 -0
- package/lib/element.js +611 -0
- package/lib/node.js +772 -0
- package/lib/ranges.js +130 -0
- package/lib/text.js +215 -0
- package/lib/title.js +81 -0
- package/mixin/attributeParent.js +117 -0
- package/mixin/fixedToken.js +40 -0
- package/mixin/hidden.js +21 -0
- package/mixin/singleLine.js +31 -0
- package/mixin/sol.js +65 -0
- package/package.json +11 -12
- package/parser/brackets.js +120 -0
- package/parser/commentAndExt.js +62 -0
- package/parser/converter.js +46 -0
- package/parser/externalLinks.js +33 -0
- package/parser/hrAndDoubleUnderscore.js +38 -0
- package/parser/html.js +42 -0
- package/parser/links.js +94 -0
- package/parser/list.js +59 -0
- package/parser/magicLinks.js +41 -0
- package/parser/quotes.js +64 -0
- package/parser/selector.js +177 -0
- package/parser/table.js +114 -0
- package/src/arg.js +203 -0
- package/src/atom/hidden.js +13 -0
- package/src/atom/index.js +43 -0
- package/src/attribute.js +454 -0
- package/src/attributes.js +454 -0
- package/src/charinsert.js +97 -0
- package/src/converter.js +176 -0
- package/src/converterFlags.js +284 -0
- package/src/converterRule.js +258 -0
- package/src/extLink.js +179 -0
- package/src/gallery.js +152 -0
- package/src/hasNowiki/index.js +44 -0
- package/src/hasNowiki/pre.js +40 -0
- package/src/heading.js +134 -0
- package/src/html.js +248 -0
- package/src/imageParameter.js +277 -0
- package/src/imagemap.js +199 -0
- package/src/imagemapLink.js +41 -0
- package/src/index.js +933 -0
- package/src/link/category.js +49 -0
- package/src/link/file.js +282 -0
- package/src/link/galleryImage.js +120 -0
- package/src/link/index.js +383 -0
- package/src/magicLink.js +149 -0
- package/src/nested/choose.js +24 -0
- package/src/nested/combobox.js +23 -0
- package/src/nested/index.js +96 -0
- package/src/nested/references.js +23 -0
- package/src/nowiki/comment.js +71 -0
- package/src/nowiki/dd.js +59 -0
- package/src/nowiki/doubleUnderscore.js +56 -0
- package/src/nowiki/hr.js +41 -0
- package/src/nowiki/index.js +56 -0
- package/src/nowiki/list.js +16 -0
- package/src/nowiki/noinclude.js +28 -0
- package/src/nowiki/quote.js +69 -0
- package/src/onlyinclude.js +64 -0
- package/src/paramTag/index.js +89 -0
- package/src/paramTag/inputbox.js +35 -0
- package/src/parameter.js +239 -0
- package/src/syntax.js +91 -0
- package/src/table/index.js +984 -0
- package/src/table/td.js +339 -0
- package/src/table/tr.js +319 -0
- package/src/tagPair/ext.js +142 -0
- package/src/tagPair/include.js +50 -0
- package/src/tagPair/index.js +126 -0
- package/src/transclude.js +824 -0
- package/tool/index.js +1202 -0
- package/util/base.js +17 -0
- package/util/debug.js +73 -0
- package/util/diff.js +76 -0
- package/util/lint.js +54 -0
- package/util/string.js +107 -0
- package/bundle/bundle.min.js +0 -38
- package/extensions/editor.css +0 -60
- package/extensions/editor.js +0 -317
- package/extensions/ui.css +0 -119
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/wikiparser-node)
|
|
2
|
+
|
|
3
|
+
# 简介
|
|
4
|
+
wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/en/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析绝大部分的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。语法树的每个节点对应一个仿照 [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) 类设计的类 [Token](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token)。
|
|
5
|
+
|
|
6
|
+
# 使用方法
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
var Parser = require('wikiparser-node');
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
更多文档请查阅 [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki)。
|
|
13
|
+
|
|
14
|
+
# 目录
|
|
15
|
+
|
|
16
|
+
1. [Parser](https://github.com/bhsd-harry/wikiparser-node/wiki/Home#parser)
|
|
17
|
+
2. [AstElement](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token#astelement)
|
|
18
|
+
3. [Token](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token#token)
|
|
19
|
+
4. [CommentToken](https://github.com/bhsd-harry/wikiparser-node/wiki/02.-CommentToken等#commenttoken)
|
|
20
|
+
5. [ExtToken](https://github.com/bhsd-harry/wikiparser-node/wiki/03.-ExtToken)
|
|
21
|
+
6. [AttributeToken](https://github.com/bhsd-harry/wikiparser-node/wiki/04.-AttributeToken)
|
|
22
|
+
7. [HeadingToken](https://github.com/bhsd-harry/wikiparser-node/wiki/05.-HeadingToken)
|
|
23
|
+
8. [ArgToken](https://github.com/bhsd-harry/wikiparser-node/wiki/06.-ArgToken)
|
|
24
|
+
9. [TranscludeToken](https://github.com/bhsd-harry/wikiparser-node/wiki/07.-TranscludeToken)
|
|
25
|
+
10. [ParameterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/08.-ParameterToken)
|
|
26
|
+
11. [HtmlToken](https://github.com/bhsd-harry/wikiparser-node/wiki/09.-HtmlToken)
|
|
27
|
+
12. [TableToken](https://github.com/bhsd-harry/wikiparser-node/wiki/10.-TableToken)
|
|
28
|
+
13. [TdToken](https://github.com/bhsd-harry/wikiparser-node/wiki/11.-TdToken)
|
|
29
|
+
14. [DoubleUnderscoreToken](https://github.com/bhsd-harry/wikiparser-node/wiki/12.-DoubleUnderscoreToken)
|
|
30
|
+
15. [LinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/13.-LinkToken)
|
|
31
|
+
16. [CategoryToken](https://github.com/bhsd-harry/wikiparser-node/wiki/14.-CategoryToken)
|
|
32
|
+
17. [FileToken](https://github.com/bhsd-harry/wikiparser-node/wiki/15.-FileToken和GalleryImageToken#filetoken)
|
|
33
|
+
18. [ImageParameterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/16.-ImageParameterToken)
|
|
34
|
+
19. [ExtLinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/17.-ExtLinkToken和MagicLinkToken#extlinktoken)
|
|
35
|
+
20. [MagicLinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/17.-ExtLinkToken和MagicLinkToken#magiclinktoken)
|
|
36
|
+
21. [ConverterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/18.-ConverterToken)
|
|
37
|
+
22. [ConverterRuleToken](https://github.com/bhsd-harry/wikiparser-node/wiki/19.-ConverterRuleToken)
|
|
38
|
+
23. [选择器](https://github.com/bhsd-harry/wikiparser-node/wiki/20.-选择器)
|
|
39
|
+
24. [$ (TokenCollection)](https://github.com/bhsd-harry/wikiparser-node/wiki/21.-$-(TokenCollection))
|