Git Product home page Git Product logo

md2evernote-1's Introduction

md2evernote

This script converts a directory of markdown files into an evernote xml format (enex) suitable for importing directly into evernote. It was created to migrate my personal set of notes into evernote and is tailored to the style of markdown files I tend to write.

While there are tools to import markdown into evernote, the results tend to look like a copy/paste from a rendered version of the markdown, or more like a clipped web page than a typed note. This is good for notes that you will only look at and never change, but is not as good for notes that you will add to over time, or notes that are imported along hand-created notes where you want the styles to match.

This tool attempts to mimic the result you would get if you typed the notes in by hand in the evernote mac app, and faciliate easy editing of the notes in the mac app. Because of this, it starts by running kramdown to parse the markdown file and generate html output, and makes a few transformations to the text as it does so:

  • The top level heading is used as the note title. If the first thing in the file is a h1 heading, then it is stripped from the file and used as the note title. Otherwise, the filename is used as the note title.
  • All other headings are replaced with bold text, and no distinction is made between different heading levels. Evernote doesn't have a built in formatting option for headings, and while we could import headings as is, they appear in the evernote app as a custom font size, making it look different than hand created notes and making it difficult to edit and add to an existing note. To get around this, the tool just uses bold text to denote a heading, and only one level of heading is used.
  • Code blocks are preserved, and converted to the style built in to the evernote mac client. Evernote applies a custom style to code blocks (currently only available as a beta option on the latest mac client) and that style is replicated here rather than importing code blocks as is. Code blocks that are imported directly don't show up correctly in evernote and don't look any different from other text.
  • Blank lines from markdown text are preserved. This tends to space out the text, and mimics how I hand type my notes. This can be disabled by commenting out the 'convert_blank' function in the code if it is not desired.

Installation/Usage

The md2evernote tool makes use of kramdown, so make sure it's installed first.

Once this is done, run:

./md2evernote.rb ~/path/to/your/markdown/files/*.md

This will create a file notes.enex in the current directory, which you can then import into evernote.

If you wish, you can use bundler instead:

bundle
bundle exec ./md2evernote.rb ~/path/to/your/markdown/files/*.md

md2evernote-1's People

Contributors

mivok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.