Add Frontmatter Syntax Highlighting

This commit is contained in:
Mayuran Visakan 2024-02-20 14:43:26 +00:00
parent b86a8e7cff
commit 4ffdba811e
4 changed files with 98 additions and 3 deletions

2
.todo
View file

@ -1,7 +1,5 @@
Features:
Other:
☐ YAML Frontmatter Highlighting
☐ https://raw.githubusercontent.com/deathau/cm-editor-syntax-highlight-obsidian/main/mode/yaml-frontmatter/yaml-frontmatter.js
☐ Embed other online markdown files?
Code Referencing:

47
src/css/frontmatter.css Normal file
View file

@ -0,0 +1,47 @@
.cm-hmd-frontmatter.cm-inline-code,
.cm-hmd-frontmatter.cm-math {
color: var(--code-normal);
}
.cm-hmd-frontmatter.cm-hmd-frontmatter.cm-def.cm-def,
.cm-hmd-frontmatter.cm-comment,
.cm-hmd-frontmatter.cm-meta {
color: var(--code-comment);
}
.cm-hmd-frontmatter.cm-tag {
color: var(--code-tag);
}
.cm-hmd-frontmatter.cm-punctuation,
.cm-hmd-frontmatter.cm-bracket,
.cm-hmd-frontmatter.cm-hr {
color: var(--code-punctuation);
}
.cm-hmd-frontmatter.cm-number {
color: var(--code-value);
}
.cm-hmd-frontmatter.cm-qualifier,
.cm-hmd-frontmatter.cm-string,
.cm-hmd-frontmatter.cm-string-2 {
color: var(--code-string);
}
.cm-hmd-frontmatter.cm-operator {
color: var(--code-operator);
}
.cm-hmd-frontmatter.cm-link,
.cm-hmd-frontmatter.cm-variable,
.cm-hmd-frontmatter.cm-variable-2,
.cm-hmd-frontmatter.cm-variable-3 {
color: var(--code-property);
}
.cm-hmd-frontmatter,
.cm-hmd-frontmatter.cm-builtin,
.cm-hmd-frontmatter.cm-property,
.cm-hmd-frontmatter.cm-attribute,
.cm-hmd-frontmatter.cm-type {
color: var(--code-function);
}
.cm-hmd-frontmatter.cm-keyword {
color: var(--code-keyword);
}
.cm-hmd-frontmatter.cm-atom {
color: var(--code-important)
}

View file

@ -1,6 +1,7 @@
/** Import stylesheets */
@import url("./css/codeblocks.css");
@import url("./css/inlineCode.css");
@import url("./css/frontmatter.css");
@import url("./css/pdfExport.css");
@import url("./css/pickr.css");
@import url("./css/settings.css");

File diff suppressed because one or more lines are too long