2025-03-30 23:09:17 +03:00

85 lines
4.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../../style.css">
<base target="_parent">
<title data-trilium-title>Code blocks</title>
</head>
<body>
<div class="content">
<h1 data-trilium-h1>Code blocks</h1>
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<div class="content">
<div class="ck-content">
<p>Code blocks are useful to add short snippets of code blocks inside text
notes. Depending on your preference, it's possible to enable or disable
word wrapping for these code blocks.</p>
<p>We added syntax highlighting to code blocks as well. When a code block
is first created it will try to automatically determine the programming
language, should that fail it is possible to manually adjust it. The color
scheme for the syntax highlighting is adjustable in settings. </p><pre><code class="language-application-javascript-env-frontend">function helloWorld() {
alert("Hello world");
}</code></pre>
<p>For larger pieces of code it is better to use a code note, which uses
a fully-fledged code editor (CodeMirror). For an example of a code note,
see <a class="reference-link" href="../Scripting%20examples/Custom%20request%20handler.js">Custom request handler</a>.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>