meta-engine

0.0.0 • Public • Published

meta-engine

A language agnostic directive system and preprocessor.

Offers great power and flexibility without much change in your build process. All the processing happen inside your build process. So there is no runtime overhead at all.

Features

  • Language agnostic. Should practically work for all modern languages.
  • Great support for indent/whitespace sensitive languages (i.e. CoffeeScript).
  • Fills in only the blanks. Not trying to reinvent the wheel or replace template engines.
  • Exposes a Programmatic API.
  • Command Line tool comes alongside.
  • Classically written and easily extensible.
  • Very well documented.
  • Not hardcoded to use the fs module. Can be used with absolutely any sort of data source, not just files.

Installation

[sudo] npm install meta-engine

Quick Overview

meta-engine (as of now) has 2 kinds of directives.

  1. @region and @use
  2. @include

@region and @use

@region tags a block of code so that it can be reused somewhere else using @use.

declare a region

@region "a-name"

supported option(s): indented

use a region

@use "a-name"

supported option(s): match-indent, as-is

@include

Include a file. the contents of that file will be inserted where the @include tag is.

including a file using it's relative path

@include "filepath"

supported option(s): isolated

Examples

Plain HTML Project

header.html

@region "common-header" indented
  <div class="header">
    <div class="title">My Webpage</div>
    <div class="slogan">For a better world</div>
  </div>

index.html

@include "./header.html"
<html>
<body>
  @use "common-header"
  <div>
    Welcome to my page
  </div>
</body>
</html>

about.html

@include "./header.html"
<html>
<body>
  @use "common-header"
  <div>
    A place to rant about your great website.
  </div>
</body>
</html>

Full Usage

See Full Usage before you jump in.

Programmatic API

See Programmatic API in order to incorporate it into your custom build process. And if you are using gulp, we got you covered. Scroll below.

Command Line Tool

See metae to learn more about how to access the full potential of the command line tool. It even walks a directory for you.

Gulp

See gulp-meta-engine

Syntax Highlighting

meta-engine has a very small set of instructions. It can be easily added to the definition fo another language. Syntax Highlighting for atom and sublime-text are provided in the following repository.

See meta-engine-syntax-highlighting

Testing

You need mocha

npm test

Contributing

We actively check for issues even for the least used repositories (unless explicitly abandoned). All of our opensource repositories are being used in commercial projects by SoftEvolve, teamO4, BDEMR or BBS Enterprise. So, it is very likely that we will sort out important issues not long after they are posted.

Please create a github issue if you find a bug or have a feature request.

Pull requests are always welcome for any of our public repos.

Package Sidebar

Install

npm i meta-engine

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • ishafayet