WebHost: render setup guides and game info pages to html on server
What is this fixing or adding?
Removes remaining CDN use, which means people with default uMatrix config can use the sites now, and in fact JS in general is not needed, allowing noscript users to also view the pages. As a result, I consider this a bugfix.
How was this tested?
locally
If this makes graphical changes, please attach screenshots.
Hopefully not, I didn't notice anything at least.
I would honestly prefer to not merge/deploy this for 0.5.1 because this change might "break" apworlds and that would possibly either delay 0.5.1 further or leave apworld devs in a bad spot.
Huh, the unittests pass just fine for me locally.
tests are still failing due to what looks like a similar initialization issue which from some local testing (read: deleting /WebHostLib/static/generated) the entire /tutorial page no longer resolves until i switched back and forth to main to recreate the folder
http://localhost/tutorial/ still does not resolve correctly after deleting and reverting webhostlib so i'm not sure that really was an outdated test (even if it wasn't testing correctly anymore)
http://localhost/tutorial/still does not resolve correctly after deleting and reverting webhostlib so i'm not sure that really was an outdated test (even if it wasn't testing correctly anymore)
should be fixed now
with my commented bugfix and the (now linked) whitespace fixes to the hk docs I'm fine from a non-code review and from a world maintainer perspective with this change,
One big gripe i have though is this removes the possibility to click on headers to get anchored links, but even if that's an intentional change we are willing to make, the fact that the headers still look clickable is going to cause bug reports instead of an acknowledgement that the feature was removed
new problem, the anchor links to the relevant setup guides that the Supported Games create are not aligned with the ids the tutorial page gives them,
the Supported Games page sends you to http://localhost/tutorial/#Adventure
while the anchor that works is http://localhost/tutorial/#adventure
similarly with spaces http://localhost/tutorial/#Hollow%20Knight vs http://localhost/tutorial/#hollow-knight
Fixed the anchors, it was as simple as telling markdown to load the extension we tried to configure. I feel like trying to set options for an extension that isn't loaded should at least raise a KeyError, but it is what is -.-
Messenger guide before/after.
Messenger guide with four-space indentations after.
Here is my mistune version: https://github.com/ArchipelagoMW/Archipelago/commit/829dac5fe91b1e98e379de686524046912c946a3 so it doesn't get lost in Discord.
As far as I can see there is only 1 issue remaining: <a> inside <h?> changes the style applied from CSS.
A noteworthy change to both the current PR and the current JS code is that the way the fragments/IDs are generated in the mistune hook would be compatible to GitHub, so if you look at a "relative link" (e.g. TOC) on GitHub it should behave the same once deployed.
Why mistune? It seems to ship with sane features that mostly match GitHub, can be extended and is being maintained. The plugins I selected are the default, but I had to explicitly list them because we need raw HTML in some documents, which is disabled by default.
Feel free to merge or copy-paste the changes or ask for a PR against this branch.