Post-process Zim Markdown export for use with Obsidian.
Loops through all subdirectories of a Zim notebook Markdown export.
- Renames pages according to the names given by the top first level heading.
- Removes each note's first line.
- Converts Markdown links to wikilinks (optional).
- Converts several Markdown formattings to Obsidian style:
- Replaces Setext-style headers with Atx-style headers.
- Converts horizontal rulers.
- Converts highlighting.
- Converts checkboxes.
- Converts tags.
- Converts verbatim blocks to "fenced" code blocks.
- A Python installation (version 3.6 or newer).
Save the file zim2obsidian.py.
- If you use indentiation in your Zim notebook, consider running the subst_indent.py tool first.
- Have Zim export the notebook to Markdown (export each page to a separate file).
- Make sure the Markdown files have the ".md" extension. If not, run the markdown2md.py tool first.
- If you have substituted indentiation with the subst_indent.py preprocessor, run the indent_md.py tool now.
- Copy zim2obsidian.py into the export root directory.
- Start it by double clicking on it or from the console.
zim2obsidian.py [-h] [-b]
options:
-h, --help show a help message and exit
-b, --backticks verbatim blocks and inline code are marked with backticks
Zim exports "verbatim" blocks indented with tabs. By default, zim2obsidian.py encloses such blocks with three backticks, so that Obsidian recognizes them as code blocks. Inline code markup is not supported by regular Zim.
However, you can enclose inline code with backticks in Zim, and
"fence" code blocks with three backticks, as usual in GitHub flavored markdown.
Then you can call zim2obsidian.py with the --backticks
argument.
The script then keeps the backticks-enclosed passages verbatim.
Leading tabs are passed through without adding code block markers.
Be aware, this is open source software, and you can implement your own features either locally after downloading and unpacking the latest release, or in your own fork.
You also can go to the "discussions" forum to discuss your idea.
Published under the MIT License