Adding a syndicate pairing page with some notes

This commit is contained in:
2026-07-17 17:12:39 -04:00
parent 8fa0422be4
commit e64193639e
50 changed files with 1689 additions and 398 deletions
+21 -6
View File
@@ -49,7 +49,7 @@ foreach (var file in mdFiles)
Attack = ParseInt(yaml, "attack"),
Health = ParseInt(yaml, "health"),
Description = StripWikiLinks(yaml.GetValueOrDefault("description")),
Faction = StripWikiLink(yaml.GetValueOrDefault("faction")),
Syndicate = StripWikiLink(yaml.GetValueOrDefault("faction")),
Set = StripWikiLink(yaml.GetValueOrDefault("set")),
Speed = StripWikiLink(yaml.GetValueOrDefault("speed")),
Archetypes = ParseList(yaml, "archetypes").Select(s => StripWikiLink(s) ?? "").Where(s => s != "").ToList(),
@@ -109,7 +109,7 @@ for (var i = 0; i < cards.Count; i++)
WriteNullProp(writer, "Attack", c.Attack, 3);
WriteNullProp(writer, "Health", c.Health, 3);
WriteStrProp(writer, "Description", c.Description, 3);
WriteStrProp(writer, "Faction", c.Faction, 3);
WriteStrProp(writer, "Syndicate", c.Syndicate, 3);
WriteStrProp(writer, "Set", c.Set, 3);
WriteStrProp(writer, "Speed", c.Speed, 3);
WriteListProp(writer, "Archetypes", c.Archetypes, 3);
@@ -157,7 +157,7 @@ foreach (var file in deckFiles)
Divers = ParseList(yaml, "divers").Select(s => StripWikiLink(s) ?? "").Where(s => s != "").ToList(),
Description = StripWikiLinks(NullIfNa(yaml.GetValueOrDefault("description")))?.Replace("\r\n", "\n")
.Replace("\r", "\n").Replace("\n\n", "\n").Replace("\n\n", "\n"),
Factions = ParseList(yaml, "factions").Select(s => StripWikiLink(s) ?? "").Where(s => s != "").ToList(),
Syndicates = ParseList(yaml, "factions").Select(s => StripWikiLink(s) ?? "").Where(s => s != "").ToList(),
IsVisible = isVisible,
DeckCode = deckCode,
DeckType = yaml.GetValueOrDefault("deckType")
@@ -192,7 +192,7 @@ for (var i = 0; i < decks.Count; i++)
WriteListProp(deckWriter, "Keycards", d.Keycards, 3);
WriteListProp(deckWriter, "Divers", d.Divers, 3);
WriteStrProp(deckWriter, "Description", d.Description, 3);
WriteListProp(deckWriter, "Factions", d.Factions, 3);
WriteListProp(deckWriter, "Syndicates", d.Syndicates, 3);
deckWriter.WriteLine($" IsVisible = {(d.IsVisible ? "true" : "false")},");
WriteStrProp(deckWriter, "DeckCode", d.DeckCode, 3);
WriteStrProp(deckWriter, "DeckType", d.DeckType, 3);
@@ -229,19 +229,33 @@ foreach (var file in mdFiles)
}
}
var category = yaml.GetValueOrDefault("category") ?? Path.GetFileName(Path.GetDirectoryName(file)) ?? "";
var category = yaml.GetValueOrDefault("category");
if (category == null)
{
var parentDir = Path.GetFileName(Path.GetDirectoryName(file)) ?? "";
category = parentDir;
}
if (excludedCategories.Contains(category)) continue;
// Also exclude files that look like base templates
var fileName = Path.GetFileName(file);
if (fileName.StartsWith("_")) continue;
// Special handling for Syndicate Pairings
List<string>? syndicatesProp = null;
if (category == "Syndicate Pairings")
{
syndicatesProp = ParseList(yaml, "syndicates");
}
docs.Add(new DocData
{
Title = Path.GetFileNameWithoutExtension(file),
Category = category,
Content = body,
Frontmatter = yaml
Frontmatter = yaml,
Syndicates = syndicatesProp
});
}
@@ -267,6 +281,7 @@ for (var i = 0; i < docs.Count; i++)
WriteProp(docWriter, "Category", d.Category, 3);
WriteStrProp(docWriter, "Content", d.Content, 3);
WriteDictProp(docWriter, "Frontmatter", d.Frontmatter, 3);
WriteListProp(docWriter, "Syndicates", d.Syndicates, 3);
var comma = i < docs.Count - 1 ? "," : "";
docWriter.WriteLine($" }}{comma}");
}