Language
Comments
# and ### comments, where # is not a comment, and writing # in text.
Single-line comments
# starts a comment that runs to the end of the line. It can follow code:
# the page header
[h1]Welcome[end] # shown on every pageHTML ArcMoon builds
<h1>Welcome</h1>
Multi-line comments
Everything between ### and ### is a comment, on many lines or inside one:
###
Draft section:
not ready yet
###
[p]Ready ### and this is hidden ### now[end]HTML ArcMoon builds
<p>Ready now</p>
Between props
A prop list on several lines can have comments too:
[img =
src: "logo.svg", # 64 × 64
alt: "Logo"
!]HTML ArcMoon builds
<img src="logo.svg" alt="Logo">
Where # is not a comment
- Inside quotes:
[a = href: "/page#top"]. - Inside
${ }$: it's JavaScript, so use//and/* */. - Inside
[style]: it's CSS, so#888is a color and comments are/* */. - Inside a block with
arcm-raw: true.
${
// JavaScript comments in ${ }$
const page = "/page";
}$
[a = href: "/page#top"]Top[end]
[pre = arcm-raw: true]# shown as written[end]
[style]
/* CSS comments in [style] */
.note { color: #888; }
[end]HTML ArcMoon builds
<style>.note{color:#888}</style><a href="/page#top">Top</a>
<pre># shown as written</pre>
Writing # in text
In text, write \#. Try it: remove the backslash and press Run:
Without it, the rest of the line is a comment, and ArcMoon says so:
✗ [p] opened at 1:1 is missing [end]. The "#" on line 1 starts a comment, which hides the rest of that line, including its [end]. For the character itself, write \#Keeping comments in the HTML
By default, ArcMoon leaves comments out of the HTML. To keep them as HTML comments (<!-- -->), set removeComments to false in arcmoon.config.js:
export default {
removeComments: false
};Then arcm build turns every # and ### comment into an HTML comment, in the same place:
# Page header
[h1]Welcome[end] # shown on every page
###
License: MIT
###
[p]Hello[end]<!-- Page header-->
<h1>Welcome</h1> <!-- shown on every page-->
<!--
License: MIT
-->
<p>Hello</p>- It applies to every page built with that config.
- From JavaScript, pass the same option:
new ArcMoon({ src, removeComments: false }). - Comments in
${ }$(JavaScript) and[style](CSS) are never written to the HTML. - Useful for notes that should ship with the page, like a license.