wormi4ok / evernote2md Goto Github PK
View Code? Open in Web Editor NEWConvert Evernote .enex files to Markdown
License: MIT License
Convert Evernote .enex files to Markdown
License: MIT License
Problem statement
a
tag with empty text got also converted, making extra links:
result.md
# 北京计划 5 年内基本消除重污染天气
[](https://www.solidot.org/story?sid=66765)[](https://www.solidot.org/story?sid=66765)[Solidot](https://www.solidot.org/story?sid=66765)
[](https://www.solidot.org/story?sid=66765)[北京计划 5 年内基本消除重污染天气](https://www.solidot.org/story?sid=66765)[](https://www.solidot.org/story?sid=66765)
北京市公布的最新纲要草案计划 5 年内[基本消除重污染天气](http://news.sciencenet.cn/htmlnews/2021/1/452409.shtm)。据了解,2020 年,北京市 PM2.5 年均浓度首次实现“30+”,创下了自 2013 年监测以来的最低值。2013 年前后北京的严重污染状况引发了广泛关注,促使政府采取了关闭污染工厂限制汽车出行等治理措施。在最新的计划中,北京将大力推动汽车改用纯电动或氢燃料电池,加强充换电基础设施和加氢站建设。报道称,“大气污染治理无法局限在某一座城市。今后 5 年,北京将强化区域大气污染联防联控,坚持统一标准、统一检测,强化联合执法、应急联动,积极争取国家开展区域生态环境污染防治立法,推动国家逐步统一治理政策和标准体系。”
[https://www.solidot.org/story?sid=66765](https://www.solidot.org/story?sid=66765)
Sent with [Reeder](http://reederapp.com/)
Note source: articles sent from Reeder to Evernote email address use to save emails into Evernote.
Example file
test.enex
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20210127T053658Z" application="Evernote" version="Evernote Mac 9.4.7 (461685)">
<note>
<title>北京计划 5 年内基本消除重污染天气</title>
<content>
<![CDATA[<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><div style="padding-bottom: 10px;"><a href="https://www.solidot.org/story?sid=66765" target="null" style="font-size: 1em;"></a><div style="font-size: 1em;"><a href="https://www.solidot.org/story?sid=66765" target="null" style="font-size: 1em;"></a><a href="https://www.solidot.org/story?sid=66765" style="color: rgb(102, 102, 102); font-weight: normal; text-decoration: none;">Solidot</a></div><div><a href="https://www.solidot.org/story?sid=66765" style="color: rgb(0, 0, 0); font-weight: normal; text-decoration: none;"> </a><a href="https://www.solidot.org/story?sid=66765" style="color: rgb(0, 0, 0); font-size: 1.5em; font-weight: normal; text-decoration: none;">北京计划 5 年内基本消除重污染天气</a><a href="https://www.solidot.org/story?sid=66765" style="color: rgb(0, 0, 0); font-weight: normal; text-decoration: none;"> </a></div></div></div><div>北京市公布的最新纲要草案计划 5 年内<a shape="rect" href="http://news.sciencenet.cn/htmlnews/2021/1/452409.shtm">基本消除重污染天气</a>。据了解,2020 年,北京市 PM2.5 年均浓度首次实现“30+”,创下了自 2013 年监测以来的最低值。2013 年前后北京的严重污染状况引发了广泛关注,促使政府采取了关闭污染工厂限制汽车出行等治理措施。在最新的计划中,北京将大力推动汽车改用纯电动或氢燃料电池,加强充换电基础设施和加氢站建设。报道称,“大气污染治理无法局限在某一座城市。今后 5 年,北京将强化区域大气污染联防联控,坚持统一标准、统一检测,强化联合执法、应急联动,积极争取国家开展区域生态环境污染防治立法,推动国家逐步统一治理政策和标准体系。”</div><div><br clear="none" /></div><div><a shape="rect" style="display: inline-block; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); padding-top: 5px; color: rgb(102, 102, 102); text-decoration: none;" href="https://www.solidot.org/story?sid=66765">https://www.solidot.org/story?sid=66765</a></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="color: rgb(153, 153, 153);">Sent with </span><a shape="rect" href="http://reederapp.com/" style="color: rgb(102, 102, 102); font-weight: bold; text-decoration: none;">Reeder</a></div></en-note>]]></content>
<created>20210126T105640Z</created>
<updated>20210127T053644Z</updated>
<note-attributes>
<subject-date>20210126T105305Z</subject-date>
<author>[email protected]</author>
<source>mail.smtp</source>
<reminder-order>0</reminder-order>
<application-data key="mg-post-tier">1</application-data>
</note-attributes>
</note>
</en-export>
note html
<div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">
<div style="padding-bottom: 10px;">
<a href="https://www.solidot.org/story?sid=66765" target="null" style="font-size: 1em;"></a>
<div style="font-size: 1em;">
<a href="https://www.solidot.org/story?sid=66765" target="null"
style="font-size: 1em;"
></a>
<a href="https://www.solidot.org/story?sid=66765"
style="color: rgb(102, 102, 102); font-weight: normal; text-decoration: none;"
>Solidot</a>
</div>
<div>
<a href="https://www.solidot.org/story?sid=66765"
style="color: rgb(0, 0, 0); font-weight: normal; text-decoration: none;"
> </a>
<a href="https://www.solidot.org/story?sid=66765"
style="color: rgb(0, 0, 0); font-size: 1.5em; font-weight: normal; text-decoration: none;"
>北京计划 5 年内基本消除重污染天气</a>
<a href="https://www.solidot.org/story?sid=66765"
style="color: rgb(0, 0, 0); font-weight: normal; text-decoration: none;"
> </a>
</div>
</div>
</div>
<div>北京市公布的最新纲要草案计划 5 年内<a shape="rect" href="http://news.sciencenet.cn/htmlnews/2021/1/452409.shtm">基本消除重污染天气</a>。据了解,2020
年,北京市 PM2.5 年均浓度首次实现“30+”,创下了自 2013 年监测以来的最低值。2013
年前后北京的严重污染状况引发了广泛关注,促使政府采取了关闭污染工厂限制汽车出行等治理措施。在最新的计划中,北京将大力推动汽车改用纯电动或氢燃料电池,加强充换电基础设施和加氢站建设。报道称,“大气污染治理无法局限在某一座城市。今后
5 年,北京将强化区域大气污染联防联控,坚持统一标准、统一检测,强化联合执法、应急联动,积极争取国家开展区域生态环境污染防治立法,推动国家逐步统一治理政策和标准体系。”
</div>
<div><br clear="none"/></div>
<div><a shape="rect"
style="display: inline-block; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); padding-top: 5px; color: rgb(102, 102, 102); text-decoration: none;"
href="https://www.solidot.org/story?sid=66765">https://www.solidot.org/story?sid=66765</a></div>
<div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span
style="color: rgb(153, 153, 153);">Sent with </span><a
shape="rect" href="http://reederapp.com/"
style="color: rgb(102, 102, 102); font-weight: bold; text-decoration: none;">Reeder</a></div>
my temp fix
func (c *Converter) normalizeHTML(note *enex.Note, _ *markdown.Note, rr ...TagReplacer) {
if c.err != nil {
return
}
doc, err := html.Parse(bytes.NewReader(note.Content))
if c.err = err; err != nil {
return
}
var f func(*html.Node)
f = func(n *html.Node) {
for _, replacer := range rr {
replacer.ReplaceTag(n)
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
f(c)
}
}
f(doc)
qdoc := goquery.NewDocumentFromNode(doc)
qdoc.Find("a").FilterFunction(func(i int, selection *goquery.Selection) bool {
return strings.TrimSpace(selection.Text()) == ""
}).Remove()
out, err := qdoc.Html()
if err != nil {
return
}
note.Content = []byte(out)
}
fix result
# 北京计划 5 年内基本消除重污染天气
[Solidot](https://www.solidot.org/story?sid=66765)
[北京计划 5 年内基本消除重污染天气](https://www.solidot.org/story?sid=66765)
北京市公布的最新纲要草案计划 5 年内[基本消除重污染天气](http://news.sciencenet.cn/htmlnews/2021/1/452409.shtm)。据了解,2020 年,北京市 PM2.5 年均浓度首次实现“30+”,创下了自 2013 年监测以来的最低值。2013 年前后北京的严重污染状况引发了广泛关注,促使政府采取了关闭污染工厂限制汽车出行等治理措施。在最新的计划中,北京将大力推动汽车改用纯电动或氢燃料电池,加强充换电基础设施和加氢站建设。报道称,“大气污染治理无法局限在某一座城市。今后 5 年,北京将强化区域大气污染联防联控,坚持统一标准、统一检测,强化联合执法、应急联动,积极争取国家开展区域生态环境污染防治立法,推动国家逐步统一治理政策和标准体系。”
[https://www.solidot.org/story?sid=66765](https://www.solidot.org/story?sid=66765)
Sent with [Reeder](http://reederapp.com/)
Hi
I was able to successfully convert .enex file to md files with links but the md files had the links to the same few images, although I had a lot of images in my .enex file.
The program seems to import image1, image2, image3 from one note, then export images for another note and named them also image1, image2, etc. effectively overwriting the previous images. Thus, I have different md files with the same images in all of them.
Please suggest how to resolve this issue.
Regards,
Dmitry
Context
It looks like tags get exported surrounded by backticks.
I included a tag in the example I reported in #27
The tag in the markdown is coming back as Sample Tag
. I use some apps and markdown parsers that require one word tags, and that tags are preceded by a #
. Is there anyway I could control the tag format of the exported markdown?
If I had to express it in javascript, my desired output would be:
function getTagText(tag: string): string {
return `#${_.camelCase(tag)}`;
}
Solution
As far as how I could control or configure this via the command line, I do not have the best suggestion in mind.
After exporting images to markdown, the order of images is confused
Context
currently the image export goes to subfolder image\image.png
Solution
it would be nice to set the export folder like other tools to subfolder assets\<markdownFIlename>\<images###>.png
Instead of evernote2md in terminal , replace evernote2md to ./evernote2md:
./evernote2md My\ Notes.enex TestEvernote
Source: https://forum.zettlr.com/discussion/153/import-from-evernote
Time modified is converted without mistakes. So time created is not correctly done.
On first run I get the following error - the export fails.
Notes: 83 / 2514 [=====>__________________________________________________________________________________________________________________________________________________________________________] 3.30%
1s2020/07/02 00:42:32 open [redacted].md: too many open files
Notes: 246 / 2514 [=================>_____________________________________________________________________________________________________________________________________________________________] 9.79% 7s
This is fixed by increasing your ulimit:
sdtsuis-MacBook-Air:EverNoteExport sdtsui$ ulimit -n
256
sdtsuis-MacBook-Air:EverNoteExport sdtsui$ ulimit -n 3000
sdtsuis-MacBook-Air:EverNoteExport sdtsui$ ulimit -n
3000
Not sure if this is unexpected behavior, or if you'd like to include that somewhere in README, an FAQ, etc. Thought I'd file here as others might not find this fix.
Great project! Very pleased it works - I'm especially grateful for the image support. I can basically move off EverNote for good with very little fuss. Thank you!!
The current list of disallowed filename characters is OS-dependent. However a common situation nowadays is sharing a folder of Markdown notes between multiple OSes using a cloud storage provider. Some CSPs handle disallowed file characters better than others.
Suggestion: use a single list of disallowed filename characters that meets the requirements of all common OSes (Mac, Linux, Windows), or provide a command-line option for this (e.g. --filenamecompat [auto|win|unix|all]
).
Problem statement
Basically the title. Some notes with spaces in their titles are being named unnamed note. I could not find a pattern yet which differentiates between notes that get this treatment and those who dont. Will update the pots with an example.
Example file
I noticed during testing that evernote2md crashes when parsing certain enex files. This could especially be a problem if for example evernote2md is called by a web service, allowing a user to cause crashes on the backend. I've minimized the original crashing file down to this version for simplicity.
test.enex
<en-export d=""a=""n=""><note><title></title><content><![CDATA[<a><div style="-en-codeblock:true"><div style="-en-codeblock:true"></e>èè]]></r>
$ evernote2md test.enex
panic: parseHtml: html: inconsistent Node: DataAtom="div", Data="pre"
goroutine 1 [running]:
github.com/wormi4ok/evernote2md/internal.parseOne(0x625ec8, 0x1, 0xc0000db180, 0x625e00)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:108 +0x14b
github.com/wormi4ok/evernote2md/internal.(*Code).ReplaceTag.func1(0xc0000db1f0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:127 +0xa9
github.com/wormi4ok/evernote2md/internal.(*Code).ReplaceTag(0x7a9ee8, 0xc0000db1f0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:133 +0x82
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML.func1(0xc0000db1f0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:32 +0x73
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML.func1(0xc0000db180)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:35 +0xa6
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML.func1(0xc0000db110)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:35 +0xa6
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML.func1(0xc0000db030)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:35 +0xa6
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML.func1(0xc0000dafc0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:35 +0xa6
github.com/wormi4ok/evernote2md/internal.(*Converter).normalizeHTML(0xc000096380, 0xc0000ceb40, 0xc00008a4b0, 0xc00017bda8, 0x5, 0x5)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:38 +0x1ac
github.com/wormi4ok/evernote2md/internal.(*Converter).Convert(0xc000096380, 0xc0000ceb40, 0xc00017be88, 0x1, 0x1)
/home/runner/work/evernote2md/evernote2md/internal/convert.go:79 +0x1c9
main.run(0xc000074500, 0x1, 0x1, 0xc00017bf58, 0xc0000e4000, 0xc000096380)
/home/runner/work/evernote2md/evernote2md/main.go:83 +0x28a
main.main()
/home/runner/work/evernote2md/evernote2md/main.go:68 +0x66a
Expected outcome: no crash
Actual outcome: crash
Windows 10 - Powershell:
PS C:\Users\Martin> cd "C:\Users\Martin\Desktop\New folder (3)"
PS C:\Users\Martin\Desktop\New folder (3)> .\evernote2md.exe --folders .\Evernote.enex
Notes: 31 / 2069 [=>_________________________________________________________________________] 1.50% 1s2020/10/22 03:19:13 [ERROR] save resource .\notes/Javascript_Abstract_Method_with_ES6-Yuri_Bett-Medium/image/1SgjVeqiionF05LxxGN9TRA.jpeg: open .\notes\Javascript_Abstract_Method_with_ES6-Yuri_Bett-Medium\image\1SgjVeqiionF05LxxGN9TRA.jpeg: The filename, directory name, or volume label syntax is incorrect.
PS C:\Users\Martin\Desktop\New folder (3)>
Problem statement
Multiple lines in a table cell are translated into markdown text lines instead of one line with <br>
tags in between.
Example file
sample.zip
The uploaded zip includes an enex file which exemplifies this problem. The rendering in Evernote looks like
But the translated markdown table has something like
# iOS PDF apps
|Continuous scroll|Adobe
PDF Expert
iAnnotate
Adobe, PDF Expert, iAnnotate|
|-----------------|-------------------------------------------------------|
|Single page |Goodreader
PDF Expert
Adobe/Foxit |
Cheers.
[ERROR] save file xxx的笔记本.md/上市公司财报分析-如何去发现并坚定持有十倍潜力股?_相信大多数炒股票的人都希望能够买到具有十倍成长潜力的个股,如买中腾讯一样。其实,在股市里,这样的机会,很多人都有,不过,-雪球.md: open xxx的笔记本.md/上市公司财报分析-如何去发现并坚定持有十倍潜力股?_相信大多数炒股票的人都希望能够买到具有十倍成长潜力的个股,如买中腾讯一 样。其实,在股市里,这样的机会,很多人都有,不过,-雪球.md: file name too long
Context
In my evernote, many notes have ordered list with order number followed by checkbox:
and after converted with evernote2md, ordered list remains, while checkbox missed.
I use evernote2md because I want to transfer my notes from 印象笔记 (evernote in china) to Obsidian, and I find that Obsidian support ordered list with checkbox followed, I really like this feature:
Solution
So I hope evernote2md can support keep checkbox when it followed with ordered list. I know that ordered list with checkbox is not normal markdown syntax, and maybe not be supported by most markdown editor, so I think maybe this feature can be addea as a command option.
I want to export multiple folders as separate enex files from Evernote. I have a script that allows this. This leaves me with 50+ enex files.
Would it be possible to batch convert enex files, for instance by specifying a folder instead of an enex file?
Context
is it possible to add custom header for all output markdown files.in this case we can export all evernotes to
markdown files which can be hosted on the hugo and other static blog platform.
Solution
what the feat we wannt is something like below:
tag
title
author
createTime
Problem statement
Conversion fails on images referenced in note
evernote2md.exe -v ldif.enex evout
2020/09/17 10:59:42 [DEBUG] Saving file evout/Getting_an_LDIF_Export_of_a_User_or_Group-Crowd_2-8-Atlassian_Documentation.md
2020/09/17 10:59:42 [DEBUG] Saving attachment evout/image/grey_attach.png
2020/09/17 10:59:42 [DEBUG] Saving attachment evout/image/ldif.jpg?version=1&modificationdate=1224043351324&api=v2
2020/09/17 10:59:42 [ERROR] save resource evout/image/ldif.jpg?version=1&modificationdate=1224043351324&api=v2: open evout\image\ldif.jpg?version=1&modificationdate=1224043351324&api=v2: The filename, directory name, or volume label syntax is incorrect.
Example file
ldif.zip
Hello,
I used this tool to convert a ~4000 note notebook and it did so very quickly. However the pdfs only show random text (e.g 3-4 pages of JVBERi0xLjUNCjQgMCBvYmoNCjw8L1R5cGUgL1BhZ2UvUGFyZW50IDMgMCBSL0NvbnRlbn
zIDUgMCBSL01lZGlhQm94IFswIDAgNjEyIDc5Ml0vUmVzb3VyY2VzPDwvRm9udDw8L0ZBQU) , not the pdf as it originally appeared, and the images do not open at all. The .md files seem to have exported as expected.
I re-downloaded the enex file to ensure there were no corruption issues
I tried using it from usr/local/bin and ./evernote2md after extracting the program, but got the same result.
Used default commands, as well as some flags and got the same result.
Running kubuntu 22.04
Not sure what I'm doing wrong.
Thanks for your help
I really want to say thanks to you!
I have a number of notes with some sort of paragraph structure:
This is a line.
This is another line in the same paragraph.
This is a new paragraph.
This paragraph has a second line too.
which appear in my .enex exports mostly like this:
<div>This is a line.</div>
<div>This is another line in the same paragraph.</div>
<div><br/></div>
<div>This is a new paragraph.</div>
<div>This paragraph has a second line too.</div>
and are then exported to Markdown with each line in a separate paragraph:
This is a line.
This is another line in the same paragraph.
This is a new paragraph.
This paragraph has a second line too.
To make things more difficult, occasionally one of the <div>
s is missing:
<div>This is a line.</div>
This is another line in the same paragraph.
<div><br/></div>
<div>This is a new paragraph.</div>
<div>This paragraph has a second line too.</div>
which then exports like this:
This is a line.
This is another line in the same paragraph.
This is a new paragraph.
This paragraph has a second line too.
I have worked around it for now by commenting out the extra newline for divs in godown.go
(line 362 (here)[https://github.com/wormi4ok/godown/blob/1bea1c1b0bac9b8a8980f3b23c980f785d4a1410/godown.go]) and manually re-splitting the lines on those few notes where the lines were combined because of missing <div>
s.
However, there must be a better solution - perhaps evernote2md ought to strip the <div>
tags before calling godown
, or perhaps godown
should leave newlines before and after <div>
s but remove overlapping line breaks immediately between them (like MS Word does with paragraph spacing), or something else...?
Latest evernote2md, Evernote 10.19.2-mac-mas-public (458754) on macOS 10.15.7 19H1323. Notes in question were created in 2014, so perhaps it's due to an older Evernote version.
Hello!
Thanks for the tool! I'm using version 0.18.0, and I noticed that inline code within a list is not exported correctly.
Example Note:
This is a test to see if
inline code
will be correctly exported.
- Checking if
code
in a list works.What about entire code blocks?
After conversion:
This is a test to see if
inline code
will be correctly exported.
- Checking if <--- Incorrectly truncated
What about entire code blocks?
Any suggestions or workarounds?
Hello,
can you preserve the image location in the markdown document? All images are inserted at the end of the md-file.
Thanks in advance
Context
I'm converting a file containing 384 notes.
Would it be possible to display the title of the note being converted ? That would help to isolate the issue. I cannot share the entire file as it may contain sensitive info, but if I know which note cannot be converted I can create an export file for that one.
C:\Temp>evernote2md.exe Evernote.enex evout
Notes: 5 / 384 [=>___________________________________________________________________________________________________________________________________] 1.30% 1s2020/09/15 09:59:50 save resource evout/image/ldif.jpg?version=1&modificationdate=1224043351324&api=v2: open evout\image\ldif.jpg?version=1&modificationdate=1224043351324&api=v2: The filename, directory name, or volume label syntax is incorrect.
Solution
C:\Temp>evernote2md.exe Evernote.enex evout
Notes: 5 / 384
Error during conversion of "XXXXX"
[=>___________________________________________________________________________________________________________________________________] 1.30% 1s2020/09/15 09:59:50 save resource evout/image/ldif.jpg?version=1&modificationdate=1224043351324&api=v2: open evout\image\ldif.jpg?version=1&modificationdate=1224043351324&api=v2: The filename, directory name, or volume label syntax is incorrect.
Context
I just found this repo and it looks really useful. I'm curious about the feasibility of preserving the whitespace features of evernote files.
I made heavy use of indents and consecutive line breaks in evernote. Would it be possible to preserve the whitespace features of the CDATA? It shouldn't cause any problems for vanilla markdown editors but would allow editors like Typora to use the information.
E.g. when evernote2md processes this CDATA code:
<div>line 1</div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div>line 5</div>
<div><br /></div>
<div><br /></div>
<div>level 1</div>
<div style="padding-left:40px;">level 2</div>
<div style="padding-left:80px;">level 3</div>
<div style="padding-left:40px;">level 2</div>
it currently generates this markdown:
line 1
line 5
level 1
level 2
level 3
level 2
whereas it would be fantastic if it generated this instead:
line 1
line 5
level 1
level 2
level 3
level 2
Does this seem like a possible enhancement?
The source code includes a polite recognition that replacement of spaces with underscores is simply a personal preference. In my case, I've modified the source code to not replace spaces, and also to not add the replacement underscores in general. Others still likely have their own preferences or requirements.
Feature request: allow providing a format string for filenames at the command-line. This could also allow specifying custom fields (like the creation/modified date, author, or other note attributes) and custom replacements.
Here's one possible format:
Example 1 (current behaviour):
evernote2md --filenameFormat '%title/ /_/%dmacos/_/'
Example 2 (my modified behaviour):
evernote2md --filenameFormat '%cdateiso %title/%dany//40'
The logic for processing such a format string would amount to:
/
character (which is illegal on all platforms)s/<fromstring>/<tostring>/g
)This could provide a solution for Issue #57 as well - assuming regexes, %dlinux
could be replaced with [/]
, %dmacos
with [:/]
, %dwin
with [\\/:*?"<>|]|([ .]+$)
or something similarly convoluted, and %dany
a combination of the three, to manually remove characters that would otherwise be permitted on the current platform (although, don't quote me on those exact regexes).
Finally, a stretch goal might be to provide a similar format string for images/media: --resourceFilenameFormat 'image/%resid'
for current behaviour or 'assets/%notefilename/image%resindex'
to match the requested format in Issue #53. Won't be able to use the forward slash for both directory and replacements though.
Cheers.
Problem statement
filesystem issue with note naming -- windows:
2021/03/17 16:11:39 [DEBUG] Saving file .\notes/2015_blablablabla.md
2021/03/17 16:11:39 [DEBUG] Saving attachment .\notes\file/_ui_2_ik_55810e016a_attid_0-1_th_14ed6660a2f337a6_view_at
t_zw_disp_inline_saddbat_ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rGYl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh
9dk6jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxp.pdf
2021/03/17 16:11:39 [ERROR] save resource .\notes\file/_ui_2_ik_55810e016a_attid_0-1_th_14ed6660a2f337a6_view_att_zw
_disp_inline_saddbat_ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rGYl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh9dk6
jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxp.pdf: open .\notes\file\_ui_2_ik_55810e016a_atti
d_0-1_th_14ed6660a2f337a6_view_att_zw_disp_inline_saddbat_ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rG
Yl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh9dk6jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxp.pdf: The s
ystem cannot find the path specified.
Hmm. On linux too:
2021/03/17 22:19:22 [DEBUG] Saving attachment ./notes/file/?ui=2&ik=55810e016a&attid=0-1&th=14ed6660a2f337a6&view=att&zw&disp=inline&saddbat=ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rGYl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh9dk6jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxpC7qDEI5.pdf
2021/03/17 22:19:22 [ERROR] save resource ./notes/file/?ui=2&ik=55810e016a&attid=0-1&th=14ed6660a2f337a6&view=att&zw&disp=inline&saddbat=ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rGYl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh9dk6jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxpC7qDEI5.pdf: open ./notes/file/?ui=2&ik=55810e016a&attid=0-1&th=14ed6660a2f337a6&view=att&zw&disp=inline&saddbat=ANGjdJ9rCntiivHBHioFw1oc5_6VNy_aWhsYr0sLbpSxKIQfiQABVBN5rGYl0kPsXk9qsFE8OOQWPjIdxvxTuqLcqCh9dk6jDGZlOYI7-6HJMM0Nywr3vssbntQCW1jttD8cXlrZ5zX3MUYKp7o7iEFXM41RVOXmdxpC7qDEI5.pdf: file name too long
Example file
Problem statement
Cannot execute file. I don't know what I'm doing wrong.
Example file
PS C:\Users\j_cam\desktop\en\evernote2md> evernote2md --tagTemplate "[[{{tag}}]]" "C:\Users\j_cam\Desktop\EN\EvernoteBackup Aug21.enex" ./notes
evernote2md : The term 'evernote2md' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ CategoryInfo : ObjectNotFound: (evernote2md:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Hi,
Could you help preserve highlights from evernote texts? Like say, a dirty span background insert, or a syntax highlight of sorts in the text to preserve the highlighted content?
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Dockerfile
golang 1.22-alpine3.19
alpine 3.19
.github/workflows/ci.yml
actions/checkout v4
actions/setup-go v5
golangci/golangci-lint-action v4
actions/checkout v4
actions/setup-go v5
.github/workflows/publish.yml
dawidd6/action-homebrew-bump-formula v3
actions/checkout v4
elgohr/Publish-Docker-Github-Action v5
elgohr/Publish-Docker-Github-Action v5
elgohr/Publish-Docker-Github-Action v5
.github/workflows/qa.yml
actions/checkout v4
actions/setup-go v5
paambaati/codeclimate-action v5.0.0
.github/workflows/release.yml
actions/checkout v4
actions/setup-go v5
goreleaser/goreleaser-action v5
go.mod
go 1.21
github.com/briandowns/spinner v1.23.1
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b@5c1018a4e16b
github.com/hashicorp/logutils v1.0.0
github.com/integrii/flaggy v1.5.2
github.com/mattn/godown v0.0.2-0.20210508133137-72c48840c3e3@72c48840c3e3
github.com/sergi/go-diff v1.3.1
golang.org/x/net v0.27.0
github.com/wormi4ok/godown v0.5.0
I have tried evernote2md (v0.9.0) for the first time – and probably the last since all my Evernote notes are now converted to Markdown. Here's how it went down:
The newly converted notes, now in plain markdown, have a few formating issues:
Appart from all that, it works 👌
This is EPIC. I installed via brew with one command, and now my bs proprietary nonsense enex files are simple markdown and I can easily say goodbye to Evernote. Thanks a lot for this software, it's great.
Problem statement
Two notes with the same name but different casing inside of the .enex results in only a single note inside of the export.
Example file
The attached enex contains 2 notes:
You can see that only the contents of the second entry (with the title-cased name makes it into the export).
Problem statement
Exported all my Evernote notes into a file AllEvernotes.enex
. I've added the release binary to the /usr/local/bin
fodler and it is available on the $PATH.
Using the terminal I change into the Documents
folder where the .enex
file is stored and use the following command: evernote2md ./AllEvernotes.enex
When hit enter I get the following error fairly quickly (5.22s user 0.18s system 100% cpu 5.359 total):
2020/11/14 14:52:59 XML syntax error on line 404: unexpected EOF in CDATA section
Is this a known issue? I've had the same error on Ubuntu and now Manjaro.
Problem statement
I'm able to convert notes but on one particular note the conversion crashes.
Attached export file Evernote6.zip
evernote2md.exe Evernote6.enex evout
Notes: 0 / 1 [_______________________________________________________________________________________________________________________________________] 0.00% 0spanic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x5b94fa]
goroutine 1 [running]:
github.com/wormi4ok/evernote2md/internal.(*ExtraDiv).ReplaceTag(0x7fa9d0, 0xc000192e70)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:153 +0x4a
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192e70)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:28 +0x78
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000198700)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192c40)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192bd0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192af0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192a10)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192930)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192700)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0001f6850)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa380)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa310)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa2a0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa1c0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa0e0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML(0xc000300000, 0x11507, 0x207ff, 0xc0000bbde8, 0x3, 0x3, 0x0, 0x390000c000112c30, 0x0, 0x39a7139b39783d9e, ...)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:34 +0x13f
github.com/wormi4ok/evernote2md/internal.(*Converter).Convert(0xc0000bbe77, 0xc000168160, 0x4e, 0xc0002cc000, 0x0)
/home/runner/work/evernote2md/evernote2md/internal/convert.go:29 +0x1b0
main.run(0xc0000a00a0, 0xe, 0xc0000a00b8, 0x5, 0x100)
/home/runner/work/evernote2md/evernote2md/main.go:81 +0x2f4
main.main()
/home/runner/work/evernote2md/evernote2md/main.go:54 +0x40f
Hi, thank you for very useful and simple to use program!
I had an issues with converting and it probably related to unsafe image paths in dump
open ./result/image/favicons?domain=http://www.dolunaytravel.com/images/slider/principles/4.jpg: no such file or directory
open ./result/image/assets.github.com/images/gravatars/gravatar-140.png.jpg: no such file or directory
Hi,
Thanks for making this. I was just trying it out for a note and on executing it, it simply said "Permission Denied".
This is the command I wrote -
/Users/abhimanyu/Desktop/evernote2md_0.3.0_MacOS_64-bit/evernote2md /Users/abhimanyu/Desktop/My\ Notes.enex /Users/abhimanyu/Desktop/My\ Notes
-bash: /Users/abhimanyu/Desktop/evernote2md_0.3.0_MacOS_64-bit/evernote2md: Permission denied
How do I fix this?
Thanks.
First off, let me just say that I am amazed at how quickly and well this works! It converted all my documents in seconds.
Problem statement
That said, I did find one issue: It doesn't handle nested lists correctly.
Example file
Here is an example, a note that has some nested lists in it:
nested_list_example.zip
I would expect the lists to format like:
* this is the first level
* this is the second level
* this is the third level
But instead it formats like
* this is the first level
* this is the second level
* this is the third level
If I knew Go, I'd try to help with a solution myself, but I don't have any experience there.
It would be super useful to have a flag that would modify the saved files cdate and mdate to match the emex file's attributes.
Thanks for this tool! I don't know if Evernote changed the .enex export formatting or what, but running the command on a normal note results in some weird Unicode characters that show up as strange characters in markdown.
For instance:
<0xa0>
characters in the resulting markdown (this is apparently a non-breaking space. Markdown readers show that as a Â
or something else.\(
or \)
\-
\!
@wormi4ok, is there any chance I could get your help with this? I guess I could create my own post-processor, but I would really prefer not to do that. Seems like this may be an easy change for you. I don't know Go so I can't do it myself.
A simple 2x2 Evernote table is exported as:
|a|b|
|c|d|
Which Github's markdown renders as:
|a|b|
|c|d|
I think it should be:
|a|b|
|--|--|
|c|d|
Which gives:
a | b |
---|---|
c | d |
(Since tables are not official markdown, it may be a design decision. My view is based on Github's markdown.)
Problem statement. Apple's increasingly security makes it hard to run apps that aren't notarised from a verified developer. This is affecting this utility. It only seems to run for me from the downloads directory. When I move it to ~/bin or ~/Documents I get a warning message about it not being able to be verified, and then the process is killed.
Running latest release of macOS Catalina.
Problem statement
I have a note which, when exported, is missing some data. The following zip archive illustrates the issue:
Example file
You can open up the .enex and see that each list item has contents "list item" however the exported note contains nothing.
I ran the following command:
$ evernote2md -v Actual.enex && cat notes/Exported_List_is_Empty.md
2021/01/04 15:01:44 [DEBUG] Saving file ./notes/Exported_List_is_Empty.md
Done!
And the result:
$ cat notes/Exported_List_is_Empty.md
# Exported List is Empty
`Sample Tag`
Paragraph
*
*
*
*
*
*
*
*
*
Paragraph
*
*
*
*
*
*
Paragraph
*
*
*
*
*
*
*
*
*
*
*
*
*
Paragraph
ParagraphParagraph
*
*
*
*
*
*
*
*
*
*
Paragraph
*
*
*
*
*
*
*
*
*
*
*
*
*
Paragraph
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*```
Problem statement
Moved all my notes into Inbox and exported everything yesterday (2021-03-17) into Inbox.enex
<en-export export-date="20210417T063918Z" application="Evernote" version="10.9.10">
Inbox.enex is 257MB
Tried v0.15.0 on Windows and Linux
Output is:
./evernote2md -v Inbox.enex
2021/03/17 15:02:43 [DEBUG] Decoding a file: /home/user/Downloads/Inbox.enex
2021/03/17 15:02:49 EOF
No files are produced in notes. Tried creating a ./notes and specifying - same result.
Example file
Here's is an .enex file with some code blocks which on parsing with evernote2md do not contain the code blocks.
https://anonymousfiles.io/RCg01WWC/
(Uploaded here for lack of support for .enex on github comments)
Problem: error message 'illegal base64 data at input byte X' when run on a Folder export .enex or a single file .enex.
Example file: here's the small single file .enex that the script fails at input byte 512. (To add it here I've had to rename it to .zip: just change back to .enex.
Fritfetti - Say Yes to Sprinkles!.zip
Running v0.11.0 on latest release of macOS Catalina.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.