mirror of
https://github.com/kou029w/quot.git
synced 2025-01-31 14:28:06 +00:00
Compare commits
No commits in common. "85b02bf020d7d78be206fde17408d024cc0b0c52" and "ad1e6ba9e4583d4a08546b9616d18f00ffe19106" have entirely different histories.
85b02bf020
...
ad1e6ba9e4
5 changed files with 11 additions and 40 deletions
|
@ -1,7 +1,7 @@
|
|||
@top Document { heading line* }
|
||||
|
||||
heading { Heading? "\n" }
|
||||
line { Indent* ((AutoLink | Code | word) space*)* "\n" }
|
||||
line { Indent* ((AutoLink | word) space*)* "\n" }
|
||||
|
||||
@tokens {
|
||||
space { $[ \t] }
|
||||
|
@ -9,6 +9,5 @@ line { Indent* ((AutoLink | Code | word) space*)* "\n" }
|
|||
Heading { ![\n]+ }
|
||||
Indent { space }
|
||||
AutoLink { ("http" | "https") "://" word }
|
||||
Code { "`" ![`\n]+ "`" | ($[$%] " ") ![\n]+ }
|
||||
@precedence { AutoLink, Code, word }
|
||||
@precedence { AutoLink, word }
|
||||
}
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
import {LRParser} from "@lezer/lr"
|
||||
export const parser = LRParser.deserialize({
|
||||
version: 14,
|
||||
states: "#rOQOPOOOOOO'#Cg'#CgOYOPO'#CgQ_OQOOOOOO,59R,59ROOOO'#Cc'#CcOpOQO'#CiO!ROSO'#CdOsOQO'#CiOOOO'#Ci'#CiOOOO'#Cb'#CbQ_OQOOOOOO-E6a-E6aO!dOQO,59TOOOO,59T,59TOOOO'#Ce'#CeO!rOSO,59OOOOO-E6b-E6bOOOO-E6`-E6`OOOO1G.o1G.oOOOO-E6c-E6c",
|
||||
stateData: "#Y~OQQO[PO~O[SO~ORTOSVOTVO[XO^VO~ORTOSVOTVO[^O^VO~O__OSWXTWX[WX^WX~OSVOTVO[cO^VO~O__OSWaTWa[Wa^Wa~OST^T~",
|
||||
goto: "!U^PPPPPP_elwP}P!QQZRRbZSURZR[USWRZQ]UTaW]Q`VRd`RROTYRZ",
|
||||
nodeNames: "⚠ Document Heading Ind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!bq!Pz!P!Q)m!Q~zV)tVQP^UOXzXY!bZpzpq!bq!Pz!P!Q*Z!Q~zV*bTQP^UOX*qXY!bZp*qpq!bq~*qV*zTQPSU^UOX*qXY!bZp*qpq!bq~*qV+bVQP^UOXzXY!bZpzpq!bq![z![!])P!]~z",
|
||||
tokenData: "(U~RWOXkXY!^YZ!mZpkpq!^q#[k#[#]!r#]~kVrTQP]UOXkXY!RZpkpq!Rq~kP!WQQPOY!RZ~!RV!gQQPRQ^SOY!RZ~!R~!rOZ~V!yVQP]UOXkXY!RZpkpq!Rq#hk#h#i#`#i~kV#gVQP]UOXkXY!RZpkpq!Rq#hk#h#i#|#i~kV$TVQP]UOXkXY!RZpkpq!Rq#dk#d#e$j#e~kV$qXQP]UOXkXY!RZpkpq!Rq![k![!]%^!]#gk#g#h'h#h~kV%eVQP]UOXkXY!RZpkpq!Rq!Pk!P!Q%z!Q~kV&RVQP]UOXkXY!RZpkpq!Rq!Pk!P!Q&h!Q~kV&oTQP]UOX'OXY!RZp'Opq!Rq~'OV'XTQPSU]UOX'OXY!RZp'Opq!Rq~'OV'oVQP]UOXkXY!RZpkpq!Rq![k![!]%^!]~k",
|
||||
tokenizers: [0, 1, 2],
|
||||
topRules: {"Document":[0,1]},
|
||||
tokenPrec: 97
|
||||
tokenPrec: 82
|
||||
})
|
||||
|
|
|
@ -13,7 +13,6 @@ export const quotLanguage = LRLanguage.define({
|
|||
Heading: t.heading,
|
||||
Indent: t.separator,
|
||||
AutoLink: t.link,
|
||||
Code: t.monospace,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
@ -30,22 +29,10 @@ export const quotHighlighting = syntaxHighlighting(
|
|||
{
|
||||
tag: t.separator,
|
||||
letterSpacing: "1.5em",
|
||||
"&:last-child:after": {
|
||||
content: `"•"`,
|
||||
marginInline: "-0.9em",
|
||||
},
|
||||
},
|
||||
{
|
||||
tag: t.link,
|
||||
class: "auto-link",
|
||||
},
|
||||
{
|
||||
tag: t.monospace,
|
||||
background: "var(--nc-bg-3)",
|
||||
borderRadius: "0.25em",
|
||||
padding: "0.2em 0.4em",
|
||||
fontSize: "0.9em",
|
||||
fontFamily: "var(--nc-font-mono)",
|
||||
},
|
||||
])
|
||||
);
|
||||
|
|
|
@ -8,13 +8,6 @@
|
|||
--nc-ac-tx: var(--nc-tx-1);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--nc-lk-1: #66adff;
|
||||
--nc-lk-2: #a8caf0;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
padding-inline: 0.75rem;
|
||||
max-inline-size: 80rem;
|
||||
|
@ -38,13 +31,10 @@ header h1 > :is(a, a:hover) {
|
|||
}
|
||||
|
||||
header nav > * {
|
||||
margin: 0.75rem;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
header nav > * + * {
|
||||
margin-inline-start: 0.75rem;
|
||||
}
|
||||
|
||||
a[href^="/"] {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { onCleanup, onMount } from "solid-js";
|
||||
import { minimalSetup } from "codemirror";
|
||||
import { emacsStyleKeymap, indentWithTab } from "@codemirror/commands";
|
||||
import { indentService, indentUnit } from "@codemirror/language";
|
||||
import { indentUnit } from "@codemirror/language";
|
||||
import { EditorView, keymap } from "@codemirror/view";
|
||||
import type Pages from "../../protocol/pages";
|
||||
import "./editor.css";
|
||||
|
@ -37,11 +37,6 @@ export default (props: {
|
|||
}),
|
||||
EditorView.lineWrapping,
|
||||
indentUnit.of(" "),
|
||||
indentService.of((context, pos) => {
|
||||
const previousLine = context.lineAt(pos, -1).text;
|
||||
if (previousLine.trim() === "") return null;
|
||||
return /^[ \t]*/.exec(previousLine)?.[0]?.length ?? null;
|
||||
}),
|
||||
keymap.of([indentWithTab, ...emacsStyleKeymap]),
|
||||
minimalSetup,
|
||||
quotLanguage,
|
||||
|
|
Loading…
Add table
Reference in a new issue