Move Wiki Pages to MD

This commit is contained in:
2026-04-30 20:43:53 +02:00
parent 78133efdf4
commit 18eab086cc
4 changed files with 106 additions and 102 deletions
+7 -7
View File
@@ -42,24 +42,24 @@ func TestBuildNativeGeneratesAndSkipsWikiPages(t *testing.T) {
if result.WikiPages != 1 {
t.Fatalf("expected one generated entity page, got %d", result.WikiPages)
}
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.html")
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.md")
got, err := os.ReadFile(pagePath)
if err != nil {
t.Fatalf("read generated page: %v", err)
}
text := string(got)
if !strings.Contains(text, "<h1>Athletics</h1>") || !strings.Contains(text, "This skill is unchanged from vanilla.") {
if !strings.Contains(text, "# Athletics") || !strings.Contains(text, "This skill is unchanged from vanilla.") {
t.Fatalf("unexpected generated page:\n%s", text)
}
if !strings.Contains(text, managedStartMarker) || !strings.Contains(text, "Ability: Strength.") || !strings.Contains(text, "<li>Climb</li>") {
if !strings.Contains(text, managedStartMarker) || !strings.Contains(text, "Ability: Strength.") || !strings.Contains(text, "- Climb") {
t.Fatalf("expected description to be rendered into wiki page:\n%s", text)
}
statusPath := filepath.Join(root, ".cache", "wiki", "pages", "meta", "wikistatus.html")
statusPath := filepath.Join(root, ".cache", "wiki", "pages", "meta", "wikistatus.md")
statusRaw, err := os.ReadFile(statusPath)
if err != nil {
t.Fatalf("read status page: %v", err)
}
if !strings.Contains(string(statusRaw), "<strong>Vanilla:</strong> 1") {
if !strings.Contains(string(statusRaw), "**Vanilla:** 1") {
t.Fatalf("expected wiki status summary to count vanilla page:\n%s", string(statusRaw))
}
if _, err := os.Stat(filepath.Join(root, ".cache", "wiki", "state.json")); err != nil {
@@ -201,7 +201,7 @@ func TestBuildNativeRegeneratesWikiWhenTLKTextChanges(t *testing.T) {
if _, err := BuildNative(proj, nil); err != nil {
t.Fatalf("BuildNative after text change failed: %v", err)
}
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.html")
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.md")
got, err := os.ReadFile(pagePath)
if err != nil {
t.Fatalf("read regenerated page: %v", err)
@@ -243,7 +243,7 @@ func TestBuildPackageIgnoresWikiSourcesForFreshness(t *testing.T) {
t.Fatalf("BuildNative failed: %v", err)
}
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.html")
pagePath := filepath.Join(root, ".cache", "wiki", "pages", "skills", "athletics.md")
newTime := time.Now().Add(2 * time.Second)
if err := os.Chtimes(pagePath, newTime, newTime); err != nil {
t.Fatalf("touch wiki page: %v", err)