Skip to content

✒ A command line tool to expand Emmet expression

Notifications You must be signed in to change notification settings

sheepla/emmet-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emmet-cli

emmet-cli is a command line tool to expand Emmet expression.

Usage

$ emmet-cli --help
  Usage:   emmet-cli <expr>
  Version: v0.0.1

  Description:

    A simple command to expand Emmet expression

  Options:

    -h, --help        - Show this help.
    -V, --version     - Show the version number for this program.
    -s, --stylesheet  - Stylesheet mode

Examples

To expand the expression, just specify the expression in first argument.

$ emmet-cli "!>ul#nav>li.item$*4>a{Item $}"
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
</head>
<body>
        <ul id="nav">
                <li class="item1"><a href="">Item 1</a></li>
                <li class="item2"><a href="">Item 2</a></li>
                <li class="item3"><a href="">Item 3</a></li>
                <li class="item4"><a href="">Item 4</a></li>
        </ul>
</body>
</html>

NOTE: In zsh, the ! symbol will be expanded, so write \! instead.

To output as a stylesheet instead of a markup document, run with the -s, --stylesheet option.

$ emmet-cli -s "bd1-s#f.5"
border: 1px solid rgba(255, 255, 255, 0.5);

Installation

Requires Deno >= v1.25, testing on v1.33.3.

deno install --name emmet-cli --force https://raw.githubusercontent.com/sheepla/emmet-cli/master/cli.ts

TODO

  • Make it possible to specify indentation etc. with command line options
  • Add a user snippet from a config file and make it configureable
  • Distribute pre-compiled binaries from GitHub release page

License

MIT

Contributing

Welcome any contributing such as adding features, typo fixing, etc.

c.f.

About

✒ A command line tool to expand Emmet expression

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published