DEV Community

Jang Rush
Jang Rush

Posted on

Import Posts to dev.to via RSS

I imported most of my articles from mmap.page via the "Publishing to DEV from RSS" feature.

The automatic import feature works.
But there are still some issues left:

  1. (expected) All imported post is published today. Because I just wrote some markdown files without writing any front matter meta data, including date. (Technically speaking, GitHub Pages (Jekyll) treat my markdown files as pages, not blog posts.)

  2. (expected) No syntax highlight for code blocks. Because dev.to converts HTML back to markdown, thus all span tags for syntax highlight has been stripped. Anyway, there is no syntax highlight in the RSS reader either, because the RSS 2.0 specification does not support CSS style sheet and most RSS readers do not bother.

  3. (unexpected) In some posts spaces after some punctuation marks, such as commas and periods, got stripped mystically. There may be a bug in the HTML to markdown converter used by dev.to.

  4. (unexpected) Some posts are broken. It seems that dev.to will mistakenly treat triple backticks preceded by other characters (e.g. // ```rust) as start/end of code blocks.

So the proper way to import markdown files to dev.to is writing a script invoking the API of dev.to, which uses the markdown source directly, without the unreliable process of markdown (source) -> html (rss) -> markdown (dev.to). I will leave this trivial task to my future self.

Top comments (1)

Collapse
 
edo78 profile image
Federico "Edo" Granata

I'm wonder if your future self create such script. As I'm using eleventy for my site I'm thinking about doing the push to dev.to API at build time