Zachatoo / obsidian-css-editor

Edit CSS snippets in Obsidian.
MIT License
57 stars 2 forks source link

Add support for javascript (and python?) #17

Closed holroy closed 2 weeks ago

holroy commented 6 months ago

I know this plugin is called css-editor and that for a reason, but I would love if this plugin had the option to also edit javascript files. So do you know if that is at all possible, and what kind of changes would be needed to get it up and running as a javascript editor also?

Zachatoo commented 6 months ago

I have no plans to support other languages with this plugin, you are free to create a separate plugin for that use case. I want to keep the scope of this plugin as small as possible, just editing CSS files.

It is possible to add other language support. I added CSS support using the @codemirror/lang-css package. I'm sure there is similar language support provided by the CodeMirror team for other common languages.

holroy commented 6 months ago

I see your reasoning, and I don't oppose them. But if you had some pointers as to how I would proceed in making a new "obsidian-js-editor" using the same logic as you've used, it would be appreciated.