Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/Delapouite/emmet-cli

Emmet command line interface
https://github.com/Delapouite/emmet-cli

emmet kakoune

Last synced: 29 days ago
JSON representation

Emmet command line interface

Awesome Lists containing this project

README

        

# emmet-cli

[emmet](https://emmet.io/) command line interface.

## Usage

```
$ emmet abbr
$ echo abbr | emmet
```

Examples:

```
$ emmet '#foo>span.bar*3'
```

outputs on `stdout`:

```





```

```
$ echo '!' | emmet
```

outputs on `stdout`:

```




Document

```

Use the `-p` flag to include placeholders in the output:

```
$ echo '#foo>span.bar*3' | emmet -p
```

outputs on `stdout`:

```


${1}
${2}
${3}

```

These syntax should be compatible with snippets formats like the
one used by [lsp servers](https://github.com/Microsoft/language-server-protocol/blob/master/snippetSyntax.md)

## Install

```
$ npm i -g emmet-cli
$ yarn global add emmet-cli
```

## About

**emmet** is a great plugin available in many modern code editors.
It aims mainly at working with HTML easier.

It's written in JavaScript so there's no easy way run it without `node.js`.

This module is currently a dead simple (like 10 lines of code) way to use the compiler
as a CLI. It uses a few modules from [@emmet-io](https://www.npmjs.com/~emmetio) which
is an effort for emmet 2.x to decouple all its internal bits.

- https://www.npmjs.com/package/@emmetio/expand-abbreviation
- https://www.npmjs.com/package/@emmetio/snippets

My main usage currently is with [kakoune](http://kakoune.org)'s `!` command which
blindly insert the output of `emmet` into the current buffer or the `|` command which
pipes selections contents to `emmet`'s stdin.

In the future, I'll try to improve this scenario further by combining with cool stuff
like [phantom selectons](https://github.com/occivink/kakoune-phantom-selection).

According to its README, the [HTML matcher](https://www.npmjs.com/package/@emmetio/html-matcher)
would be a nice way to grab coordinates that may be turned into [text-objects](https://github.com/Delapouite/kakoune-text-objects),
but the `findPair` function is nowhere to be found (yet).

## See Also

- [kakoune-snippets](https://github.com/JJK96/kakoune-snippets)

## License

ISC