Skip to content

bakkenbaeck/highlightjs-func

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highlight.js language definition for TON FunC

FunC - a language grammar for highlight.js

FunC is a high-level language FunC is used to program smart contracts on TON.

Usage

Simply include the Highlight.js library in your webpage or Node app, then load this module.

React

You need to import both Highlight.js and third-party language like Func:

import React from 'react'
import hljs from "highlight.js/lib/core";
import { type LanguageFn } from "highlight.js";
import func from "@bakkenbaeck/highlightjs-func";
import "highlight.js/styles/atom-one-light.css"; # your favorite theme

hljs.registerLanguage("fc", func as LanguageFn);

export const CodeComponent: React.FC<{content: string}> = ({content}) => {
    return
    (
        <pre>
            <code dangerouslySetInnerHTML={{__html: hljs.highlight(content, { language: "fc" }).value}} />
        </pre>
    )
};

License

Highlight.js is released under the MIT License. See LICENSE file for details.

Links

Releases

No releases published

Packages

No packages published