little background of why i’m doing this:
I’m working with python script and jupyter notebook a lot, and most of the time, i need to write record and write some report based on what’s inside the notebook. i find it very exhausting that i have to manually copy and paste everything from notebook to my obsidian vault, which where i record literally everything.
I take nbconvert ftw. so here i am.
so, this workflow is based on
- my main folder structure in obsidian fault
- how nbconvert handles notebook to markdown file, that:
- every image in cell output will be exported and located in a new sub-folder regardless of the target directory
- the markdown link of the image is not a relative path neither the image name (this is a problem since obsidian recognizes it as a broken link)
The Scriptings (template modification and python script)
i modified nbconvert
markdown templates and wrote a python script for little automation.
y’all can find the detail explanation in my github repo:
kelreeeeey/jupyternotebook-to-obsidian-vault: Little project to automate my workflow when working with jupyter notebook and Obsidian (github.com)
here how i use it and the outputs
here, i run this on my terminal in the same directory where my jupyter notebook i want to convert located. you can run it wherever you want as long as you provide a correct path for the input notebook
python converter.py <notebook_name.ipynb> <obsidian_folder_target>
after that, it would look like this:
Jupyter Notebooks in VSC:
Output Markdown:
Output PDF:
I’m planning to…
- explore the jinja and nbconvert format
- play with jupyter-notebook cell’s tags
- read more about jinja thing
cz im not used to it.