obsidian-community / obsidian-hub

Resource hub for Obsidian resources.
https://publish.obsidian.md/hub
693 stars 148 forks source link

FR: Use a markdown formatter for consistency #31

Open SkepticMystic opened 2 years ago

SkepticMystic commented 2 years ago

I propose that we use a formatter to keep things consistent. I personally use Prettifier, but we could totally use a different one. We can put a Prettifier config file in the vault so that everyone uses the same settings.

Alot of the time, I run my Prettifier without even thinking, and then there are alot of small formatting changes added to the diff

konhi commented 2 years ago

Cool idea! If we don't want to make it harder for contributors, auto-formatting with GitHub Actions could be done as well.

SkepticMystic commented 2 years ago

Good idea! I'm fine with either. We can point to the same Prettifier config file, so that users can format notes while editing, too

argenos commented 2 years ago

I'd vote for making it work with GitHub actions.... ideally folks edit using Obsidian directly and there are no barriers on how to set up the linter/setting up a plugin (is there one for this?)/having technical knowledge to debug if something doesn't work.

argenos commented 2 years ago

One more thought: GitHub actions also allow folks to submit changes from GitHub's web interface.

SkepticMystic commented 2 years ago

@argenos there are two plugins which do exactly this! I personally prefer this one: https://github.com/hipstersmoothie/obsidian-plugin-prettier, but it makes fewer changes than the other. And I think it does the same formatting as the Prettifier extension in VS Code

chrisgrieser commented 2 years ago

I'd also throw the Obsidian Linter into the ring, which I personally prefer since it doesn't just apply some markdown linter, but rather develops it's own rules that make sense in Obsidian as an environment. (Though I am maybe biased after having contributed a bunch of rules to it).

Also, I think this discussion can be regarded as a sub-aspect of #52.

claremacrae commented 1 year ago

A note for when we turn on auto-reformatting of markdown files for consistency.

We need to make sure we opt for making - the chosen list character, not *

Background

In #553 we have some code for sorting lists of plugins by plug-in. All the plugin lists currently use - as the list character, and that is what the script supports.

If we were to choose *, it would break the sorting of plugin lists.