Math, code and comments

Math, code and comments

Math, code blocks with colors and notes only you can see.

Math

Between $ in the middle of the text, like a2+b2=c2a^2 + b^2 = c^2, or between $$ as a block:

x=−b±b2−4ac2a x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Formulas become MathML: the browser draws them, with nothing to download.

Code

Three backticks, the language name and the code:

function hello(name) {
  return `Hello, ${name}!`;
}

The colors follow the language: go, js, py, sh, yaml, html, css and many others.

Comments

Text between %% and %% is a comment: it shows while you edit and never goes to the site.

Use them for reminders, drafts and instructions for whoever edits, like in the _index note of the site folder.

In the Studio, the formatting bar has the Comment (stays off the site) button. Narration skips comments too.

Code blocks in the Studio

In the Studio editor, a code block gets a background, the language name and a Copy button. The three backticks only show with the cursor inside the block.