Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maxpoletaev/node-beml

HTML preprocessor for BEM
https://github.com/maxpoletaev/node-beml

Last synced: about 2 months ago
JSON representation

HTML preprocessor for BEM

Awesome Lists containing this project

README

        

# BEML [![Build Status][build]][build-link]

[build]: https://travis-ci.org/zenwalker/node-beml.png?branch=master
[build-link]: https://travis-ci.org/zenwalker/node-beml

This is simple HTML preprocessor (or postprocessor) which extend HTML syntax for
comfortable working with bem html.

Also available plugins for [Gulp](https://github.com/zenwalker/gulp-beml),
[Grunt](https://github.com/zenwalker/grunt-beml), [Broccoli](https://github.com/Inzephirum/broccoli-beml) and [Postxml](https://github.com/postxml/postxml-beml).

## Why?

Raw HTML in BEM style is difficult to read. Also, I (and not only I) love HTML
and don't want to use BEMHTML, BEMJSON and others specific technologies.

## Targets

* Maximum simplicity - HTML syntax, without translate from another language.
* Possibility port to other languages (e.g. PHP or Python).
* Joint work with template engines.
* Ease of use.

## Sample

```html




```

translated to

```html




```

## How to use

```javascript
var beml = require('beml');

var config = {
elemPrefix: '__',
modPrefix: '_',
modDlmtr: '_'
};

var html = beml('

', config);
console.log(html);
```

## Syntax reference

### Blocks

```html




```

```html




```

### Elements

```html






```

```html






```

### Modifiers

```html




```

```html




```

### Mixes

```html







```

```html







```

For complex values you can use pseudo JSON syntax:

```html



```

```html



```