s72
  • Code view

    data-lang

    A block of code with its language named in the caption, numbers down the side and a Copy button. data-lang picks the colouring and data-mark picks the lines to call out.

    With a caption and a note

    atlas.toml
    [build]
    out = "_site"
    watch = true
    drafts = false
    
    [links]
    check = true
    ignore = ["mailto:", "tel:"]

    Watch mode rebuilds on save. Drafts stay out of the output until the flag flips.

    html
    <figure>
      <figcaption>atlas.toml</figcaption>
      <pre data-lang="toml" data-mark="3"><code>[build]
    out = "_site"
    watch = true
    drafts = false
    
    [links]
    check = true
    ignore = ["mailto:", "tel:"]</code></pre>
      <p>Watch mode rebuilds on save. Drafts stay out of the output until the flag flips.</p>
    </figure>

    The <figcaption> carries the file name; s72.js adds the language chip and the Copy button beside it. A <p> after the <pre> becomes the note under the block.

    On its own

    # rebuild on every save
    $ atlas build --watch
    182 pages, 1.94 s, 1 warning
    html
    <pre data-lang="sh"><code># rebuild on every save
    $ atlas build --watch
    182 pages, 1.94 s, 1 warning</code></pre>

    A loose <pre> is wrapped in a <figure> for you, so it gets the same caption and button. In sh, comment lines are left out of what the button copies.

    Notes