Skip to content

Vault Publisher 0.1.3

Choose a tag to compare

@NoteNerdOfficial NoteNerdOfficial released this 07 Nov 20:36
· 32 commits to main since this release

Every heading on a published page is now an address you can hand over.

A heading you can link to

Headings have always had ids, and note.html#why-notes-decay has always
worked. Nothing on the page said so, so sharing a section meant knowing the
fragment was there and spelling the slug by hand.

Now a chain icon sits against the heading's last word, showing when the
pointer is anywhere on the heading. Pressing it copies the address rather
than following it
-- a reader who wants to send someone this section is
already standing in it, so the jump is the one thing the press cannot
usefully do. The icon becomes a tick, a small "Copied" appears above it, and
the address bar is made to agree so the link can also be taken from there.

Right-click anywhere on the heading

The heading's own words are the link now, which is the only way the
browser's own Copy link address can be offered without aiming at
anything first. They are not dressed as a link and clicking them does
nothing: this is where the reader already is, and a double-click picking a
word out of a heading should not send anyone anywhere or leave a history
entry behind. A modified or middle click still gets the browser's usual
answer, and the keyboard -- which has no icon to aim at -- copies by
activating the link.

With scripting off, the heading jumps and the address bar holds the link.

What it does not disturb

  • Comments keep their anchors. The review overlay anchors a comment to a
    hash of its block's text, so a "Copy" label inside a heading would move
    every anchor on every commented heading in a vault. The control is two
    icons and a title, its reply is a pseudo-element, and the heading's text
    is identical before and after -- asserted by a test, so it stays that way.
  • Headings keep their height. The icon hangs in space the last word
    reserves rather than standing in the line, where a box that size would
    push every heading taller to make room for it. Nothing moves when it
    appears.
  • A heading that wraps keeps its icon. It travels with the last word in
    a box that cannot break, so it is never stranded alone on a line.
  • A heading that already holds a link keeps its words. ## [[Note]] is
    an ordinary thing to write and HTML has no nested links. Those headings
    get a separate anchor for the control instead, which costs them the
    right-click and nothing else.

The icon is sized against the heading rather than in pixels, since one glyph
has to read as a control beside a section title and beside sixteen-point
text, and it is hidden in print.