homebrewery icon indicating copy to clipboard operation
homebrewery copied to clipboard

Experimental Header Navigation

Open G-Ambatte opened this issue 7 months ago • 15 comments

This PR adds a button to the BrewRenderer. When clicked, this exposes the header navigation window, which lists all of the elements with IDs in the document. It generates this information by calling querySelectorAll('[id]') to acquire a list of all elements that have an id attribute, then parsing these for the following conditions:

  • has the class page - depth: 0; text: 'Page' + page number
  • is h1 through h6 - depth: heading value, i.e. h1 => 1, h6 => 6; text: innerText value
  • all other elements - depth: 7; text: innerText value

From one of the documents in my local install DB:

CLOSED: image

OPEN: image

HOVERING OVER "PAGE 2: image

G-Ambatte avatar Jul 21 '24 11:07 G-Ambatte