This page shows the source for this entry, with WebCore formatting language tags and attributes highlighted.


Convert Markdown to earthli format


The earthli blogging format uses HTML-like formatting, described in the <a href="">lengthy manual</a> (with examples). However, Encodo's blogging back-end now uses Umbraco, with Markdown for content. I used to be able to cross-post with ease, by copy/pasting. Now, I need to convert the content from Markdown to earthli formatting. The following steps suffice to convert any article: <ol> If there are attached media (e.g. graphics), save those locally Create a new earthli article with the same title as the source article Attach all media to the new article Copy the main text; paste into <i>Sublime Text</i> Find/replace the following regular expressions with the replacements:<ul> <c>### ([^\n]+)$</c> => <c>\1</c> <c>## ([^\n]+)$</c> => <c>\1</c> <c>\[([^!][^\]]+)\]\(([^\)]+)\)</c> => <c>\1</c> <c>\*\*([^\*]+)\*\*</c> => <c>\1</c> <c>_([^_]+)_</c> => <c>\1</c> <c>```txt\n([^`]+)\n```</c> => <c>
</c> <c>```[a-z]+\n([^`]+)\n```</c> => <c>\1</c> <c>`([^`]+)`</c> => <c>\1</c></ul> Manually re-attach all media in the appropriate locations<fn> </ol> I haven't automated this process yet because I only rarely transfer articles. <hr> <ft>This is easy since the earthli UI includes an attachment formatter that lets you place, align, link and scale the attachment better than in the original specification anyway.</ft>