This is a very rough demonstration of how to embed Hypothesis in a single page app.
When you click on the "Go to page two" button it loads the second "page" of the app. This page is just loaded by
JavaScript, without having the browser load a new page as it would normally do when following a link.
Importantly the JavaScript code does change URL in the browser's location bar though, using
history.pushState().
Before changing the URL it unloads Hypothesis from the page, and after changing the URL it reloads Hypothesis
into the page. This is to work around a limitation with Hypothesis - it doesn't detect URL changes done by
pushState()
and reload the annotations.