Guides
Blocks
Plugins

HLJS

HLJS plugins uses Highlight.js to colorize your Code blocks.

The purpose of this plugin is to improve your frontend performance by using Highlight.js server side.

Install

$ npm install @notion-render/hljs-plugin

Usage

import { NotionRenderer } from '@notion-render/client';
import { Client } from '@notionhq/client';
import hljs from '@notion-render/hljs-plugin';

const client = new Client({ auth: process.env.NOTION_TOKEN });
const renderer = new NotionRenderer({ client });

renderer.use(hljs());

renderer.render(...blocks);

⚠️
Do not forget to import your favorite highlighting style from the 248 availables! More information on the Highlight.JS website!