Basic ghost plugin

This commit is contained in:
Zef Hemel
2022-04-09 14:28:41 +02:00
parent 6ebf8e7f15
commit 8fafd1cd4a
19 changed files with 594 additions and 53 deletions
+9 -9
View File
@@ -33,15 +33,15 @@ export function TopBar({
<FontAwesomeIcon icon={faFileLines} />
</span>
<span className="current-page">{prettyName(pageName)}</span>
<button
onClick={(e) => {
// @ts-ignore
window.syncer();
e.stopPropagation();
}}
>
Sync
</button>
{/*<button*/}
{/* onClick={(e) => {*/}
{/* // @ts-ignore*/}
{/* window.syncer();*/}
{/* e.stopPropagation();*/}
{/* }}*/}
{/*>*/}
{/* Sync*/}
{/*</button>*/}
{notifications.length > 0 && (
<div className="status">
{notifications.map((notification) => (
+20 -2
View File
@@ -1,7 +1,11 @@
import { styleTags, tags as t } from "@codemirror/highlight";
import { BlockContext, LeafBlock, LeafBlockParser, MarkdownConfig, TaskList } from "@lezer/markdown";
import { commonmark, mkLang } from "./markdown/markdown";
import { BlockContext, LeafBlock, LeafBlockParser, MarkdownConfig, parseCode, TaskList } from "@lezer/markdown";
import { commonmark, getCodeParser, mkLang } from "./markdown/markdown";
import * as ct from "./customtags";
import { LanguageDescription, LanguageSupport } from "@codemirror/language";
import { StreamLanguage } from "@codemirror/stream-parser";
import { yaml } from "@codemirror/legacy-modes/mode/yaml";
import { javascriptLanguage } from "@codemirror/lang-javascript";
export const pageLinkRegexPrefix = /^\[\[([\w\s\/:,\.@\-]+)\]\]/;
@@ -126,6 +130,7 @@ const TagLink: MarkdownConfig = {
},
],
};
const WikiMarkdown = commonmark.configure([
WikiLink,
AtMention,
@@ -133,6 +138,19 @@ const WikiMarkdown = commonmark.configure([
TaskList,
UnmarkedUrl,
Comment,
parseCode({
codeParser: getCodeParser([
LanguageDescription.of({
name: "yaml",
support: new LanguageSupport(StreamLanguage.define(yaml)),
}),
LanguageDescription.of({
name: "javascript",
alias: ["js"],
support: new LanguageSupport(javascriptLanguage),
}),
]),
}),
{
props: [
styleTags({