contentful-labs / kramdown-instant-article

A Kramdown converter optimised for Facebook Instant Articles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kramdown Facebook Instant Article Converter

Custom converter for Kramdown to create markup optimized for Facebook's Instant Articles.

More information on the why and how can be found in the blog post announcing this project.

What's different about it?

The following things are handled differently compared to Kramdown's HTML converter. Not that some of these changes are relatively specific to Contentful's blog

How do I use it?

On our Middleman based blog we use it with a small helper function.

require 'kramdown'

module FbiaHelper
  def render_fbia_markdown(text)
    html = Kramdown::Document.new(text.to_s, {:auto_ids => false, :html_to_native => true, :base_url => base_url}).to_fbia

    return html
  end
end

Examples on how the layouts invoking the function look like can be found in the example_layouts directory.

License

Copyright (c) 2016 Contentful GmbH. Code released under the MIT license. See LICENSE for further details.

Disclaimer

This is a project created for demo purposes and not officially supported. Report problems via the issues page but please don't expect a prompt response.

About

A Kramdown converter optimised for Facebook Instant Articles

License:MIT License


Languages

Language:Ruby 63.8%Language:HTML 36.2%