dasevilla / README.md secret
Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Evernote to Markdown

View README.md

Sample:

osascript export-selected.scpt \
    | saxon -xsl:enml2xhtml.xslt -s:- \
    | pandoc -f html -t markdown_strict \
    > output.md

open -a marked output.md

Install the dependies:

$ brew install haskell-platform saxon
$ cabal update
$ cabal install pandoc
View README.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:en="http://xml.evernote.com/pub/enml2.dtd">
 
<!-- The goal of this stylesheet is to generate XHTML from ENML -->
<xsl:output method="xhtml" indent="yes"
xpath-default-namespace="http://www.w3.org/1999/xhtml"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
doctype-public="-//W3C//DTD HTML 4.01//EN" />
 
 
 
<!-- Handle en-note -->
<xsl:template match="en:en-note">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Exported note</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
 
</xsl:template>
 
 
 
<!-- Handle en-todo -->
<xsl:template match="en:en-todo[@checked=true()]">
<xsl:text>[X] </xsl:text>
</xsl:template>
 
<xsl:template match="en:en-todo[@checked=false()]">
<xsl:text>[ ] </xsl:text>
</xsl:template>
 
 
<!-- Handle en-crypt -->
<!-- Handle en-media -->
 
 
<!-- Output unknown tags without modification -->
<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:template>
 
<xsl:template match="@*|text()|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
 
</xsl:stylesheet>
View README.md
1 2 3 4 5 6 7 8 9 10 11
-- Export ENML from the first selected note
tell application "Evernote"
set theNotes to selection
if length of theNotes > 0 then
set theNote to first item of theNotes
set theContent to ENML content of theNote
set the clipboard to theContent
end if
end tell
 
return theContent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.