Coder Social home page Coder Social logo

sublime-etpl's Introduction

Sublime ETPL

An ETPL syntax definition & snippets specifically for Sublime Text.

About ETPL

ETPL is a reusable, flexible, high-performance JavaScript template engine for Browser & Node.

Screenshot

Default syntax & base16-ocean.dark.tmTheme:

Base 16 Ocean

Mustache style syntax & Tomorrow.tmTheme:

Tomorrow

Install

Get it through Git

Clone the repository in your Sublime Text Packages directory:

git clone https://github.com/ecomfe/sublime-etpl.git ETPL

The Packages directory is located at:

  • Sublime Text 3
    • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
    • Linux: ~/.Sublime Text 3/Packages/
    • Windows: %APPDATA%/Sublime Text 3/Packages/
  • Sublime Text 2
    • OS X: ~/Library/Application Support/Sublime Text 2/Packages/
    • Linux: ~/.Sublime Text 2/Packages/
    • Windows: %APPDATA%/Sublime Text 2/Packages/

Get it through Sublime Package Control

If you haven't used it yet, just install it from the link above and then:

  1. Press Shift + Command (or Ctrl) + P
  2. Type install, to bring up the "Package Control: Install Package" option, and press Enter
  3. Look for ETPL, and press Enter to install it.

Settings

Go to Preferences > Package Settings > ETPL > Settings - User, insert & override the following JSON snippet:

{
    "commandOpen": "<!--",
    "commandClose": "-->",
    "variableOpen": "${",
    "variableClose": "}"
}

Usage

Comments

Key bindings for <!-- // ETPL_COMMENTS -->:

  • OS X: Command + /
  • Linux/Windows: Ctrl + /

Snippets

  • target: + Tab<!-- target: TARGET_NAME(master = MASTER_NAME) -->
  • block: + Tab<!-- block: BLOCK_NAME --> ... <!-- /block -->
  • import: + Tab<!-- import: TARGET_NAME -->
  • use: + Tab<!-- use: TARGET_NAME(ASSIGNMENT_EXPRESSIONS) -->
  • var: + Tab<!-- var: VAR_NAME = EXPRESSION -->
  • for: + Tab<!-- for: VARIABLE as ITEM, KEY_OR_INDEX --> ... <!-- /for -->
  • if: + Tab<!-- if: CONDITIONAL_EXPRESSION --> ... <!-- /if -->
  • elif: + Tab<!-- elif: CONDITIONAL_EXPRESSION -->
  • else: + Tab<!-- else -->
  • filter: + Tab<!-- filter: FILTER_NAME(ARGUMENTS) --> ... <!-- /filter -->

Related

Contributors

License

MIT © Baidu Inc.

sublime-etpl's People

Contributors

firede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-etpl's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.