Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebHost: Fix docs generation from a .apworld #1862

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

remyjette
Copy link
Collaborator

What is this fixing or adding?

zfile.filename is the full path within the archive, so by default zf.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 my worlds/ folder and ran WebHost.py. Prior to my change, this created WebHostLib/static/generated/docs/MegaMan\ Battle\ Network\ 3/mmbn3/docs/ and copied en_MegaMan Battle Network 3.md and setup_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 into WebHostLib/static/generated/docs/MegaMan\ Battle\ Network\ 3 and the links from /games work as expected.

If this makes graphical changes, please attach screenshots.

zfile.filename is the full path within the archive, so by default
zf.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.
@ThePhar ThePhar added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. affects: webhost Issues/PRs that touch webhost and may need additional validation. labels Jun 19, 2023
@black-sliver
Copy link
Member

Thanks!
We may want to make that doc extraction a bit smarter in the future (if "/docs/" in zfile.filename is not ideal), but your change fixes the issue at hand.

@black-sliver black-sliver merged commit 354a182 into ArchipelagoMW:main Jul 5, 2023
11 checks passed
@remyjette remyjette deleted the patch-1 branch July 21, 2023 01:26
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
zfile.filename is the full path within the archive, so by default
zf.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.
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
zfile.filename is the full path within the archive, so by default
zf.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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: webhost Issues/PRs that touch webhost and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants