code-lightner
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Code Lightner

⚠️ Current version of code-lightner only support Node.js.Browser support will be added later. ⚠️

JavaScript version

Installing

npm install code-lightner

Using

const code = require('code-lightner');
 
const sourceCode =
    `
module Test
 
[<RequireQualifiedAccess>]
type FontStyle =
    | NotSet = -1
    | None = 0
    | Italic = 1
    | Bold = 2
    | Underline = 4
    `
 
let config =
    {
        backgroundColor: "#282c34", // Optional, set the background color of the pre element
        textColor: "#bbbbbbff", // Optional, set the color of the text
        grammarFiles: [ // Required, list of the grammar file to load
            "./syntaxes/JavaScript.tmLanguage.json",
            "./syntaxes/SQL.plist",
            "./syntaxes/hello.json",
            "./syntaxes/fsharp.json"
        ],
        scopeName: "source.fsharp", // Required, name of the scope to use on the provided code
        themeFile: "../themes/OneDark-Pro.json" // Required, path of the theme file
    };
 
code.lighten(config, sourceCode)
    .then(function(html) {
        console.log(html);
    });

Fable version

Coming soon

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    2
    • latest

Version History

Package Sidebar

Install

npm i code-lightner

Weekly Downloads

8

Version

0.3.0

License

MIT

Unpacked Size

496 kB

Total Files

67

Last publish

Collaborators

  • mangelmaxime