How to use the lowlight.registerLanguage function in lowlight

To help you get started, we’ve selected a few lowlight examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / lowlight / lowlight-tests.ts View on Github external
aliases: ['cmake.in'],
        case_insensitive: true,
        keywords: {
            keyword:
                'forall all exists exist only m M i e 1 2 3 4 5 6 7 8 9 0 - + * / \ % ! . , ; : | lim limsup liminf infinity not'
        },
        contains: [
        {
            className: 'variable',
            begin: '(', end: ')'
        },
        ]
    };
}

registerLanguage('math', highlighter);

console.log(highlight('typescript',
`class CPP {
    private year: number;
    public constructor(private version: string) {
        this.year = Number(version.match(/.+\d+$/));
    }

    public version(): string {
        return this.version;
    }
}
`
));

console.info(highlightAuto(