Support for Lightweight Markup document types

Post any comments, suggestions, annoyances or ideas for future releases here. Please do not post bug reports or questions here.
Post Reply
rbc
Posts: 15
Joined: Thu Feb 17, 2022 3:22 pm

Support for Lightweight Markup document types

Post by rbc »

I'd like to suggest the inclusion of lightweight markup document types like Markdown and ReStructured Text. They have become the defacto standards in writing project documentation, with Markdown rendering becoming common in almost all forges and RST being the backbone of Python Sphinx based documentation in the ReadTheDocs format.

While a plain text document mode still keeps these readable, having some highlighting and folding support would be extremely useful.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

Does the markup described at this link look familiar to the markup you're using: https://github.com/tree-sitter-grammars ... r-markdown

The reason I ask is because Zeus does indirectly support tree-sitter, and that means it would be theoretically possible to add support for the markup described in that tree-sitter page.

Cheers Jussi
rbc
Posts: 15
Joined: Thu Feb 17, 2022 3:22 pm

Re: Support for Lightweight Markup document types

Post by rbc »

Yes, this is exactly what I was looking for. :) Is it possible to add this to a new document type via some scripting? Apologies but I'm not very familiar with the Macro APIs of Zeus.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

There is no way make these tree-sitter changes via the user configuration screens. Zeus uses the C file produced by tree-sitter itself, and it has to be built into Zeus itself.

In any case the latest version of Zeus includes support for that tree-sitter Markdown and it can be found here: https://www.zeusedit.com/download.html

IMPORTANT: Make sure you do not install this over you current Zeus and in fact make sure you re-name you current Zeus install out of the way.

This version adds a new Markdown document type that understands files with the .md extension. You can add other markdown extensions to that document type as needed.

Cheers Jussi
rbc
Posts: 15
Joined: Thu Feb 17, 2022 3:22 pm

Re: Support for Lightweight Markup document types

Post by rbc »

Thank you Jussi, I tried this out and it works! I'll be applying for an upgrade soon :D

Just a couple of points to note:
  1. The unordered list using * bullets seem to have black background no matter what theme is selected. I usually use the colorscheme white and it looks a bit off with it. Upon exploring, its probably the Field value in the document type coloring options, which I can easily change. But just thought you should know.
    zeus-md.png
    zeus-md.png (9.529999999999999 KiB) Viewed 4595 times
  2. There is no code folding for this document type. In the future, this might be a great feature to have since it allows the use of Zeus as a lightweight outliner with MD highlighting.
Again, thank you for being so responsive and accommodating.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

Can you use the code tags (i.e. the </> button from above) to wrap a small a sample code that shows this coloring problem.

With that sample, it should be easy enough to fix ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

The latest Zeus 3.99bt release can be downloaded from here: https://www.zeusedit.com/download.html

That version has several improvements for syntax coloring the markdown language.

If any issues are found with that version, a reply with some example markdown showing errors found with that version should be added to this thread.

Cheers Jussi
rbc
Posts: 15
Joined: Thu Feb 17, 2022 3:22 pm

Re: Support for Lightweight Markup document types

Post by rbc »

Thank you for including the Markdown document type by default Jussi. Just to highlight the issue I was mentioning above, the code snippet to reproduce.

Code: Select all

# My heading
* This is a list item
* Now the 2nd item
  - An indented bullet
I think the default color scheme for the document type is Black Mamba. When I switch the color scheme to White the bullet symbols * and - remain with the black background, and the experience is a bit jarring.

Its not a very big deal, since it is an easy fix by going to the Document Type options and changing the Coloring -> Field category to have a uniform white background. Just thought you should know.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

Thanks for the bug report. There is definitely a bug in that white scheme with a file with this markup text.

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Support for Lightweight Markup document types

Post by jussij »

The fix for this issue is a as follows:
  1. Select the White color scheme for the Markdown Document type and that will then highlight the painting issue shown in the image above.
  2. To fix the issue, edit the Markdown Document Type and select the Coloring panel
  3. Then select the Category list
  4. Used the down key to move down through the different categories of that list, pay close attention to the background color
  5. You should notice some categories have a background color defined as black (pay attention to the bottom most, right most square).
  6. For any category showing a black background, redefine that to be white.
  7. Apply the changes.
  8. Do a file Save As to replace the White color scheme with the corrected values.
This change will be in place for the next official Zeus release.

Cheers Jussi
Post Reply