-
Notifications
You must be signed in to change notification settings - Fork 3
wikiparse (EN)
This is a global variable added by the browser extension, which can perform various operations such as highlighting static code or text boxes, reporting potential grammar errors, etc.
Expand
param: Record<string, string>
Set the language. The default language is English, and other preset languages include Simplified Chinese and Traditional Chinese.
const i18n = await (await fetch('https://bhsd-harry.github.io/wikiparser-node/i18n/zh-hans.json')).json();
wikiparse.setI18N(i18n);Expand
param: Config
Set the parsing configuration. Preset configurations include Chinese Wikipedia (zhwiki), Moegirlpedia (moegirl) and LLWiki (llwiki). To customize the parsing configuration of a MediaWiki site, please refer to .schema.json for the relevant content.
const config = await (await fetch('https://bhsd-harry.github.io/wikiparser-node/config/zhwiki.json')).json();
wikiparse.setConfig(config);Expand
returns: Promise<Config>
Get the parsing configuration.
const config = await wikiparse.getConfig();Expand
param: string Wikitext
param: boolean Whether to be transcluded, default to false
returns: Promise<LintError[]>
Report potential grammar errors.
const errors = await wikiparse.lint('[[a]');Expand
Requires Highlight extension.
param: HTMLElement The HTML element for the static code
param: boolean Whether to be transcluded, default to false
param: boolean Whether to add line numbers, default to false
param: number The starting value of line numbers, optional
returns: Promise<void>
Highlight static code.
wikiparse.highlight(document.getElementsByTagName('pre')[0], false, true);Expand
Requires Editor extension.
param: HTMLTextAreaElement Text box
param: boolean Whether to be transcluded, default to false
Highlight text box.
wikiparse.edit(document.getElementsByTagName('textarea')[0]);See Linter.
对维基文本批量执行语法检查的命令行工具
轻量级的维基模板解析器
维基文本语言服务器协议实现
用于维基文本的 VS Code 扩展
A command-line tool that performs linting on Wikitext in bulk
A lightweight Wikitext template parser
An implementation of the Language Server Protocol for Wikitext
VS Code extension for Wikitext