← Back to team overview

zim-wiki team mailing list archive

Re: Proof of Concept markdown export for zim


Jaap (and all)

Finally got around to trying the proof-of-concept script.  Have to say
it worked beautifully.

I took my most complicated zim article, replete with special arrow
characters that I have mapped in zim, New Testament Greek words, and
most if not all of the formatting options available in zim.  First
experience after running the resulting markdown through pandoc to
generate html was marginal. Then, after realizing that --standalone
might be helpful (pandoc newbie here) - results were magnificent.

Only issue I had is concatenating sequential lines.  In zim I can use:

Here's a list:
* item 1
* item 2

but it comes out in the html as

Here's a list: * item 1 * item 2

Fix, of course, was to put a blank line between the line and the list.
Similar issue happens with any set of sequential lines.  I know this
is probably a tweak - or I can change my habits too for that matter.

Having the translation capability is very helpful.  I use Simplenote -
which reads markdown, so pasting the translated markup into Simplenote
gives me an on-line copy of any zim article I want.

Similarly, I like Instapaper for capturing web pages for reading, and
use Instafetch on my Android tablet to grab offline copies of the
same.  Turns out that I can send the html generated by pandoc to my
Instapaper account, and then I will have an offline version of the
rendered markup on my tablet as well.  This is handy for having
on-the-go access to rendered articles that I have written up in zim.

Great job Jaap - I know this is proof-of-concept - but it is already
"production quality" in my book.

- Kurt

On Fri, Jan 27, 2012 at 4:52 AM, Jaap Karssenberg
<jaap.karssenberg@xxxxxxxxx> wrote:
> Dear all,
> Attached a quick and dirty proof of concept for converting zim
> formatting into markdown with pandoc extensions. This script takes a
> file name for a zim page as argument and outputs markdown to stdout.
> If the people interested in this could go ahead and test it I can
> include it in the next version of zim as an export option. The script
> requires zim to be installed, or at least to have zim modules in the
> path.
> To test it I suggest:
> 1) Create a page in the zim GUI with lots of markup
> 2) Convert it to markdown using this script and check if it looks as expected
> 3) Convert to html/pdf/... with pandoc and check again if it looks as expected
> Feel free to mail any test results to me personally or put a bug in
> the zim bug tracker.
> Open issues & questions:
> 1) How to deal with checkbox lists ? Current I leave them in the same
> syntax as zim (using "[ ]", "[*]" and "[x]") but this will not
> translate well in pandoc's interpretation
> 2) How should we link to other files when exporting a notebook ? I can
> link the file as "file:///path/to/file.txt" or as "./file.txt"
> 3) How to deal with underline / mark formatting ? Now rendering as
> bold, which is acceptable for the time being
> 4) How to deal with indented paragraphs in zim ? Now ignoring any
> indenting, because it would turn paragraphs into verbatim in markdown
> 5) How to deal with image properties, like setting width and height ?
> 6) How to deal with with tags (and in the future anchors) ? For now
> will just put them in as plain text
> 7) How to deal with inline objects ? (This is a future feature being
> tested, allows plugins to do custom rendering for a block of data.)
> Probably can re-use syntax for verbatim with code highlighting
> properties - e.g. ask to highlight as "x-zim-plugin-foo". This will be
> transparent as verbatim text if not supported.
> For proper export at least item 1) and 2) need to be addressed. Other
> can be ignored because there is at least a fallback behavior that will
> not mess up parsing in pandoc, and export is a one-way process.
> However for native support in zim (which means storing all pages
> directly in markdown) also 3) to 7) need to be addressed to make sure
> we can write a page and then read it again getting the exact same
> content. (And probable I forgot a few, but this is what I saw so far.)
> Regards,
> Jaap
> _______________________________________________
> Mailing list: https://launchpad.net/~zim-wiki
> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp

Follow ups