WebHost: Fix docs generation from a .apworld #1862
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
zfile.filename
is the full path within the archive, so by defaultzf.extract
will maintain that directory structure when extracting.This causes the docs to be placed in the wrong place, as the Javascript code expects them to be placed directly in the game folder.
How was this tested?
Added
mmbn3.apworld
to myworlds/
folder and ranWebHost.py
. Prior to my change, this createdWebHostLib/static/generated/docs/MegaMan\ Battle\ Network\ 3/mmbn3/docs/
and copieden_MegaMan Battle Network 3.md
andsetup_en.md
there, which is incorrect (note the extra/mmbn3/docs
in that path). Trying to open either of these pages from the link in/games
leads to a 404.After my change,
mmb3/docs/
folders are not created. Instead the two .md files are copied intoWebHostLib/static/generated/docs/MegaMan\ Battle\ Network\ 3
and the links from/games
work as expected.If this makes graphical changes, please attach screenshots.