Open Mailaender opened 2 years ago
I solved this in #57 by parsing the HTML, then realized there was a json file available (which may be a better solution?) when I came here to mark this as done. 🤦
Upon further investigation using HtmlAgilityPack
to parse the HTML instead of the JSON file yields better result as I can actually target the trait/weapon/sequence/table description, while in the JSON those are mixed with all the other text content about the entity.
So for the summary I will keep to parsing the HTML.
However, it would be interesting to investigate using the JSON to provide autocomplete suggestions for trait/weapon/sequence/table names when the user is invoking the commands.
I also noticed that the JSON search is incomplete and seems to cut off after a certain number of characters.
https://github.com/OpenRA/Orabot/blob/7ab2fa092b127313d80547605a315c21eb4b708c/Orabot.Core/Modules/OpenRaTraitsModule.cs#L69
is not really helpful. Parse https://docs.openra.net/en/bleed/search/search_index.json instead.