Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Compatibility with Obsidian Linter #2211

Open
N4M3Z opened this issue Jan 13, 2025 · 1 comment
Open

FR: Compatibility with Obsidian Linter #2211

N4M3Z opened this issue Jan 13, 2025 · 1 comment

Comments

@N4M3Z
Copy link

N4M3Z commented Jan 13, 2025

Is your feature request related to a problem? Please describe.

Obsidian Linter compatiblity, specifically relevant now that the new default is .md instead of .excalidraw.md which makes it difficult to exclude by filename

Describe the solution you'd like

Seeing as you can simply disable linter following the frontmatter using %%linter-disable%% (see https://platers.github.io/obsidian-linter/usage/disabling-rules/), I don't see why the "Linter compatibility" option simply doesn't auto-include %%linter-disable%% into every Excalidraw file right after frontmatter. This also allows us to use linter to lint the frontmatter and leave the Excalidraw content untouched.

Real-life usage scenarios

Using Obsidian Linter with Excalidraw requires no further configuration if one makes their Excalidraw files look like this:

---
myfrontmatter: ...
tags:
  - excalidraw
excalidraw-plugin: parsed
---

%%linter-disable%%
==⚠  Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠==  ...

Describe alternatives you've considered

Disabling Linting on Save, using Linter ignore files and

---
disabled rules: [all]
---

which is another way to solve this.

Additional context

Here is some text
<!-- linter-disable -->
                          This area will not be formatted
<!-- linter-enable -->
More content goes here...
%%linter-disable %%
                          This area will not be formatted
%%linter-enable%%
@N4M3Z N4M3Z changed the title FR: FR: Compatibility with Obsidian Linter Jan 13, 2025
@zsviczian
Copy link
Owner

"I don't see why the "Linter compatibility" option simply doesn't auto-include %%linter-disable%% into every Excalidraw file right after frontmatter."

I don't use linter, I was not aware of the option. Thanks for pointing it out.

But thinking about it... The linter compatibility option is for people who use two-sided notes and want their markdown to be linted. So I am not sure turning this on by default would be preferred by everyone. The issue with Linter and every other plugin that modifies files automatically is it conflicts with the Excalidraw save process and can lead to corrupted files.

I am however not sure I want to add linter specific tags to the plugin:

  • Linter might change in the future and the function will break.
  • You already recommend 3 different ways to configure linter, I am sure people will have their different preferences. I am not prepared to go down this route of trying to please all these options.

You can always set up an Excalidraw template file for your own use with the desired exclusion option.

It would be great if you could author a wiki entry about linter compatibility options. You can just provide the wiki content right here as a response and I will publish it on the https://excalidraw-obsidian.online wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants