Monaco-Wiki registers the Wikitext language in the Monaco Editor. It is a web version of the Visual Studio Code extensions developed by Rowe Wilson Frederisk Holme and Bhsd. The TextMate grammar is substantially revised to be site-specific and more accurate.
You may load the Monaco Editor on your own:
import * as monaco from 'https://cdn.jsdelivr.net/npm/monaco-editor/+esm';
import registerWiki from 'https://cdn.jsdelivr.net/npm/monaco-wiki';
await registerWiki(
monaco,
false, // Set to `true` if used in a MediaWiki site
);
or simply:
// Automatically loads the Monaco Editor's core and relevant workers
import 'https://cdn.jsdelivr.net/npm/monaco-wiki/dist/all.min.js';
await monaco; // The global `monaco` is a promise that resolves to the Monaco editor
- wikitext
- wiki
- mediawiki
Name | ID |
---|---|
Monokai | monokai |
Nord | nord |
If you wish to use other themes listed here, please submit a feature request.
- Preformatted text with a leading space is not supported.
- Bracket pair colorization is imperfect for Wikitext (Example), especially for 4 consecutive braces (Examples 1, 2).
- Not error-tolerant (Example).
- Interaction between table cells and
<nowiki>
(Example). - Disallowed HTML tags (Example).
- Multiline template names (Example) and link targets (Example).
- Template names containing comments (Examples 1, 2).
- Template parameter names containing newlines or comments (Example).
- Wikitext in template parameter names (Example).
- HTML tag breaking template syntax (Examples 1, 2).
- Bracket pair inside link text (Example).
- Double URI encoding in link targets (Example).
- Double HTML escaping in link targets (Example).
- Nested internal link in internal/external links (Examples 1, 2).
- Interaction between external links and template parameters (Example).