greengeek / trilium-obsidian-theme

Dark theme with minor purple highlights for Trilium Notes
GNU General Public License v3.0
20 stars 0 forks source link

Code highlighting #1

Open smallkaka opened 11 months ago

smallkaka commented 11 months ago

How would I set up code highlighting? This is my current code highlighting:

2023-12-07_164707

simonxiao86 commented 2 days ago

Modify the Trilium-SyntaxHighlightWidget plugin SyntaxHighlightWidget.js file, the template code on the top.

const TEMPLATE = `
<div style="padding: 10px; border-top: 1px solid var(--main-border-color); contain: none;">
<style>
/* <link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/vs.min.css" rel="stylesheet"> */
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#eff;background:#212121}.hljs ::selection,.hljs::selection{background-color:#353535;color:#eff}.hljs-comment{color:#4a4a4a}.hljs-tag{color:#b2ccd6}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#eff}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f07178}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f78c6c}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ffcb6b}.hljs-strong{font-weight:700;color:#ffcb6b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#c3e88d}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#89ddff}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#82aaff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c792ea}.hljs-emphasis{color:#c792ea;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#ff5370}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}
</style>
</div>`;

rfc:material-darker.min.css