0.1.7 • Published 5 years ago

syntaxtint v0.1.7

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

syntaxtint

A high-performance library for syntax highlighting your code(rendered to HTML).

Report a Bug

Suggest a New Language

Suggest a New Theme

Features

  • High-Performance

Most of my tests where completed in ~1-4 milliseconds!

  • Highly Modular/Customizable

Easily create new language syntax and themes for your projects, or contribute them to the syntaxtint project!

Here's an example of what the final result(C++ and One Dark theme): example

Installing

NodeJS

node i syntaxtint

Usage

Global Variables

If process.autoLoadThemes is set to false, syntaxtint will not automatically load themes, so you can add any themes you want yourself, and the same is with process.autoLoadLanguages, except for with languages.

Highlighting Code

You can syntax-highlight code by calling the following function:

<syntaxtint>.render(languageName: string, themeName: string, code: string)

Example:

syntaxtint.render('javascript', 'onelight', 
`function myTestFunction() {
  console.log("Hello, World!")
}`)

Current Supported Languages

These languages are implemented and usable in the syntaxtint.render function. if you notice a bug, please report it as a github issue, thanks!

  • C

Aliases: c

  • C#

Aliases: c#, csharp

  • C++

Aliases: c++, cpp

  • JavaScript

Aliases: javascript, js

  • JSON

Aliases: json

Current Themes

These themes are implemented and usable in the syntaxtint.render function. if you notice a bug, please report it as a github issue, thanks!

  • OneDark
  • OneLight

API Docs

function addLanguage(language: Language)

Adds the specified language to the list of usable languages.

function addTheme(theme: Theme)

Adds the specified to the list of usable themes.

function render(languageName: string, themeName: string, code: string)

Returns syntax-higlighted code as rendered html.

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.16

5 years ago

0.0.17

5 years ago

0.0.13

5 years ago

0.0.14

5 years ago

0.0.15

5 years ago

0.0.10

5 years ago

0.0.11

5 years ago

0.0.12

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago