deathau/txt-as-md-obsidian

Expanding editable extensions

thw26 opened this issue · 1 comments

thw26 commented

I was considering using Obsidian to edit some .fodt files to make use of Git versioning, but Obsidian doesn't recognize .fodt as flat text files, nor does it recognize .xml files.

Would it be as trivial as modifying https://github.com/deathau/txt-as-md-obsidian/blob/main/src/main.ts to add more?

It would be that easy for sure.
The way this plugin specifically is written, though, it will interpret them as markdown files, which may not be exactly what you want.

My suggestion would be to instead fork this one: https://github.com/deathau/ini-obsidian and modify it for whichever file types you want to support. For example, for XML you can basically replace ini with xml (and add fodt, etc to registerExtensions) and instead of using the "properties" mode in codemirror, grab the xml mode from CodeMirror (or my editor syntax highlight plugin here: https://github.com/deathau/cm-editor-syntax-highlight-obsidian/tree/main/mode/xml)