-
Archipelago Guides
-
Loading...
+
+
Archipelago Guides
+ {% for world_name, world_type in worlds.items() %}
+
{{ world_type.game }}
+ {% for tutorial_name, tutorial_data in tutorials[world_name].items() %}
+
{{ tutorial_name }}
+
{{ tutorial_data.description }}
+
This guide is available in the following languages:
+
+ {% for file_name, file_data in tutorial_data.files.items() %}
+ -
+ {{ file_data.language }}
+ by
+ {% for author in file_data.authors %}
+ {{ author }}
+ {% if not loop.last %}, {% endif %}
+ {% endfor %}
+
+ {% endfor %}
+
+ {% endfor %}
+ {% endfor %}
-{% endblock %}
+{% endblock %}
diff --git a/test/webhost/test_docs.py b/test/webhost/test_docs.py
index 1e6c1b88..a178a7cb 100644
--- a/test/webhost/test_docs.py
+++ b/test/webhost/test_docs.py
@@ -2,6 +2,8 @@ import unittest
import Utils
import os
+from werkzeug.utils import secure_filename
+
import WebHost
from worlds.AutoWorld import AutoWorldRegister
@@ -9,36 +11,30 @@ from worlds.AutoWorld import AutoWorldRegister
class TestDocs(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
- cls.tutorials_data = WebHost.create_ordered_tutorials_file()
+ WebHost.copy_tutorials_files_to_static()
def test_has_tutorial(self):
- games_with_tutorial = set(entry["gameTitle"] for entry in self.tutorials_data)
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden:
with self.subTest(game_name):
- try:
- self.assertIn(game_name, games_with_tutorial)
- except AssertionError:
- # look for partial name in the tutorial name
- for game in games_with_tutorial:
- if game_name in game:
- break
- else:
- self.fail(f"{game_name} has no setup tutorial. "
- f"Games with Tutorial: {games_with_tutorial}")
+ tutorials = world_type.web.tutorials
+ self.assertGreater(len(tutorials), 0, msg=f"{game_name} has no setup tutorial.")
+
+ safe_name = secure_filename(game_name)
+ target_path = Utils.local_path("WebHostLib", "static", "generated", "docs", safe_name)
+ for tutorial in tutorials:
+ self.assertTrue(
+ os.path.isfile(Utils.local_path(target_path, secure_filename(tutorial.file_name))),
+ f'{game_name} missing tutorial file {tutorial.file_name}.'
+ )
def test_has_game_info(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden:
- safe_name = Utils.get_file_safe_name(game_name)
+ safe_name = secure_filename(game_name)
target_path = Utils.local_path("WebHostLib", "static", "generated", "docs", safe_name)
for game_info_lang in world_type.web.game_info_languages:
with self.subTest(game_name):
- self.assertTrue(
- safe_name == game_name or
- not os.path.isfile(Utils.local_path(target_path, f'{game_info_lang}_{game_name}.md')),
- f'Info docs have be named
_{safe_name}.md for {game_name}.'
- )
self.assertTrue(
os.path.isfile(Utils.local_path(target_path, f'{game_info_lang}_{safe_name}.md')),
f'{game_name} missing game info file for "{game_info_lang}" language.'
diff --git a/test/webhost/test_file_generation.py b/test/webhost/test_file_generation.py
index 059f6b49..7b14ac87 100644
--- a/test/webhost/test_file_generation.py
+++ b/test/webhost/test_file_generation.py
@@ -29,8 +29,3 @@ class TestFileGeneration(unittest.TestCase):
with open(file, encoding="utf-8-sig") as f:
for value in roll_options({file.name: f.read()})[0].values():
self.assertTrue(value is True, f"Default Options for template {file.name} cannot be run.")
-
- def test_tutorial(self):
- WebHost.create_ordered_tutorials_file()
- self.assertTrue(os.path.exists(os.path.join(self.correct_path, "static", "generated", "tutorials.json")))
- self.assertFalse(os.path.exists(os.path.join(self.incorrect_path, "static", "generated", "tutorials.json")))
diff --git a/worlds/ahit/__init__.py b/worlds/ahit/__init__.py
index d258f805..ff117283 100644
--- a/worlds/ahit/__init__.py
+++ b/worlds/ahit/__init__.py
@@ -34,7 +34,7 @@ class AWebInTime(WebWorld):
"Multiworld Setup Guide",
"A guide for setting up A Hat in Time to be played in Archipelago.",
"English",
- "ahit_en.md",
+ "setup_en.md",
"setup/en",
["CookieCat"]
)]
diff --git a/worlds/osrs/__init__.py b/worlds/osrs/__init__.py
index 9e439fe5..a54e272d 100644
--- a/worlds/osrs/__init__.py
+++ b/worlds/osrs/__init__.py
@@ -25,7 +25,7 @@ class OSRSWeb(WebWorld):
"Multiworld Setup Guide",
"A guide to setting up the Old School Runescape Randomizer connected to an Archipelago Multiworld",
"English",
- "docs/setup_en.md",
+ "setup_en.md",
"setup/en",
["digiholic"]
)
diff --git a/worlds/yugioh06/__init__.py b/worlds/yugioh06/__init__.py
index 9070683f..5d4cddd9 100644
--- a/worlds/yugioh06/__init__.py
+++ b/worlds/yugioh06/__init__.py
@@ -56,7 +56,7 @@ class Yugioh06Web(WebWorld):
"A guide to setting up Yu-Gi-Oh! - Ultimate Masters Edition - World Championship Tournament 2006 "
"for Archipelago on your computer.",
"English",
- "docs/setup_en.md",
+ "setup_en.md",
"setup/en",
["Rensen"],
)