:::meta description: Tern is a document format with the full power of HTML, CSS and JavaScript and none of HTML's verbosity: one file that renders itself in the browser. ::: ::site-nav # Tern {#top} ::toc **Tern gives you the full power of HTML, CSS and JavaScript without the verbosity of HTML.** A note is one HTML file that renders itself: its first line loads `tern.js`, and everything below it is written in a light, Markdown-like syntax that the browser turns into real HTML when the file is opened. ## A first note {#first-note} This line is all the setup a note needs: ```html ``` Everything after it is the note. Save the file next to `tern.js`, open it in a browser, and it renders: ```tern {.live} # Hello This is a note. It has *emphasis*, a [link](https://example.com), a formula, $e^{i\pi} + 1 = 0$, and a key to press, :kbd[Ctrl]+:kbd[S]. - [x] Write the first line - [ ] Publish it ``` Every example on these pages is live: it shows the source, the result, the HTML Tern made, and any diagnostics, all computed by `tern.js` in your browser. ## A tour {#tour} ### Math {#tour-math} TeX between dollars, typeset by KaTeX. A display formula with an id is numbered, and `@id` refers to it. ```tern {.live} The roots of $ax^2 + bx + c = 0$ are $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}. $$ {#eq-roots} By @eq-roots, a real root needs $b^2 \ge 4ac$. Prices like $5 stay prices. ``` ### Blocks {#tour-blocks} Three colons and a name wrap anything in an element. HTML names become that element; other names become a `div` with the name as its class, ready for your CSS. ```tern {.live} :::details[Why is the sky blue?] Short wavelengths scatter more: *Rayleigh scattering*. ::: :::aside This is an `