<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>code &amp;mdash; Demo</title>
    <link>https://qua.name/demo/tag:code</link>
    <description>A playground for trying WriteFreely on qua.name. Log in as demo / demo; everything resets nightly at 04:00 Amsterdam time.</description>
    <pubDate>Tue, 01 Dec 2026 04:32:05 +0100</pubDate>
    <item>
      <title>Code</title>
      <link>https://qua.name/demo/code-blocks</link>
      <description>&lt;![CDATA[Put short bits of code inside a sentence between backticks: git status, filenamehere, br. Inside backticks nothing is formatted, so underscores, asterisks and angle brackets stay as typed.&#xA;&#xA;Code blocks&#xA;&#xA;For longer code, put three backticks on the line above and below. Add a language name right after the opening backticks to get syntax highlighting:&#xA;&#xA;~markdown&#xA;def greet(name):&#xA;    return f&#34;Hello, {name}!&#34;&#xA;~&#xA;&#xA;This becomes:&#xA;&#xA;def greet(name):&#xA;    return f&#34;Hello, {name}!&#34;&#xA;&#xA;Without a language name the block is shown as plain monospaced text:&#xA;&#xA;No language given, so no colours.&#xA;    Indentation and   spacing are kept.&#xA;&#xA;A few more languages&#xA;&#xA;package main&#xA;&#xA;import &#34;fmt&#34;&#xA;&#xA;func main() {&#xA;&#x9;fmt.Println(&#34;Hello from Go&#34;)&#xA;}&#xA;&#xA;back up the drafts folder&#xA;tar czf drafts-$(date +%F).tar.gz ~/drafts&#xA;&#xA;(defun count-words-in-buffer ()&#xA;  &#34;Show the number of words in the buffer.&#34;&#xA;  (interactive)&#xA;  (message &#34;%d words&#34; (count-words (point-min) (point-max))))&#xA;&#xA;p class=&#34;note&#34;Hello, emworld/em./p&#xA;&#xA;SELECT title, created FROM posts WHERE created   &#39;2026-01-01&#39; ORDER BY created DESC;&#xA;&#xA;Which language names work?&#xA;&#xA;Highlighting is done in your reader&#39;s browser by highlight.js, and only for blocks that have a language name. WriteFreely ships highlight.js language files for about 180 languages, from bash, c, cpp, css, go, java, javascript, json, python, ruby, rust, sql and yaml to fortran, haskell, lisp, ocaml and x86asm.&#xA;&#xA;It also understands a few short forms: sh for bash, js and jsx for JavaScript, html for HTML/XML, and c, h or c++ for C/C++.&#xA;&#xA;#code #markdown&#xA;&#xA;This is a demo post on qua.name; see About this demo.]]&gt;</description>
      <content:encoded><![CDATA[<p>Put short bits of code inside a sentence between backticks: <code>git status</code>, <code>file_name_here</code>, <code>&lt;br&gt;</code>. Inside backticks nothing is formatted, so underscores, asterisks and angle brackets stay as typed.</p>

<h2 id="code-blocks">Code blocks</h2>

<p>For longer code, put three backticks on the line above and below. Add a language name right after the opening backticks to get syntax highlighting:</p>

<pre><code class="language-markdown">```python
def greet(name):
    return f&#34;Hello, {name}!&#34;
```
</code></pre>

<p>This becomes:</p>

<pre><code class="language-python">def greet(name):
    return f&#34;Hello, {name}!&#34;
</code></pre>

<p>Without a language name the block is shown as plain monospaced text:</p>

<pre><code>No language given, so no colours.
    Indentation and   spacing are kept.
</code></pre>

<h2 id="a-few-more-languages">A few more languages</h2>

<pre><code class="language-go">package main

import &#34;fmt&#34;

func main() {
	fmt.Println(&#34;Hello from Go&#34;)
}
</code></pre>

<pre><code class="language-sh"># back up the drafts folder
tar czf drafts-$(date +%F).tar.gz ~/drafts
</code></pre>

<pre><code class="language-lisp">(defun count-words-in-buffer ()
  &#34;Show the number of words in the buffer.&#34;
  (interactive)
  (message &#34;%d words&#34; (count-words (point-min) (point-max))))
</code></pre>

<pre><code class="language-html">&lt;p class=&#34;note&#34;&gt;Hello, &lt;em&gt;world&lt;/em&gt;.&lt;/p&gt;
</code></pre>

<pre><code class="language-sql">SELECT title, created FROM posts WHERE created &gt; &#39;2026-01-01&#39; ORDER BY created DESC;
</code></pre>

<h2 id="which-language-names-work">Which language names work?</h2>

<p>Highlighting is done in your reader&#39;s browser by <a href="https://highlightjs.org" rel="nofollow">highlight.js</a>, and only for blocks that have a language name. WriteFreely ships highlight.js language files for about 180 languages, from <code>bash</code>, <code>c</code>, <code>cpp</code>, <code>css</code>, <code>go</code>, <code>java</code>, <code>javascript</code>, <code>json</code>, <code>python</code>, <code>ruby</code>, <code>rust</code>, <code>sql</code> and <code>yaml</code> to <code>fortran</code>, <code>haskell</code>, <code>lisp</code>, <code>ocaml</code> and <code>x86asm</code>.</p>

<p>It also understands a few short forms: <code>sh</code> for bash, <code>js</code> and <code>jsx</code> for JavaScript, <code>html</code> for HTML/XML, and <code>c</code>, <code>h</code> or <code>c++</code> for C/C++.</p>

<p><a href="/demo/tag:code" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">code</span></a> <a href="/demo/tag:markdown" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">markdown</span></a></p>

<p><em>This is a demo post on <a href="https://qua.name" rel="nofollow">qua.name</a>; see <a href="/demo/about-this-demo" rel="nofollow">About this demo</a>.</em></p>
]]></content:encoded>
      <guid>https://qua.name/demo/code-blocks</guid>
      <pubDate>Sun, 29 Nov 2026 04:00:11 +0100</pubDate>
    </item>
  </channel>
</rss>