Skip to content

Zigistry/Zilite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3d4ebd6 · Sep 12, 2024

History

24 Commits
Sep 8, 2024
Sep 12, 2024
Sep 9, 2024
Sep 8, 2024
Sep 8, 2024
Sep 8, 2024
Sep 12, 2024
Sep 9, 2024

Repository files navigation

Yet another code highlighter.

  • Uses no dependencies.
  • You can contribute more programming languages.
  • Is extremely small size.

How to use?

Just see the following example:

For basic HTML:

<!DOCTYPE html>

<html>

<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/src/styles/darkMode.css" />
</head>

<body>
    <div class="language-zig nice-code-block">
        const zilite:[]const u8 = "Syntax Highlighter";
    </div>
    <script type="module">
        import { highlightElements } from "https://cdn.jsdelivr.net/npm/[email protected]";
        import { zig } from "https://cdn.jsdelivr.net/npm/[email protected]/src/language/zig.js";
        highlightElements(zig, "language-zig");
    </script>
</body>

</html>

For use as a node module:

npm i zilite
import * as hl from "higherlight";
import { zig } from "higherlight/src/language/zig";

const highlightedCode = hl.highlight(zig, "const x = 'asdf';");
console.log(highlightedCode);

Understood? or Still confused? Create a new issue and clear your doubts.

Contributing:

Please ⭐️ this repo, create pull requests, issues, etc.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published