Skip to content

mildberry/jms-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON markup structure format

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