nml/readme/Raw.html
2024-11-03 14:12:43 +01:00

1 line
No EOL
4.2 KiB
HTML

<!DOCTYPE HTML><html><head><meta charset="UTF-8"><title>NML | Raw</title><link rel="stylesheet" href="../style.css"></head><body><div class="layout"><input id="navbar-checkbox" class="toggle" type="checkbox" style="display:none" checked><div id="navbar"><ul><li class="navbar-entry"><a href="Getting Started.html">Getting Started</a></li><li class="navbar-entry"><a href="Sections.html">Sections</a></li><li class="navbar-entry"><a href="Variables.html">Variables</a></li><li class="navbar-entry"><a href="References.html">References</a></li><li class="navbar-entry"><a href="Imports.html">Imports</a></li><li class="navbar-entry-current"><a href="Raw.html">Raw</a></li><li class="navbar-entry"><a href="Comments.html">Comments</a></li><li><details><summary class="navbar-category">External Tools</summary><ul><li class="navbar-entry"><a href="Graphviz.html">Graphviz</a></li><li class="navbar-entry"><a href="LaTeX.html">LaTeX</a></li></ul></details></li><li><details><summary class="navbar-category">Blocks</summary><ul><li class="navbar-entry"><a href="Blockquotes.html">Blockquotes</a></li><li class="navbar-entry"><a href="Code.html">Code</a></li><li class="navbar-entry"><a href="Lists.html">Lists</a></li></ul></details></li><li><details><summary class="navbar-category">Lua</summary><ul><li class="navbar-entry"><a href="Lua Basics.html">Lua</a></li></ul></details></li><li><details><summary class="navbar-category">Styles</summary><ul><li class="navbar-entry"><a href="Basic Styles.html">Basic</a></li><li class="navbar-entry"><a href="Basic Layouts.html">Layouts</a></li><li class="navbar-entry"><a href="User-Defined Styles.html">User-Defined</a></li></ul></details></li></ul></div><label for="navbar-checkbox" class="navbar-checkbox-label">&#9776;</label><div class="content"><div class="toc"><span>Table of Content</span><ol><li value="1"><a href="#Inline_raws">Inline raws</a></li><li value="2"><a href="#Block_raws">Block raws</a></li><li value="3"><a href="#Properties">Properties</a></li></div><p>Raws are elements to be rendered as-is by the compiler.</p><h1 id="Inline_raws">1. Inline raws <a class="section-link" href="#Inline_raws">🔗 </a> </h1><p>Inline raws are meant to be used inside a paragraph and thus, don't break the paragraph. Here's the syntax for inline raws: <a class="inline-code"><code><span style="color:#c0c5ce;">{?[kind=inline] CONTENT ?}</span></code></a>. Here, <a class="inline-code"><code><span style="color:#c0c5ce;">CONTENT</span></code></a> will added directly to the resulting document.</p><p><b>Example</b></p><div class="split-container"><div class="split"><p><a class="inline-code"><code><span style="color:#c0c5ce;">{? &lt;a style=&quot;color:red&quot;&gt; ?} Some text {? &lt;/a&gt; ?}</span></code></a></p></div><div class="split"><p><a style="color:red"> Some text </a></p></div></div><p>Raws are better paired with Lua, see <a href="User-Defined Styles.html#Defining_a_custom_style">Defining a custom style</a> for how to use them.</p><h1 id="Block_raws">2. Block raws <a class="section-link" href="#Block_raws">🔗 </a> </h1><p>You can have raw elements take a full block to define additional capabilities. The syntax is similar to inline raws, except that <a class="inline-code"><code><span style="color:#c0c5ce;">kind=block</span></code></a> is used instead.</p><p><b>Example</b></p><div class="centered"><div class="split-container"><div class="split"><p><a class="inline-code"><code><span style="color:#c0c5ce;">{?[kind=block] &lt;img src=&quot;assets/duck.jpg&quot; style=&quot;max-height:100%;max-width:100%;&quot;&gt; ?}</span></code></a></p></div><div class="split"><img src="assets/duck.jpg" style="max-height:100%;max-width:100%;"></div></div></div><h1 id="Properties">3. Properties <a class="section-link" href="#Properties">🔗 </a> </h1><ul><li><a class="inline-code"><code><span style="color:#c0c5ce;">kind</span></code></a> The element kind of the resulting raw, defaults to <em>inline</em>, allowed values:</li><ol><li value="1"><a class="inline-code"><code><span style="color:#c0c5ce;">inline</span></code></a>: Make the raw element inline</li><li value="2"><a class="inline-code"><code><span style="color:#c0c5ce;">block</span></code></a>: Make the raw element a full block</li></ol></ul><p></p></div></div></body></html>