wikiparser-node 0.7.0-b → 0.7.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.
Files changed (84) hide show
  1. package/README.md +39 -0
  2. package/config/default.json +832 -0
  3. package/config/llwiki.json +630 -0
  4. package/config/moegirl.json +728 -0
  5. package/config/zhwiki.json +1269 -0
  6. package/index.js +321 -0
  7. package/lib/element.js +611 -0
  8. package/lib/node.js +772 -0
  9. package/lib/ranges.js +130 -0
  10. package/lib/text.js +215 -0
  11. package/lib/title.js +80 -0
  12. package/mixin/attributeParent.js +117 -0
  13. package/mixin/fixedToken.js +40 -0
  14. package/mixin/hidden.js +21 -0
  15. package/mixin/singleLine.js +31 -0
  16. package/mixin/sol.js +65 -0
  17. package/package.json +11 -9
  18. package/parser/brackets.js +120 -0
  19. package/parser/commentAndExt.js +62 -0
  20. package/parser/converter.js +46 -0
  21. package/parser/externalLinks.js +33 -0
  22. package/parser/hrAndDoubleUnderscore.js +38 -0
  23. package/parser/html.js +42 -0
  24. package/parser/links.js +94 -0
  25. package/parser/list.js +59 -0
  26. package/parser/magicLinks.js +41 -0
  27. package/parser/quotes.js +64 -0
  28. package/parser/selector.js +177 -0
  29. package/parser/table.js +114 -0
  30. package/src/arg.js +203 -0
  31. package/src/atom/hidden.js +13 -0
  32. package/src/atom/index.js +43 -0
  33. package/src/attribute.js +420 -0
  34. package/src/attributes.js +452 -0
  35. package/src/charinsert.js +97 -0
  36. package/src/converter.js +176 -0
  37. package/src/converterFlags.js +284 -0
  38. package/src/converterRule.js +258 -0
  39. package/src/extLink.js +179 -0
  40. package/src/gallery.js +151 -0
  41. package/src/hasNowiki/index.js +44 -0
  42. package/src/hasNowiki/pre.js +40 -0
  43. package/src/heading.js +134 -0
  44. package/src/html.js +248 -0
  45. package/src/imageParameter.js +277 -0
  46. package/src/imagemap.js +199 -0
  47. package/src/imagemapLink.js +41 -0
  48. package/src/index.js +913 -0
  49. package/src/link/category.js +49 -0
  50. package/src/link/file.js +282 -0
  51. package/src/link/galleryImage.js +120 -0
  52. package/src/link/index.js +383 -0
  53. package/src/magicLink.js +149 -0
  54. package/src/nested/choose.js +24 -0
  55. package/src/nested/combobox.js +23 -0
  56. package/src/nested/index.js +96 -0
  57. package/src/nested/references.js +23 -0
  58. package/src/nowiki/comment.js +71 -0
  59. package/src/nowiki/dd.js +59 -0
  60. package/src/nowiki/doubleUnderscore.js +56 -0
  61. package/src/nowiki/hr.js +41 -0
  62. package/src/nowiki/index.js +56 -0
  63. package/src/nowiki/list.js +16 -0
  64. package/src/nowiki/noinclude.js +28 -0
  65. package/src/nowiki/quote.js +69 -0
  66. package/src/onlyinclude.js +64 -0
  67. package/src/paramTag/index.js +89 -0
  68. package/src/paramTag/inputbox.js +44 -0
  69. package/src/parameter.js +239 -0
  70. package/src/syntax.js +91 -0
  71. package/src/table/index.js +984 -0
  72. package/src/table/td.js +339 -0
  73. package/src/table/tr.js +319 -0
  74. package/src/tagPair/ext.js +138 -0
  75. package/src/tagPair/include.js +60 -0
  76. package/src/tagPair/index.js +126 -0
  77. package/src/transclude.js +824 -0
  78. package/tool/index.js +1202 -0
  79. package/util/base.js +17 -0
  80. package/util/debug.js +73 -0
  81. package/util/diff.js +76 -0
  82. package/util/lint.js +54 -0
  83. package/util/string.js +107 -0
  84. package/bundle/bundle.min.js +0 -40
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ [![npm version](https://badge.fury.io/js/wikiparser-node.svg)](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))