I wrote a simple note taking application that automates a few things for me when writing notes in markdown style. I can share the gitlab link if need be but perhaps a small description of my problem might be enough...<p>My python application which is very dumb and simple (does what I want) accomplishes a few simple tasks like...<p>* Inserting a markdown style timestamp for each new entry which links to a table of contents section name<p>* Logging complex commands from your bash_history at the end of the day<p>* Automatically archiving notes in a file using a markdown style table of contents<p>* Automatically syncing your notes (using git) with a remote repo on a hosting service like GitHub.<p>This all works fine if I'm taking notes using a simple <i>.md (markdown) file. However, if I want automate this in the same way with a jupyter notebook ipynb file it becomes extremely more complicated. The ipynb file looks like it's in a json'ish format where some of it looks enrypted and apparently i need to have a notebook server running to open it??<p>Much of my text that isn't code in my personal jupyter notebook is formatted in markdown. I have a markdown style table of contents very similar to how I mentioned above. Therefore, it would really be nice if I could open a ipynb file like i do with python, sort it, write a line of text to it. How do I accomplish this?<p>Currently, I do something like the following when I want to insert some text into a </i>.md (markdown) file. Which is simple...<p>with open(somefile, 'r') as f:<p>lines = f.readlines()<p>lines.insert(lineNumberToInsertAt, someText)<p>with open(somefile, 'w') as f:<p>f.writelines(lines)<p>I can't just open a ipynb file like this and write to it so how can I accomplish this?<p>Also I'm new to this site and noticed that there are some links that say "Ask HN: Some question". How do I appropriately post questions versus clogging up the main page which is more for articles?