Giter VIP home page Giter VIP logo

amp-elixir's Introduction

Amp Elixir

Build Status codecov.io Hex version

Amp transforms your Markdown into AMP-compliant html so it loads super-fast!

Why?

Google is putting their clout behind the AMP (Accelerated Mobile Pages) Project to help speed up page load times on the Mobile Web: https://googleblog.blogspot.co.uk/2015/10/introducing-accelerated-mobile-pages.html

This module lets you convert Markdown (.md) files to AMP-compliant .html so that you can serve them up to mobile clients much faster.

What?

For many, reading on the mobile web is a slow, clunky and frustrating experience - but it doesn’t have to be that way. The Accelerated Mobile Pages (AMP) Project is an open source initiative that embodies the vision that publishers can create mobile optimized content once and have it load instantly everywhere.

Read: https://www.ampproject.org/ How?

The best place to understand how AMP works is on the official "How it Works" page: https://www.ampproject.org/how-it-works/

Documentation

Amp Elixir should support the same markdown as described in the Earmark repository

For these limitations see: https://hexdocs.pm/earmark/Earmark.html#module-limitations

Api

Amp.parse

  • markdown - (required) markdown string to be parsed
  • options - (required) map
    • headOverride - (optional) custom html head to use if you do not want to use one generated by ampl. Using this option will mean other options will have no effect
    • style - (optional) css string to style the output html
    • title - (optional) sets the title property in the page
    • canonicalUrl- (optional) sets the canonicalUrl of the page
    • extraHeadHTML- (optional) extra html to be inserted into the bottom of the head

Background Reading

The AMP Spec: https://github.com/ampproject/amphtml

Questions?

If you have any questions please ask: https://github.com/dwyl/ampl/issues

Installation

If available in Hex, the package can be installed by adding amp to your list of dependencies in mix.exs:

def deps do
  [{:amp, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/amp.

amp-elixir's People

Contributors

iteles avatar nelsonic avatar samhstn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

yvc74

amp-elixir's Issues

HTML as input support

I know HTML is part of the markdown specification, is HTML supported as input? Thank you very much in advance.

Live Demo?

@Shouston3 could we create a "live" demo for this module?
Input some markdown in a form and have it rendered as AMP HTML?

Port Ampl to Elixir with "better tests fixtures"

We are using Elixir for our new project.
One of those projects involves having a CMS.
The content of the CMS needs to be rendered as AMP-Compliant HTML.
We have an existing project that does this: https://github.com/dwyl/ampl
But it's node.js ... so we could either add the node module to our workflow in a Pheonix Project
or create an Elixir module which we can include in our Phoenix project.

Most of the README.md content can be "recycled".
Essentially the mission of this project is to be "Ampl" for Elixir.

We could use https://hex.pm/packages/earmark to convert Markdown to HTML.
@Shouston3 please "spike" this tomorrow and see how far you get.
If you have questions about the ampl implementation, please ask @des-des 💬

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.