Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.76 KB

File metadata and controls

40 lines (32 loc) · 1.76 KB

For source code, I'd often use a tool like [[prettier]] to avoid putting mental cycles into how to format code. There should be a similar tool for Markdown files.

Fixing indents

If initial indent is 4 spaces, then later indent of 6 spaces should be fixed.

Deleting empty files

Easy to script

gci | gci -r | ? Size -eq 0 | ri

note: one complication is that from ~/notes just running gci -r doesn't recurse into the symlinks

  • Look if this is a bug in pwsh or if there's some workaround
  • could run find ~/notes/MyNotes/ -empty -- not recursive though?

Wiki urls

Fix any [[Obsidian wiki links]] into [Obsidian wiki links](../../Obsidian wiki links.md)

Bare URLs

URLs that are links: [https://example.com](https://example.com) should just be turned to plaintext link: https://example.com ...if it links to any other URL, don't fix but should be lint error. (Ignore the fragment instead of erroring though.)

Normalizing empty lines

Most important: end of file

Redundant H1

Just remove the H1 if it matches the file name