|
| 1 | +# CodeMirror-Mode-TiddlyWiki5 |
| 2 | + |
| 3 | +Adds Syntax Highlighting for TiddlyWiki5 tiddlers (`text/vnd.tiddlywiki`) to the CodeMirror, along with some other useful editor addon (wikilink hint, macro hint, etc.). Now is under development. |
| 4 | + |
| 5 | +为TiddlyWiki的CodeMirror编辑器添加TiddlyWiki5(`text/vnd.tiddlywiki`)语法高亮,同时还有其他有用的编辑器插件(如Wiki链接自动提示、宏提示等)。现在正在开发中。 |
| 6 | + |
| 7 | +[> 中文README <](https://github.com/Gk0Wk/CodeMirror-Mode-TiddlyWiki5/blob/main/README.md) |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +[TOC] |
| 12 | + |
| 13 | +## Plugin description |
| 14 | + |
| 15 | +Add [CodeMirror](http://codemirror.net) support for TiddlyWiki5 syntax highlighting, all tiddlers with MIME type left blank or `text/vnd.tiddlywiki` will be highlighted. Also supports real-time code completion hints like `VSCode` while typing (currently only WikiLink completion is implemented) and **no need** to activate with `Ctrl+Space`. |
| 16 | + |
| 17 | +Plugin is still under development, if you have any suggestions or bugs, please directly mention Issues. |
| 18 | + |
| 19 | +## Installation & Compilation |
| 20 | + |
| 21 | +<span style="color: red; font-weight: 900;">First install the latest version of CodeMirror main plugin and CodeMirror XML sub-plugin (otherwise it will report an error).</span> |
| 22 | + |
| 23 | +Go directly to [Release](https://github.com/Gk0Wk/CodeMirror-Mode-TiddlyWiki5/releases) and download `CodeMirrorModeTiddlyWiki5-X.X.X.json`, then drag and drop it into your TiddlyWiki, or import it in TiddlyWiki. |
| 24 | + |
| 25 | +If the plugin reports an error, there is no need to panic, because the plugin does not make changes to your TiddlyWiki content, so just uninstall it and you will be able to eliminate the problem, but to be on the safe side **it is still recommended to backup it before installing it**. |
| 26 | + |
| 27 | +If you want to DIY and compile, please run `make` or `make build` directly. Note that it is the `xxx.min.js` and `xxx.min.css` that are packaged. |
| 28 | + |
| 29 | +## Function Introduction |
| 30 | + |
| 31 | +<details> |
| 32 | +<summary>TiddlyWiki5 syntax highlighting, support for inline code blocks and syntax highlighting for LaTeX</summary> |
| 33 | + |
| 34 | +Default: |
| 35 | + |
| 36 | + |
| 37 | +Ayu-Dark: |
| 38 | + |
| 39 | + |
| 40 | +TiddlyWiki: |
| 41 | + |
| 42 | + |
| 43 | +</details> |
| 44 | + |
| 45 | +Note: Some of these themes are installed by myself, if you are interested in changing the theme, please read TiddlyWiki's CodeMirror's README. |
| 46 | + |
| 47 | +<details> |
| 48 | +<summary>WikiLink Auto Hint</summary> |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +</details> |
| 53 | + |
| 54 | +Other features are under development. |
| 55 | + |
| 56 | +## Development Thoughts |
| 57 | + |
| 58 | +After using TiddlyWiki, I've been suffering from the lack of highlighting support in TiddlyWiki5 syntax, and the writing experience is not very good. I have found some solutions on the web, for example, on the [Google Group](https://groups.google.com/g/tiddlywiki/c/c3y-PycRP4M) someone suggested [Hack with TiddlyWiki2 syntax](https://www.gitmemory.com/issue/Jermolene/TiddlyWiki5/3685/770313436), but this approach is not perfect. |
| 59 | + |
| 60 | +An extended version of CodeMirror has also been written that is available [TW5-CodeMirror-Plus](https://github.com/adithya-badidey/TW5-codemirror-plus), which is available but has two problems. One is that the syntax highlighting is limited. The other is that the plugin is developed directly based on theme rather than mode, which leads to that **if you want to use TW5's highlighting you have to discard other syntax highlighting and can't customize the theme**. So eventually I plan to write one myself :D |
| 61 | + |
| 62 | +This plugin is also based on [TW5-CodeMirror-Plus](https://github.com/adithya-badidey/TW5-codemirror-plus) at the beginning, but I made a lot of changes on it, now they're basically two different plugins. |
| 63 | + |
| 64 | +## TODO List |
| 65 | + |
| 66 | +- [x] Syntax highlighting and indentation within code blocks. |
| 67 | +- [x] LaTeX formula highlighting and indentation. |
| 68 | +- [x] WikiLink AutoHint. |
| 69 | +- [ ] Other code hints. |
| 70 | +- [ ] Code error checking. |
| 71 | +- [ ] Mouse hovering over LaTeX code enables formula preview. |
0 commit comments