charlesthomas / magpie

Git-backed Evernote replacement
MIT License
645 stars 50 forks source link

Table Support: Consider using python_mistune in place of python_markdown2 #56

Closed KDocProf closed 9 years ago

KDocProf commented 10 years ago

Since pipe tables are more or less the 'default' table style in most of the markdown tools I've used, I have a lot of them in my notes. Unfortunately, python_markdown2 supports only the wiki-tables format.

So I did a 'pip install mistune' and edited 'handler/note.py' to change the import:

from mistune import markdown

Then I added a touch of css to 'template/base.html' to make the tables render a little nicer:

<style>
        td {padding-left: 5px; padding-right: 5px; padding-top: 3px; vertical-align: top;}
        th {padding-left: 5px; padding-right: 5px;}
        textarea {font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;}
    </style>

Obviously, the last line has nothing to do with tables, I just preferred specifying mono-spaced fonts for the text area.

Anyway, my pipe tables no work just fine.