0.2.1 • Published 9 years ago

syntusk v0.2.1

Weekly downloads
45
License
-
Repository
-
Last release
9 years ago

Syntusk

Syntax highlighting for TUSK without the bulk.

npm

Supported Languages

All languages and styles from highlight.js.

Installation

Npm

npm install syntusk

Example

// Require a style. (Returns a css string).
var theme = require('syntusk/style/solarized_dark');

// Require the highlighters.
var XML = require('syntusk/xml');
var CSS = require('syntusk/css');
var JS = require('syntusk/javascript');

// To access the underlying hljs simply require("syntusk").
// Use them in a component.
var MyComponent = function () {
    return (
        <div>
            <style innerHTML={ theme }/>

            <XML>
                {'<a href="example.html"> Click me </a>'}
            </XML>
            <CSS>
                {'body { background-color: green }'}
            </CSS>
            <JS>
                {'var x = { y: "hi" };'}
            </JS>
        </div>
    );
});

Which (when rendered) will output:

Example

0.2.1

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago