Skip to content

A Kramdown converter optimised for Facebook Instant Articles

License

Notifications You must be signed in to change notification settings

contentful-labs/kramdown-instant-article

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published