mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
		
			Vendored
		
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
		
			Vendored
		
	
	
	
<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">
 | 
						|
        <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>
 | 
						|
  </body>
 | 
						|
 | 
						|
</html> |