ArcMoon 1.1.0

Start

Language

Reference

Nothing matches “”.

↑↓ move Enter open Esc close

Language

Raw text

arcm-raw: true writes a body exactly as it is: code samples, inline scripts, JSON.

What it does

Normally ArcMoon reads a block's body: blocks become elements, # starts a comment, ${ }$ runs. With arcm-raw: true, it reads nothing: the body is written exactly as it is. Try it: remove arcm-raw: true and press Run:

index.arcm
[pre = arcm-raw: true]
[b]bold?\[end] ${ 1 + 1 }$ # a comment?
[end]
Result

With it, you see the code as written. Without it, [b] becomes bold, the comment disappears and ${ 1 + 1 }$ becomes 2.

What stays as written

  • Blocks, comments, ${ }$ and runtime ${ }$: written as text.
  • Spaces, indents and line breaks: kept exactly.
  • Backslashes: kept, except before [.
  • < and &: escaped in the HTML, so tags show as text instead of becoming elements.
index.arcm
[pre = arcm-raw: true]
<b>Tags</b> & symbols are shown, not used.
    Spaces and line breaks stay.
Backslashes stay: C:\Users \# \\
[end]
HTML ArcMoon builds
<pre>
&lt;b>Tags&lt;/b> &amp; symbols are shown, not used.
    Spaces and line breaks stay.
Backslashes stay: C:\Users \# \\
</pre>

Where the body ends

The raw body ends at the first [end, whatever follows it: [end], [end:b] or [end:pre]. To show an [end inside, write \[end. Opening blocks need nothing:

index.arcm
[pre = arcm-raw: true]
[p]Hello [b]world\[end:b]\[end:p]
[end]
HTML ArcMoon builds
<pre>
[p]Hello [b]world[end:b][end:p]
</pre>

Forget one, and the body ends early:

[pre = arcm-raw: true][b]x[end:b] and more[end]

✗ [end:b] does not match [pre] opened at 1:1

Inline scripts

A [script] body is read like any other, so JavaScript with [ or # breaks it. Add arcm-raw: true:

# ✗ [1] opens a block, and # starts a comment
[script]const list = [1, 2]; const tag = "#news";[end]

# ✓ written as it is
[script = arcm-raw: true]const list = [1, 2]; const tag = "#news";[end]

Inside a script, < and & stay as they are, so JavaScript and JSON keep working. A JSON data block:

index.arcm
[script = type: "application/json", id: "data", arcm-raw: true]
{ "items": [1, 2, 3], "tag": "#news" }
[end]
HTML ArcMoon builds

For code that runs in the browser, runtime code or [script = src: "./app.js" !] is usually better: it is bundled and checked.

No need in [style]

[style] is read as CSS already: # is a color and [href] a selector. It doesn't need arcm-raw. See Styles.

On a component

On a component, the body is passed to its slot as plain text:

index.arcm
[import = Box: "./Box.arcm" !]
[Box = arcm-raw: true][b]shown as text\[end][end:Box]
HTML ArcMoon builds
<div class="box">[b]shown as text[end]</div>

Rules

  • The value must be true. arcm-raw: "yes" does nothing.
  • It works on any block with a body, and never appears in the HTML.
  • Add arcm-syntax: "js" to tell editors the body's language (experimental: no editor uses it yet).