0.3.10 • Published 6 years ago

@emmetio/html-transform v0.3.10

Weekly downloads
3,077
License
MIT
Repository
github
Last release
6 years ago

Emmet abbreviation transformer for HTML Build Status

This modules takes parsed Emmet abbreviation tree and transforms it for markup syntax (HTML, XML, Pug, Slim etc.) output. This transformation includes:

  • Implicit tag name resolving. Fills omitted tag names, depending on parent’s name. For example, table>.row>.cell will be resolved to table>tr.row>td.cell equivalent.
  • Item Numbering. Replaces $ symbol in node’s name, attributes and content with repeater value. For example, .item$*3 will produce nodes with item1, item2 and item3 class names. Multiple $ will zero-pad repeater value, e.g. $$$001...012...123. Precede $ character with \ to skip numbering on it and keep as is.
  • Content insertion. A part of Wrap With Abbreviation action: clones implicitly repeated element (like li*) for every item of given content array and inserts item content into cloned node.

Usage

import parse from '@emmetio/abbreviation';
import transform from '@emmetio/html-transform';

const abbr = transform(parse('ul>.item$*'), ['foo', 'bar']);
// `abbr` now holds equivalent of `ul>li.item1{foo}+li.item2{bar}` abbreviation
0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago