I write these notes in Obsidian. To upload, them, I could visit https://github.com/alifeee/blog/tree/main/notes, click "add file", and copy and paste the file contents. I probably should do that.
But, instead, I wrote a shell script to upload them. Now, I can press "CTRL+P" to open the Obsidian command pallette, type "lint" (to lint the note), then open it again and type "upload" and upload the note. At this point, I could walk away and assume everything went fine, but what I normally do is open the GitHub Actions tab to check that it worked properly.
The process the script undertakes is:
check user inputs are good (all variables exist, file is declared)
check if file exists or not already in GitHub with a curl request
generate a JSON payload for the upload request, including:
commit message
commit author & email
file contents as a base64 encoded string
(if file exists already) sha1 hash of existing file
make a curl request to upload/update the file!
As I use it from inside Obsidian, I use an extension called Obsidian shellcommands, which lets you specify several commands. For this, I specify:
…and when run with a file open, it will upload/update that file to my notes folder on GitHub.
This is maybe a strange way of doing it, as the "source of truth" is now "my Obsidian", and the GitHub is really just a place for the files to live. However, I enjoy it.
I've made the script quite generic as you have to supply most information via environment variables. You can use it to upload an arbitrary file to a specific folder in a specific GitHub repository. Or… you can modify it and do what you want with it!
I make a lot of notes¹. Currently, I use Obsidian on my computer, laptop, and phone, and I use Syncthing to synchronise all the notes between my devices. I like making notes because if I write something down, I don't have to worry about forgetting it, and (maybe backwardsly) I can forget it with ease... because I know where I can go to remember it. It frees up my brain a lot. No thoughts. Head empty.
¹ At time of writing I have 1018 notes (result of find . -type f -name "*.md" | wc -l) (the Notion -> Obsidian export makes all database items into notes, so this is quite inflated by a bunch of empty "database" notes).
I used to use Notion but I realised: I would prefer to be making plaintext notes; I didn't like what they were doing with AI; the app was quite slow to use; and I had to be online (a lot of the time) to use it. With Obsidian, I can write notes offline, and they are only ever stored on my own devices, and synced between them.
I have four folders in the root folder of my obsidian, these are
1-Project
2-Active
3-Resource
4-Archive
This layout is called "PARA" (Project Active Resource Archive). I found out about it several years ago; I don't remember where.
The theory (or how I use it) is that you organise notes like:
project: things you are doing that can be completed
active: things that you are doing that are ongoing
resource: notes with information
archive: put anything from the above three categories here when completed
So, as an example, my current:
project notes are: BarCamp 13, bereal video, blummit, Chaos Computer Congress, clubcards, De-Googlification, Discourse Forum, Incomings & outgoings on website, lipu tenpo issue sending, local archive of websites, Mum's watch, personal website edits, polarising lens, RSS random picker, sublet, welcome to sheffield events, xmas gifts, each of which I will either complete or abandon and move it to the archive
active notes are: Active (a special note I use to keep daily to-do lists), Backup Day, Craft Night, freelancing, hackspace month notes, linux problems, lipu tenpo zine printing, news servers, OpenTechCalendar, Weeknotes, which are all things I do semi-regularly (e.g., monthly)
resource notes are: Copy about myself, Hitchhiking, Keys, My Bike, places I have a profile picture, random things to fill a few hours or day, Raspberry Pi, Things wot I done, To Attend, To Borrow, To Celebrate, To Consume, To Create, To Purchase, To Treasure, What's the best country, which are mostly where I put stuff so that I can forget it from my brain and have no thoughts
archive notes are (a subset because this contains a lot of notes, mostly old project notes): air quality monitor, repair cafe, gspread, tiny games, RingGram, To Eat, Github random repo picker, Layout with LaTeX, CSS Naked Day, website night, river walk, GMTK gamejam 2, Fireside housing cooperative, Volunteering at BHF, hackspace font workshop, and many more...
There are many ways to organise notes, but I like this way because I can always pretty obviously fit a note into one of the three categories, so I don't have to constantly move notes around, or think too much about where they belong. Also, every few years it feels pretty great to empty out the project notes folder (an impossible task).
Anyway, I've been writing these notes in Obsidian. I have then been copying and pasting the content into https://dlaa.me/markdownlint/ to find problems with my Markdown formatting. It's mainly when I forget to wrap links in <> as this makes them not render as HTML links - I sort of like this as you (my automatic tool) shouldn't try and decide what is and isn't a link, but also maybe you should because you can probably recognise them pretty well with a very established regex by now.
Anyway, I found an Obsidian extension which lets you specify shell commands https://github.com/Taitava/obsidian-shellcommands that you can run via the command palette. This seems super neat - I can do ANYTHING now.
Anyway, I installed it and made a command to lint the current markdown file. I had to install npm globally because it wasn't working when being called from the Obsidian script, and then I made this command to run the lint.
(cd {{folder_path:absolute}}; source /usr/alifeee/.nvm/nvm.sh && nvm use 20 && markdownlint {{file_name}} --disable MD013 && echo "no lint issues!")
I disabled MD013 which is the insane rule which wants you to have loads of line breaks per paragraph (I prefer my paragraph to be one really really long line please).
It's not perfect (the output is just in an ugly pop up window), but it is nice to run it locally.