antoniotejada / Trilium-SyntaxHighlightWidget

Syntax highlight Trilium widget for editable note codeblocks using highlight.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trilium-SyntaxHighlightWidget

Syntax highlight Trilium widget for editable note codeblocks using highlight.js

Features

  • Live syntax highlighting of any codeblock inside a text note using automatic language detection, unless plaintext is selected.
  • The highlighting is not saved as formatting with the note, but just view-time markers like that highlighting that happens when you do searching.

Installation

  • Create a code note of type JS Frontend with the contents of SyntaxHighlightWidget.js and the label #widget
  • Attach the highlight.min.js file to that note
  • To enable debug output, set the code note #debugLevel attribute to one of error, warn, info, log, debug (default is info)

Todo

  • Honor language attribute when different from plaintext instead of using automatic?
  • Allow specifying the style sheet as code and/or text note attribute?
  • Readonly note support?

Discussions

zadam/trilium#2822

Video

sandbox.-.Trilium.Notes.2022-04-28.08-01-40_rescaled.mp4

About

Syntax highlight Trilium widget for editable note codeblocks using highlight.js

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%