mildberry/jms-format

JSON markup structure format

v0.0.11 2016-10-24 06:23 UTC

README

Custom format for generation block structure on the different front-end system

SensioLabsInsight Build Status codecov

Require

  • php >= 5.4

Install

Install via composer

$ composer require mldberry/jms-format

Usage

Loading JMS format from HTML

<?php

$jsmFormat = new Mildberry\JMSFormat\JMSFormat();
print $jmsFormat->convert('html', 'jms', '<h1>Header</h1><p>text</p>');

Output:

{"version":"v1","content":[{"block":"headline","modifiers":{"weight":"lg"},"content":[{"block":"text","modifiers":[],"content":"Header"}]},{"block":"paragraph","modifiers":[],"content":[{"block":"text","modifiers":[],"content":"text"}]}]}

License

This library is under the MIT license. See the complete license in here