wikiparser-node 1.0.1-b → 1.0.3-b
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.en.md +57 -0
- package/README.md +5 -1
- package/bundle/bundle.min.js +31 -32
- package/extensions/dist/base.js +3 -38
- package/extensions/dist/editor.js +59 -59
- package/extensions/dist/highlight.js +1 -8
- package/extensions/dist/lint.js +28 -23
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +7 -7
package/README.en.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/wikiparser-node)
|
|
2
|
+
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/codeql.yml)
|
|
3
|
+
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/node.js.yml)
|
|
4
|
+
|
|
5
|
+
# Other Languages
|
|
6
|
+
|
|
7
|
+
- [简体中文](./README.md)
|
|
8
|
+
|
|
9
|
+
# Introduction
|
|
10
|
+
|
|
11
|
+
wikiparser-node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
12
|
+
|
|
13
|
+
# Other Versions
|
|
14
|
+
|
|
15
|
+
## Mini (also known as [wikilint](https://www.npmjs.com/package/wikilint))
|
|
16
|
+
|
|
17
|
+
This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It is used in the [eslint-plugin-wikitext](https://www.npmjs.com/package/eslint-plugin-wikitext) plugin.
|
|
18
|
+
|
|
19
|
+
## Browser
|
|
20
|
+
|
|
21
|
+
A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with the [CodeMirror5](https://codemirror.net/5/) editor. ([Usage example](https://bhsd-harry.github.io/wikiparser-node))
|
|
22
|
+
|
|
23
|
+
# Installation
|
|
24
|
+
|
|
25
|
+
## Node.js
|
|
26
|
+
|
|
27
|
+
Please install the corresponding version as needed (`wikiparser-node` or `wikilint`), for example:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm i wikiparser-node
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
or
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm i wikilint
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Browser
|
|
40
|
+
|
|
41
|
+
You can download the code via CDN, for example:
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
or
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For more browser extensions, please refer to the corresponding [documentation](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser.en).
|
|
54
|
+
|
|
55
|
+
# Usage
|
|
56
|
+
|
|
57
|
+
Please refer to the [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Home.en).
|
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/codeql.yml)
|
|
3
3
|
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/node.js.yml)
|
|
4
4
|
|
|
5
|
+
# Other Languages
|
|
6
|
+
|
|
7
|
+
- [English](./README.en.md)
|
|
8
|
+
|
|
5
9
|
# 简介
|
|
6
10
|
|
|
7
11
|
wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析几乎全部的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。
|
|
@@ -46,7 +50,7 @@ npm i wikilint
|
|
|
46
50
|
<script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
更多浏览器端可用的插件请查阅对应[文档](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser)。
|
|
50
54
|
|
|
51
55
|
# 使用方法
|
|
52
56
|
|