Coder Social home page Coder Social logo

patrickhollweck / expressionist Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 164 KB

A web-extension that allows you to express yourself better by implementing a text expression evaluator.

License: MIT License

TypeScript 94.97% JavaScript 5.03%
web-extension expression-parser

expressionist's Introduction

Expressionist

Build Status

Introduction

The Expressionist is a web-extension that allows you to express yourself better by implementing a text expression evaluator.

Features

  • Evaluate any javascript expression.
  • Configurable
    • Keybinds
    • Start and End characters {{ and }}
  • Super expressive Expressions
    • Custom text functions
    • Nested expression
    • Preprocessors
    • Aliases
  • Plugins
    • Custom Transformers
    • Define your own functions.
  • Work In Progress Babel precompilation
    • Prevent infinite loops.
    • Use the newest js language features
  • Work In Progress Error reporting

Sample Expressions

  • {{ 1 + 1 }} => 2
    • Most basic expression
  • {{ 1 + {{ 2 + 2 }} }} => 5
    • Nested expressions
  • {{1+{{2+2}}}} => 5
    • Expressions are free-form
  • {{!repeat 2 Hello World}} => Hello World Hello World
    • Gets precompiled for convenients
    • repeat is a custom text processing function. It receives the string after the call, and in this case it parses the number and repeats the string.
    • Is equivalent to {{repeat("2 Hello World");}}
  • 1+1 = {{1+1}} :) => 1+1 = 2 :)
    • Expressions can be mixed with text

Build Instructions

Setup guide.

  1. Clone this repository to your local drive.
    • git clone <repo_url>
  2. Open a terminal in the cloned foler.
  3. Install dependencies
    • npm install
  4. Build the project
    • npm run build

Load the Extension in a Browser.

  1. Follow the Setup Guide
  2. Open your browser's extension page (This example uses chrome)
    • Enable the developer-mode.
    • Choose "Load Unpacked extension"
    • Navigate into the "dist" folder and select it.
  3. Profit

Running Tests

  1. Follow setup instructions
  2. Run jest
    • npm run test
    • or (for automatically-rerunning the tests when the source changes)
    • npm run test:watch
  3. Profit

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.