|<<>>|41 of 225 Show listMobile Mode

Convert Markdown to earthli format

Published by marco on

The earthli blogging format uses HTML-like formatting, described in the lengthy manual (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:

  1. If there are attached media (e.g. graphics), save those locally
  2. Create a new earthli article with the same title as the source article
  3. Attach all media to the new article
  4. Copy the main text; paste into Sublime Text
  5. Find/replace the following regular expressions with the replacements:
    • ### ([^\n]+)$ => \1
    • ## ([^\n]+)$ => \1
    • \[([^!][^\]]+)\]\(([^\)]+)\) => \1
    • \*\*([^\*]+)\*\* => \1
    • _([^_]+)_ => \1
    • ```txt\n([^`]+)\n``` =>
    • ```[a-z]+\n([^`]+)\n``` => \1
    • `([^`]+)` => \1
  6. Manually re-attach all media in the appropriate locations[1]

I haven’t automated this process yet because I only rarely transfer articles.

[1] 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.