Skip to content

Instantly share code, notes, and snippets.

View Viiprogrammer's full-sized avatar
🤩
Working hard on Opengram

Maksim Viiprogrammer

🤩
Working hard on Opengram
View GitHub Profile
#include <LiquidCrystal.h>
#include <EEPROM.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#define BTN_UP 1
#define BTN_DOWN 2
#define BTN_LEFT 3
#define BTN_RIGHT 4
#define BTN_SELECT 5
@Viiprogrammer
Viiprogrammer / docusaurus-mermaid.md
Last active February 12, 2023 11:52
docusaurus-mermaid

I couldn't find any solution to use Mermaid without changing the theme to @docusaurus/theme-mermaid and trying to write a solution, and... it works great.

Create mermaid.js in /src/js/ and use it in MDX as below

(Don't forget remove .example extension from example.mdx.example)

import React, { useEffect } from 'react'
import { useColorMode } from '@docusaurus/theme-common';
import mermaid from "mermaid";
mermaid.initialize({
startOnLoad: true,
theme: 'neutral'
});
const Mermaid = ({ chart }) => {
var types = {
'339966': 'voicer',
'00a650': 'voicer',
'800000': 'techie',
'ebd800': 'translator',
'f7941d': 'decorator',
'000080': 'seeder',
'b523c5': 'releaser',
'33cccc': 'designer'
}