Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW5-Syntax 2.0.0 Released #8197

Open
joshuafontany opened this issue May 19, 2024 · 8 comments
Open

TW5-Syntax 2.0.0 Released #8197

joshuafontany opened this issue May 19, 2024 · 8 comments

Comments

@joshuafontany
Copy link
Contributor

TW5 Syntax v2.0.0 HAS BEEN RELEASED!!!!!

https://marketplace.visualstudio.com/items?itemName=joshua-fontany.tw5-syntax

2.0.0

  • scopeName text.html.tiddlywiki5
  • Full re-write to model tiddlywiki5 wikitext as a text.html.derivative style sytanx.
  • Updated syntax json version to current Tiddlywiki5 v5.3.4.
  • Updated known keywords/grammar concepts in json repository.
  • Imported full html5 syntax from tm-grammar, added tiddlywiki style attributes, etc.
  • New objects from text.html.basic renamed as htmlwidget-* for easy diff/updates.
  • Added snippets for modern tiddlywiki5 wikitext.
  • Added full set of automated tests to ./tests. Run npm run test to run all tests.
  • Added syntax highlihgting for tests files that marks the # ^ test.commment.with.expected.scopes lines appropriately.
  • Added reference required syntaxes to devDependecies in package.json
  • Fixed bugs with widget attribute syntax in base html tags
  • Fixed syntax bugs with macros
  • Fixed sytax bugs with block quotes
  • Fixed syntax bugs with image links
  • Fixed syntax bugs with links
  • Fixed bugs with horizontal rules
  • Fixed bugs with list quotes
  • Fixed bugs with codeinline, codeblock, typedblock.
  • Added .tw|.tw5|.tiddlywiki|.tiddlywiki5|text/vnd.tiddlywiki to #typedblock.
  • Added tw|tw5|tiddlywiki|tiddlywiki5 to #codeblock

This Text Mate Grammar compatible syntax is twice as big as the official html5 syntax, literally <5K lines of regex to text.html.basic's 2,500~ish lines of regex. 😎

I would LOVE to get this into tiddlywiki somehow, so we can have full syntax highlighting INSIDE of the "code" edit-templates. I think the best option at this point would be to try to adapt TW5-Monaco.

I have forked that here to work on the concept over the next few weeks: https://github.com/joshuafontany/tw5-monaco

@joshuafontany
Copy link
Contributor Author

joshuafontany commented May 19, 2024

@pmario
Copy link
Contributor

pmario commented May 19, 2024

@joshuafontany

This is really great stuff, but the predefined snippets are a pain. I would like to contribute. I think I do understand the snippet syntax.

But I need some help with testing -- If I make changes to the snippets.json. How can I test the changes locally? before creating a PR

@pmario
Copy link
Contributor

pmario commented May 19, 2024

I did find it. I only needed to install the dev-dependencies and then run the extension code with F5 - Thx for the great work.

You can expect quite some snippent PRs shortly.

@Jermolene
Copy link
Owner

I would LOVE to get this into tiddlywiki somehow, so we can have full syntax highlighting INSIDE of the "code" edit-templates. I think the best option at this point would be to try to adapt TW5-Monaco.

I'm all in favour if that is a quicker route than porting the syntax highlighter to CodeMirror. It does look like TW5-Monaco needs quite a lot of work, for example to make it work offline with a single file wiki.

@joshuafontany
Copy link
Contributor Author

Hi. After further research, it seems that Monaco Editor is not recommended for mobile use, and cannot be feature-complete when loaded from file:// uris. That's not going to work out for my use-cases, so we pivot and see how complex recreating this for Code-Mirror will be. Anyone reading this with CodeMirror syntax resources, feel free to drop them here.

@Jermolene
Copy link
Owner

Hi @joshuafontany I had a quick look at the gory details of the TW5 textmate grammar, it's quite an undertaking. It's very disappointing about Monaco, but I'm sure a CodeMirror port of TW5-syntax would be very well received were such a thing to be possible.

@btheado
Copy link
Contributor

btheado commented May 26, 2024

https://gk0wk.github.io/TW5-CodeMirror-Enhanced/ - this plugin includes code which provides syntax highlighting for TW5 syntax.

@Jermolene
Copy link
Owner

Thanks @btheado, and congratulations @Gk0Wk – I did not realise your plugin includes syntax highlighting.

It would be great to get some of those enhancements into the core plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants