mirror of
https://github.com/zadam/trilium.git
synced 2024-12-25 00:34:08 +08:00
Page:
Code notes
Pages
Advanced showcases
Anonymized database
Apache proxy setup
Archived notes
Attachments
Attribute inheritance
Attributes
Backup
Book note
Bookmarks
Canvas note
Cloning notes
Code notes
Custom request handler
Custom widget
Data directory
Day notes
Default note title
Desktop installation
Docker server installation
Document
ETAPI
Error logs
Events
Evernote import
FAQ
Frontend Basics
Home
Images
Keyboard shortcuts
Kubernetes server installation
Link map
Links
Manual server installation
Markdown
Mobile frontend
Nginx proxy setup
NixOS server installation
Note hoisting
Note map
Note navigation
Note revisions
Note
Onenote
Packaged server installation
Patterns of personal knowledge base
Privacy policy
Promoted attributes
Protected notes
Read only note
Relation map
Release notes v0.48
Saved search
Screenshot tour
Script API
Scripts
Search
Server installation
Sharing
Sorting
Synchronization
TLS configuration
Task manager
Template
Text notes
Theme Gallery
Themes
Tree concepts
Tree manipulation
Troubleshooting
Upgrading Trilium
Web clipper
Weight tracker
Widget Basics
Workspace
No results
6
Code notes
zadam edited this page 2022-12-08 00:03:43 +01:00
Table of Contents
Trilium supports creating "code" notes, i.e. notes which contain some sort of formal code - be it programming language (C++, JavaScript), structured data (JSON, XML) or other types of codes (CSS etc.).
This can be useful for a few things:
- computer programmers can store code snippets as notes with syntax highlighting
- JavaScript code notes can be executed inside Trilium for some extra functionality
- we call such JavaScript code notes "scripts" - see Scripts
- JSON, XML etc. can be used as storage for structured data (typically used in conjunction with scripting)
Extra languages
Trilium supports syntax highlighting for many languages, but by default displays only some of them (to reduce the number of items). You can add extra languages in Options -> Code notes.
Code blocks
An alternative to the code note is a "code block" - feature of a text note which can add short snippets of code to the text editor. The disadvantage is that code blocks don't support syntax highlighting.
- Screenshot tour
- Basic concepts
- Installation & setup
- Advanced usage
- Developer guides
- FAQ
- Troubleshooting
Back to Overview