Considering Markdown

Over the last year or so of using Noteworthy, one niggling problem that I've struggled with is the various ways Evernote stores their note information. It's always in a slightly modified form of HTML, but its structure is inconsistent depending on what version a note was written in, what platform, and what sorts of data are stored within. As one can imagine, this creates some problems for tools that try to read this information and present it in a consistent fashion for the world to see. With more people using Noteworthy to share their ideas, though, I'm starting to look at different ways to crack this nut once and for all.

At the moment, Noteworthy will massage a note's content upwards of 15 times to get it into a format that doesn't look ugly as hell once it's in a person's browser. While it is certainly possible to simply show the note content as it comes from Evernote, this makes styling on a website very difficult. Paragraphs are contained in DIV tags, and any styling information is part of the DIV which only adds to the complications. If a person so much as touches the font setting in Evernote, some or all of the data will try to show that font … even if it's not a proper browser font. The problem gets even more complicated if you happen to cut and paste a website into Evernote. How the heck should that information be displayed? Should the ads also be imported and shown with the content? I sure as heck wouldn't want some other site's ads on my site.

But what's the solution?

Noteworthy is a system that will be able to operate with or without a database. As a result, if the site is without a database, the flat files created need to be in a very standard and consistent format. They can't change as Evernote versions are released. They can't be different for people using Android, Windows, OS X, or iOS. Predictable consistency is absolutely key. Is there a simple way to do this? Will Markdown work?

I've used Markdown in various iterations for years but have yet to implement it in any of my projects. This is, essentially, a very simple file format that can quickly be converted from text to HTML and back again. It's used by a number of developers whom I greatly respect, and even a few authors. If Markdown is good enough for them, it should be more than adequate for my needs. The code I write is hardly as complicated or awesome as theirs, after all.

Naturally, people who are using Evernote to create posts (or pages) will not need to write in the Markdown format. They'll be able to use the system just as it is right now, complete with the limited formatting options contained within. The idea is that the data will be stored in the back end in the Markdown format where it's out of sight and out of mind. Regular people shouldn't have to think about what format their data is stored in, after all.

This is something that I'll be investigating over the next few days so, if you happen to see something strange on my site or in the RSS feed, it probably has something to do with some new bug that's popped up as a result of converting my database to Markdown. Hopefully it won't be too much of a hassle, though. I'd love to roll this in to the February Milestone.

Have any experience with Markdown?