[Release] Codemirror6 Plugin

Hi @oeyoews

Enhancing the templates

Please see Edit Toolbar: Apply Template - Tips & Tricks - Talk TW

What I want to propose here is to handle the meta tags, fields. This way a template can have any name and any number of fields, BUT the code will require a meta tag like $:/tags/Template to recognize a template and two meta fields: tpl-caption to store a short name and tpl-description to store a longer description. The code when applies a template takes care of meta fields/tags to remove them. You can see in $:/kookma/ui/Buttons/apply-templates how meta fields/tags are removed.

I discovered Codemirror recently. I wonder if there is a way to get autocomplete suggestions for macros defined by other plugins. For example, I have Tamasha installed on the same wiki. It defines a presenter macro but it doesn’t seem to be available in the Codemirror autocomplete dropdown for macros.

Currently the plugin only supports querying js macros, not wikitext macros. Others seem to have used regular expressions to achieve this function.

Thank you for the information. I understand that the best way to achieve this would be to use the Autocomplete plugin and to define custom triggers. Which does make a lot of sense, by the way.

Unfortunately, AutoComplete does not work with CodeMirror 6.

I did look at the regular expression matching of autocomplete, and obviously as the autocomplete plugin said, this implementation is not perfect, and the best way is to support it directly through tiddlywiki core. I haven’t had time to study this yet.

$__plugins_oeyoews_tiddlywiki-codemirror-6.json (1.0 MB)

  • This is a test version of codemirror6. There are not many differences. It only uses the latest library, adds the initial height of the editor, optimizes the user experience, and the icon set has been split into a sub-plugin.
1 Like

I believe I have previously raised this question: CM6 recognizes a middle line ! or !! as a header. How can this issue be resolved?

Unfortunately, I am not good at the syntax of the codemirror syntax highlighting implementation. I did this just as an experiment. I do have many questions here. If I want to solve this, I may need to invest more time.

It took me quite some time to finish this plugin, so I plan to stop for a while.

1 Like

I will disable the wikitext syntax highlighting, which I believe should resolve the issue.