1
0
forked from javalsai/website
javalsais-website/notes/example.html
2024-09-30 22:26:29 +02:00

31 lines
4.5 KiB
HTML

<!--# include virtual="/components/md-pre.html" -->
<h1 id="test-document">Test Document</h1>
<p>This is a text markdown document with even <code>code</code>,
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mi>a</mi><mi>T</mi><mi>e</mi><mi>X</mi><mo>=</mo><mfrac><mi>x</mi><mi>y</mi></mfrac></mrow><annotation encoding="application/x-tex">LaTeX = \frac{x}{y}</annotation></semantics></math>,</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode js"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">console</span><span class="op">.</span><span class="fu">log</span>(<span class="st">&#39;language codeblocks&#39;</span>)<span class="op">;</span></span></code></pre></div>
<p>and
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mi>a</mi><mi>T</mi><mi>e</mi><mi>X</mi><mspace width="0.222em"></mspace><mi>B</mi><mi>l</mi><mi>o</mi><mi>c</mi><mi>k</mi><mi>s</mi><mo>=</mo><mfrac><mi>x</mi><mi>y</mi></mfrac></mrow><annotation encoding="application/x-tex">
LaTeX~Blocks = \frac{x}{y}
</annotation></semantics></math></p>
<h2 id="and-ofc">and ofc</h2>
<p>a complex syntax example</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode rust"><code class="sourceCode rust"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> Handler<span class="op">&lt;</span>T<span class="op">:</span> <span class="pp">surrealdb::</span>Connection<span class="op">&gt;</span> <span class="op">{</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> config<span class="op">:</span> <span class="kw">crate</span><span class="pp">::config::</span>Schema<span class="op">,</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="at">#[</span>allow<span class="at">(</span>dead_code<span class="at">)]</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> db<span class="op">:</span> <span class="pp">surrealdb::</span>Surreal<span class="op">&lt;</span>T<span class="op">&gt;,</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="co">// This is a comment</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="co">/* And this</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a><span class="co">is multiline</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a><span class="co">*/</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a><span class="at">#[</span>async_trait<span class="at">]</span></span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a><span class="kw">impl</span><span class="op">&lt;</span>T<span class="op">:</span> <span class="pp">surrealdb::</span>Connection<span class="op">&gt;</span> EventHandler <span class="cf">for</span> Handler<span class="op">&lt;</span>T<span class="op">&gt;</span> <span class="op">{</span></span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a> <span class="kw">async</span> <span class="kw">fn</span> message(<span class="op">&amp;</span><span class="kw">self</span><span class="op">,</span> ctx<span class="op">:</span> Context<span class="op">,</span> msg<span class="op">:</span> Message) <span class="op">{</span></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a> <span class="kw">let</span> maybe_cmds <span class="op">=</span></span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a> <span class="pp">commands::parser::MsgParser::</span>new(<span class="op">&amp;</span><span class="kw">self</span><span class="op">.</span>config<span class="op">.</span>prefix<span class="op">.</span>to_string()<span class="op">,</span> <span class="op">&amp;</span>msg<span class="op">.</span>content)<span class="op">.</span>parse()<span class="op">;</span></span>
<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<!--# include virtual="/components/md-post.html" -->