Zulip Chat Archive
Stream: general
Topic: New Plugin for Obsidian
Tomaz Mascarenhas (Feb 27 2024 at 19:13):
Hi people,
I would like to share a plugin that I wrote for Obsidian, which provides syntax highlight for Lean codeblocks: https://github.com/tomaz1502/lean-syntax-highlight
It is already available in the "community plugins" section, so you can use by simply browsing and installing it with the plugin manager.
I would love to hear your feedback :) (also, please note that this is the very first javascript code I wrote) (yes, I like Lean to the point of learning a bit javascript because of it)
Eric Wieser (Feb 27 2024 at 21:18):
It might be worth publishing a standalone codemirror package for Lean too; in principle that would give us syntax highlighting in the github editor too, but in practice we can't have nice things when it comes to highlighters (GitHub doesn't support anything but first-party highlighters, and CodeMIrror doesn't accept new languages)
Eric Wieser (Feb 27 2024 at 21:20):
@Bryan Gin-ge Chen wrote a CodeMirror highlighter for Lean 3 at https://observablehq.com/@bryangingechen/hello-lean-prover#initCodeMirrorLeanMode, which might have some tricks you could copy
Tomaz Mascarenhas (Feb 28 2024 at 11:56):
Given their response in your comment, maybe we can get the nice things by sending a ticket to Github? But yeah, I will publish an npm package either way.
Jireh Loreaux (Jul 31 2024 at 19:25):
@Tomaz Gomes it seems the Obsidian plugin is broken. Do you happen to know of an easy fix?
I saw your open PR for Prism, which would solve this outright. Maybe we can get some more eyes :eyes: on that and get people to comment.
Tomaz Mascarenhas (Jul 31 2024 at 19:45):
Hm, I just updated Obsidian and did some quick tests and it seems working here. Could you share which steps you took?
Tomaz Mascarenhas (Jul 31 2024 at 19:46):
I agree, if the PR was merged then we would get for free highlight for Lean in Obsidian and in many other places that rely on Prism. Unfortunately it seems that the repository have not been maintained for a while :(
Jireh Loreaux (Jul 31 2024 at 20:53):
Hmmm... strange. It stopped working on one machine yesterday, and then today it wouldn't load on another machine either. But I just tested again and it seems to be working. Will post again if I can repro. Sorry for the noise.
Last updated: May 02 2025 at 03:31 UTC