1
0
Fork 0
mirror of https://github.com/kou029w/quot.git synced 2025-01-19 00:18:09 +00:00
quot/app/syntax/quot.ts

45 lines
929 B
TypeScript
Raw Normal View History

2022-09-16 21:30:29 +09:00
import { styleTags, tags as t } from "@lezer/highlight";
import {
HighlightStyle,
LRLanguage,
syntaxHighlighting,
} from "@codemirror/language";
import { parser } from "./quot.grammar.js";
export const quotLanguage = LRLanguage.define({
parser: parser.configure({
props: [
styleTags({
Heading: t.heading,
AutoLink: t.link,
2022-09-17 18:58:07 +09:00
Code: t.monospace,
2022-09-16 21:30:29 +09:00
}),
],
}),
});
export const quotHighlighting = syntaxHighlighting(
HighlightStyle.define([
{
tag: t.heading,
fontWeight: "bold",
fontSize: "1.25em",
marginBlockEnd: "0.5em",
},
{
tag: t.link,
class: "auto-link",
},
2022-09-17 18:58:07 +09:00
{
tag: t.monospace,
2022-09-19 14:16:41 +09:00
borderStyle: "solid",
borderColor: "var(--nc-bg-3)",
borderWidth: "1px",
2022-09-17 19:01:37 +09:00
borderRadius: "0.25em",
padding: "0.2em 0.4em",
fontSize: "0.9em",
fontFamily: "var(--nc-font-mono)",
2022-09-17 18:58:07 +09:00
},
2022-09-16 21:30:29 +09:00
])
);