Codeblock Syntax Highlighting support for more languages

Codeblock syntax highlighting is supported by CodeMirror mode. According to its website, it supports tons of languages. But from the source code of Logseq, it only used a few of those modes. So is it possible to get syntax highlighting for more languages (would be better for all those languages listed in CodeMirror mode page)?

2 Likes

Hi I totally agree, I would love to see logseq supports more language / format for example yaml, bash and many others!

Use Highlight.js for this feat, but yes I do agree.

How do you use highlight.js with the desktop app? Or are you using the browser version?

Update: Multiple new languages were added. Will be available in the next release!

All languages supported by CodeMirror 5.x has been added. Will move this to the archive. Please let me know if there is any missing languages you would like to see implemented.

1 Like

Though several languages were added, I’m still missing Elixir :grimacing: CodeMirror does not support it out of the box, as they are encouraging people to write their own language modes instead of maintaining tons of languages.

I have opened a PR to add Elixir language mode and I’m currently using this fork for my local graphs :slightly_smiling_face: However, it would be amazing to have Elixir work out-of-the-box with logseq :rocket: :

For context: I’m testing logseq at the moment for my personal and work private journals, but I’d like to extend its use to build an “organization brain” at work. Our stack consists mainly of Typescript and Elixir, so that’s why I wanted to have support for Elixir :grimacing:

Is there any further movement on adding extra Language support? The PR has not had much activity. I use nix a lot and not having syntax highlighting support in Logseq is quite a pain. There is an existing extension for nix by the folks at replit (GitHub - replit/codemirror-lang-nix: A Nix language mode for CodeMirror 6).

Would really like it if there was a way to extend Logseq’s CodeMirror to support extensions.

You can extend it using a plugin I believe.