Open yangsu opened 4 years ago
I think it's at least partially supported now with the css themes launch
Is there any language in particular you would like us to support? We use CodeMirror, so we could add any of these languages.
This list is a good place to start.
https://insights.stackoverflow.com/survey/2019#most-popular-technologies
My vote is on R and Python, but I think all the languages in @yangsu's link are supported by CodeMirror, so if enabling them is a simple question of changing a line in a config - catch 'em all! :)
Please, just support all of them. It's a bizarre limitation to only allow Clojure, Javascript, and CSS. There's no obvious reason to leave any out.
For me Java, JavaScript, HTML, C++, Python, SQL (ZetaSQL flavor) would cover most that I need.
But I would also recommend just supporting everything CodeMirror allows. For such a long list I think it would also be a good idea to change the language picker widget to be a combobox (i.e., allowing selecting language from a list, with filtering by typing).
Also please add a plaintext without highlighting option.
Please, just support all of them. It's a bizarre limitation to only allow Clojure, Javascript, and CSS. There's no obvious reason to leave any out.
Seconding this. I'd really like to be able to highlight C, Pyton and Rust personally.
There are a lot of Roam users that are programmers and supporting the list that @yangsu shared is a good start if it isn't too much trouble -- I definitely use languages lower on that StackOverflow list regularly and keep RR notes on them, like Elixir. An alternative, although less idea, but if easy, would just let us not specify a language and allow us to type plaintext such that we don't get weird syntax highlighting for unsupported langs
YAML and JSON plz, or at least a raw text for blocks which aren't supported :)
A popular language that I’d like to call out specifically is Typescript. It’s high on the popular languages list provided by @yangsu but doesn’t seem appear on the code mirror list. I hope it doesn’t get left out for that reason.
This is another good resource based on GitHub activity. https://madnight.github.io/githut/#/pull_requests/2020/2
Fourth vote for the list that @yangsu linked, though my personal top three are bash/sh, PowerShell, and Go or Python.
(Edit: Why did I write JavaScript for the last option?)
Lua, AppleScript, Swift are the more unusual ones I’d need, but like they say, dump the lot in. There’s always going to be outriders.
+1 on adding more languages. It would help with anyone who touches code to some capacity. For me, I would like to see Python, C, C++, C#, but I feel as though even more languages should be supported. Ideally, Roam would support all languages that Notion does. Thanks for looking into this!
A recent update finally got around to adding more than the ridiculously limited previous list of CSS, Javascript, and Clojure, but it's still severely limited. This is very frustrating. There is no reason for this limitation! Please, just support all of the languages in CodeMirror. This is what GitHub and most others do at this point.
Think of yourselves using someone else's tool: there's no way Clojure would be on any top-10 list, so you'd be totally out of luck trying with your own language of choice.
If you want to limit the options in the main language choice dropdown to keep it really short without any extra UI effort, fine — but at the very least we should be able to specify any supported language in the code block prefix.
If there is a concern about supporting all the languages in CodeMirror, a plaintext
option would be great. No highlighting is better than incorrect highlighting.
Also, if you allowed any CodeMirror language in the code block prefix, like @jrk suggested, but didn't want to support that language yet, we'd be able to specify it, and benefit from that language's highlighting in the future when it is supported, defaulting to plaintext until then.
👍 to allowing plaintext
if language isn't supported. I add a lot of Elixir and Erlang code blocks, so specifically those. JSON would be good too (can use javascript
, but not exactly the same thing), as well as CSV.
If I could add a vote for Go, it would be super appreciated 😃
I'd appreciate it if the experience writing a code block is just like in Typora.
Describe the problem
Adding support for syntax highlighting in code blocks would be great.
Feature implementation
Ideally, it would work like GFM's syntax highlighting, which allows you configure the language using the following syntax
Github uses Linguist.
Alternatively, you can use highlight.js, which auto detects the language in the code block. It's supported languages list is less extensive than Linguist's, but should be sufficient for most use cases.