Full table of contents for Handbook

• Dec 29, 2022 - 19:02

During the initial planning for the MuseScore 4 Handbook, I created a script that can be used to generate a full table of contents listing all pages, headings & subheadings. I have created a page in the Appendix and copied the generated HTML there. It's usable as is, but there lots of possibility for improvement and I'd like to discuss the options.

Here is the generated page:


There is nothing automatic about this - whenever I want to update this page, I'd need to rerun my script (which takes a few minutes - not something you'd want to do on the fly) and then copy/paste the generated HTML into the relevant Appendix page.

You'll notice the pages themselves are links but the heading & subheadings within them are not. That's because, as far I can tell, this information is generally dynamically as the page it rendered and not available to my script that is crawling the pages via the JavaScript "fetch" API.

Here is the source for my script:


It is structured in a way that allows you to install it as a Chrome extension. There are all sorts of permission issues that limit the ways you can access web content, and I'm really very ignorant of the best practices here - I just kludged up something to get me through the design phase.

I've love it if someone who understands this stuff better could perhaps find a way to improve on this process. Meanwhile, I'm also to suggestions as to the best way to show this TOC - buried in the appendix surely isn't it. But I'm not sure it belongs on the main page either, and in any case that would probably lead to a recursion problem...


Do you still have an unanswered question? Please log in first to post your question.