diff --git a/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs b/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs index f4469287..da9fb8a0 100644 --- a/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs +++ b/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs @@ -102,7 +102,7 @@ { if (links.Any()) { - var blockLinks = links.Distinct().OrderBy(l => l.Value).ToList(); + var blockLinks = links.Distinct().OrderBy(l => l.Key).ToList(); view.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(async () => diff --git a/AideDeJeu/AideDeJeuCmd/Program.cs b/AideDeJeu/AideDeJeuCmd/Program.cs index de49dfd2..3f7e30c4 100644 --- a/AideDeJeu/AideDeJeuCmd/Program.cs +++ b/AideDeJeu/AideDeJeuCmd/Program.cs @@ -272,6 +272,14 @@ namespace AideDeJeuCmd alllinks.Add(name, links); var names = GetMarkdownAnchorNames(md).ToList(); allnames.Add(name, names); + } + } + foreach (var resname in resnames) + { + if (resname.EndsWith(".md")) + { + var name = resname.Substring(15, resname.Length - 18); + var md = await Helpers.GetResourceStringAsync(resname); var unlinkedrefs = GetMarkdownUnlinkedRefs(md).ToList(); if (unlinkedrefs.Count > 0) { @@ -279,16 +287,36 @@ namespace AideDeJeuCmd Console.WriteLine(); foreach (var unlinkedref in unlinkedrefs.Distinct().OrderBy(i => i)) { - var file = ""; + //var file = ""; + var files = new Dictionary(); + foreach(var aalinks in alllinks) + { + var found = aalinks.Value.FirstOrDefault(t => t.Item2 == Helpers.IdFromName(unlinkedref)); + if(found != null) + { + files[found.Item1] = $"{found.Item1}.md"; + //file = $"{found.Item1}.md"; + //Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}"); + } + } foreach(var aanchors in allanchors) { if(aanchors.Value.Contains(Helpers.IdFromName(unlinkedref))) { - file = $"{aanchors.Key}.md"; - break; + files[aanchors.Key] = $"{aanchors.Key}.md"; + //file = $"{aanchors.Key}.md"; + //Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}"); + //break; } } - Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}"); + if(files.Count == 0) + { + files[""] = ""; + } + foreach (var file in files) + { + Console.WriteLine($"[{unlinkedref}]: {file.Value}#{Helpers.IdFromName(unlinkedref)}"); + } } Console.WriteLine(); Console.WriteLine(); @@ -379,7 +407,7 @@ namespace AideDeJeuCmd public static IEnumerable GetMarkdownAnchorNames(string md) { - var regex = new Regex($"\\n##? (?.*?)\\n"); + var regex = new Regex($"\\n##* (?.*?)\\s*?\\n"); var matches = regex.Matches(md); foreach (Match match in matches) { diff --git a/Data/barbarian_hd.md b/Data/barbarian_hd.md index a219444f..dc9d0d11 100644 --- a/Data/barbarian_hd.md +++ b/Data/barbarian_hd.md @@ -213,7 +213,7 @@ Au niveau 20, vous êtes devenu une véritable force de la nature. Vos valeurs d [arme courante]: equipment_hd_with_type_armecourante.md [arme de corps-à-corps]: equipment_hd_with_type_armedecorpsàcorps.md [arme de guerre de corps-à-corps]: equipment_hd_with_type_armedecorpsàcorps.md -[armes courantes]: #armes-courantes +[armes courantes]: equipment_hd_with_type_armecourante.md [armes de guerre]: #armes-de-guerre [armure lourde]: equipment_hd_with_type_armurelourde.md [armures intermédiaires]: equipment_hd_with_type_armureintermédiaire.md @@ -224,29 +224,28 @@ Au niveau 20, vous êtes devenu une véritable force de la nature. Vos valeurs d [aveuglé]: conditions_hd.md#aveuglé [bouclier]: equipment_hd.md#bouclier [boucliers]: equipment_hd.md#bouclier -[classe d'armure]: #classe-darmure +[classe d'armure]: abilities_dexterity_hd.md#classe-darmure [contondants]: #contondants -[Dressage]: #dressage -[hache à deux mains]: #hache-à-deux-mains +[Dressage]: abilities_wisdom_hd.md#dressage +[hache à deux mains]: equipment_hd.md#hache-à-deux-mains [hachettes]: equipment_hd.md#hachette [inconscient]: conditions_hd.md#inconscient -[initiative]: #initiative -[Intimidation]: #intimidation +[initiative]: abilities_dexterity_hd.md#initiative +[Intimidation]: abilities_charisma_hd.md#intimidation [javelines]: equipment_hd.md#javeline -[Nature]: #nature +[Nature]: abilities_intelligence_hd.md#nature [neutralisé]: conditions_hd.md#neutralisé -[paquetage d'explorateur]: equipment_hd.md#paquetage-dexplorateur -[Perception]: #perception +[paquetage d'explorateur]: #paquetage-dexplorateur +[Perception]: abilities_wisdom_hd.md#perception [perforants]: #perforants -[repos long]: #repos-long -[surpris]: conditions_hd.md#surpris +[repos long]: resting_hd.md#repos-long +[surpris]: #surpris [Survie]: #survie [tableau d'évolution du barbare]: #tableau-dévolution-du-barbare [tranchants]: #tranchants - [Force]: abilities_strength_hd.md [Dextérité]: abilities_dexterity_hd.md [Constitution]: abilities_constitution_hd.md