2017 © Pedro PelĂĄez
 

library html-to-amp

A PHP Library to Convert HTML to AMP HTML

image

paulredmond/html-to-amp

A PHP Library to Convert HTML to AMP HTML

  • Sunday, October 8, 2017
  • by paulredmond
  • Repository
  • 8 Watchers
  • 50 Stars
  • 11,231 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

HTML to AMP HTML

A PHP Library to Convert HTML to AMP HTML, (*1)

This is a new library and not considered stable yet., (*2)

Documentation

See the wiki. Documentation is a WIP right now., (*3)

Why?

I have a need to convert HTML content into valid AMP (a subset of HTML) format from disparate CMS systems in a (hopefully) somewhat consistent manner. Instead of hacking regular expressions and doing the same thing over and over again, I thought it would be useful to create a library to parse HTML and convert it into AMP HTML., (*4)

The library's main purpose is parsing fragments of HTML content (an article body) and converting it into valid AMP. At this point you could try to parse an entire HTML document, but that's not this library's sweet spot. Pull requests are welcomed of course if you find a need; open an issue and discuss your ideas before submitting a PR so I can understand your goals/needs and align them to this project., (*5)

Design Goals

  • Make it simple, yet extensible
  • Convert and Replace Elements in a passive way
  • Allow client code to configure which conversions run
  • Allow client code to add custom conversions as needed

Inspiration

This Library was inspired by code design patterns found in the wonderful thephpleague/html-to-markdown PHP library. Generally, the objectives in this Library are similiar: parse HTML into another format—in this case a subset of HTML., (*6)

Testing

Build Status, (*7)

$ vendor/bin/phpspec run, (*8)

The Versions

08/10 2017

dev-master

9999999-dev

A PHP Library to Convert HTML to AMP HTML

  Sources   Download

MIT

The Requires

 

The Development Requires

html amp amp-html

08/10 2017

v0.1.1

0.1.1.0

A PHP Library to Convert HTML to AMP HTML

  Sources   Download

MIT

The Requires

 

The Development Requires

html amp amp-html

30/05 2016

v0.1.0

0.1.0.0

A PHP Library to Convert HTML to AMP HTML

  Sources   Download

MIT

The Requires

 

The Development Requires

html amp amp-html