Support for flag templates
See original GitHub issueHello!
First, thanks for making this - it’s great!
I’m doing some parsing with this library and have run into a few templates that I’d like to support. Currently, I “support” them by preprocessing the text before handing it to wtf_wikipedia.
I’d be happy to add it to the core code if you can point me to the right part of the code to add it (or to a previous PR/commit that I could reference)
The ones I’m thinking of in particular:
I’m not sure I understand fully how Wikipedia’s templates work either, which complicates things. 😃
I’m also not sure what level of fidelity is desired. For my purposes, all I really care about is getting the text behind template. eg I’m happy for {{flag|Canada}}
to be parsed as a text string Canada
.
…but I think the most faithful experience would be to expand it to the image and the link to the Canada page, which is what you’d see if you looked at Wikipedia itself. Just checking – what is the general preference for handling templates?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Cool! Sorry for ghosting on this - I probably won’t have time until the holidays to do any significant open source stuff.
Is it kind of weird, or kind of cool? 😃 I guess it depends on the spirit of this library. On the other hand, I like that they’re (theoretically) a well-supported standard, and in any event, since it links to the target page, automated uses (that don’t want to translate from understand emojis to map to Wikipedia pages) are easily supported, too.
You’re the best! Thanks!