New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

irojs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irojs

A grammar generator for syntax highlighters.

latest
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

IroJS

A grammar generator for syntax highlighters.


This project aims to be a superset of Chris Ainsley's Iro, a development tool designed to simplify the creation of syntax highlighters.

Installation

npm install irojs

Usage

From the command line

Basic syntax:

iro compile <source> --targets=<targetlist>

Available targets:

  • textmate or tm
    • textmate.xml (default)
    • textmate.json
  • ace
    • ace.js (default)
    • ace.json
  • ast — outputs the rion ast
  • all or * — matches all targets
  • none — only checks grammar

Use <target>.* to match all extensions.

Example:

iro compile mygrammar.iro --targets=textmate,ace -o out/

From code

Example:

import * as iro from "irojs";
// or
const iro = require("irojs");

const myGrammar = "...";

var result = iro.compile(myGrammar, { targets: ["textmate"] });

console.log(result.textmate);

Language Documentation

The documentation is still a WIP. In the meanwhile, you can access the original docs at https://web.archive.org/web/20191007073218/https://eeyo.io/iro/documentation/index.html

Development

pnpm build → builds the package.

pnpm build:swc → compiles the typescript source.

pnpm build:rion → compiles the rion grammar.

pnpm build:type → generates the type definition files.

Roadmap

  • Online editor
  • VSCode extension (language server)
  • Styles to CSS
  • HighlightJS target
  • PrismJS target
  • CodeMirror target

Keywords

grammar

FAQs

Package last updated on 15 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts