homebrewery
homebrewery copied to clipboard
Experimental Header Navigation
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
throughh6
- 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:
OPEN:
HOVERING OVER "PAGE 2: