I have 1000s of plain text notes (files) I want to import, which I have done. But they were created with a fixed-width font and have characters that markdown is trying to render as format codes.
I could edit every file and prefix / postfix with the three back-ticks, but really, I would also want that for every single note going forward as well. Ultimately, I don’t really care about formatting and really just want a better organizational system than vim and grep.
Before I dive too deeply in the API, is it possible to hook loading of notes and force them to be code blocks? Are there other options?
Thanks for telling me about that. It does somewhat help. But lines that start with hashtag # (aka a comment line in a source snippet) are still rendered has large text headings.
Though, it gives me an idea; I wonder if I can make a snippet or theme that is basically gives all md codes a no-op rendering.
give this css snippet a try. save it as a .css file to [vault]/.obsidian/snippets and enable it in Settings > Appearance > CSS Snippets
the css class .is-live-preview sort of gives u the if-else toggle – for this snippet to apply, you will have to go to Settings > Editor > Default Editing Mode and select Source Mode. In Live Preview it will still formatted per default.
this should remove all the usual formatting.
/* remove formatting and set font to single size monospace */
.markdown-source-view:not(.is-live-preview) * {
background: unset !important;
color: unset !important;
font-size: 1rem !important;
font-weight: unset !important;
font-family: monospace !important;
}
/* in case themes uses ::after div formatting for borders and so on */
.markdown-source-view:not(.is-live-preview) *::after {
border: unset !important;
}
wow! this is very promising. i appreciate you putting that together for me. i only got as far as setting the font last night and other minor tweaks, but initial test shows this is basically what i’m looking for. thanks!
You could also switch all the problematic files to .txt, and then install and use the plaintext community plugin to edit them when necessary. (I don’t think it applies any markdownish styling to these files, it just lets you view/edit them.)