Skip to content

Xunius/markdown2zim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jul 23, 2020
6c27c69 · Jul 23, 2020

History

38 Commits
Sep 27, 2019
Jul 23, 2020
May 1, 2020
Mar 25, 2016
Jul 29, 2017
May 1, 2020
May 1, 2020

Repository files navigation

markdown2zim

Convert between markdown and zim wiki syntax

What does this do?

Convert a text file written in markdown or zim wiki to the other.

Syntax table:

    ----------------------------------------------------
    type             Markdown       <->         Zim
    ----------------------------------------------------
    Heading1         # heading          ===== heading =====
    Heading2         ## heading         ==== heading ====
    Heading3         ### heading        === heading ===
    Heading4         #### heading       == heading ==
    Heading5         ##### heading      = heading =
    Heading6         ###### heading     = heading =
    ----------------------------------------------------
    unordered list   -/+/*              *
    ordered list     1. 2. 3.           1. 2. 3.
    ----------------------------------------------------
    bold             **bold**           **bold**
                     __bold__           __bold__
    italic           *italic*           //italic//
                     _italic_           //italic//
    strike           ~~strike~~         ~~strike~~
    ----------------------------------------------------
    quote            > texts...         '''
                     texts...           texts...
                                        '''
    code             ```                ```
                     texts...           texts...
                     ```                ```
    ----------------------------------------------------
    inline link      [link](url)        [[url|link]]
    ----------------------------------------------------
    ref link         [link text][id]    
                     [id]:url "title"   [[url|link]]
    ----------------------------------------------------
    inline image     ![img](url)        {{url}}
    ----------------------------------------------------
    ref image        ![img text][id]    
                     [id]:url "title"   {{url}}

Links in zim are translated to file paths, e.g. [[+linktonote]] is converted to [linktonote](~/path_to_current_file/title_of_current_note/linktonote.txt)

Similary image links are converted to file paths.

Syntax not supported:

- footnote
- tables

The core functionality is stripped and modified from markdown2.

Usage

markdown to zim:

python markdown2zim.py input [-o output]

zim to markdown:

python zim2markdown.py input [-o output]

where -o output is the output file, default to "input_md2zim.txt" or "input_zim2md.md"

Related project

evernote2zim: facilitate migration from Evernote to Zimwiki

About

Convert between markdown and zim wiki syntax

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages