@emmetio/markup-formatters
Formats and outputs Emmet abbreviation in different markup languages (HTML, XML, Slim, Pug etc)
Last updated 6 years ago by serge.che .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @emmetio/markup-formatters 
SYNC missed versions from official npm registry.

Emmet output formatters Build Status

A collection of output formatters for Emmet abbreviations. Takes parsed abbreviation and returns its string representation, formatted according to given output profile, in one of supported syntax:

  • HTML (including XML and XHTML)
  • HAML
  • Pug
  • Slim

Bundles

The default bundle contains all supported syntaxes. If you don’t need all of them and want to cut-down your own bundle size a bit, you can import required formatters directly:

// import all formatters
import format from '@emmetio/markup-formatters';

// import HTML formatter only
import html from '@emmetio/markup-formatters/dist/html.es.js';
// ...also available as CommonJS module, e.g. dist/html.cjs.js

Examples

import parse from '@emmetio/abbreviation';
import Profile from '@emmetio/output-profile';
import format from '@emmetio/markup-formatters';

// parse abbreviation first
const abbr = parse('ul>li.item*3>img');

// output as HTML
const htmlProfile = new Profile({
	compactBooleanAttributes: true
});
console.log(format(abbr, htmlProfile, 'html'));

// output as XML
const xmlProfile = new Profile({
	selfClosingStyle: 'xml',
	inlineBreak: 0
});
console.log(format(abbr, xmlProfile, 'html'));

// output as Slim
console.log(format(abbr, new Profile(), 'slim'));

Current Tags

  • 0.4.1                                ...           latest (6 years ago)

9 Versions

  • 0.4.1                                ...           6 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.3                                ...           8 years ago
  • 0.3.2                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (5)

© 2010 - cnpmjs.org x YWFE | Home | YWFE