question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for flag templates

See original GitHub issue

Hello!

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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cldellowcommented, Nov 16, 2018

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.

0reactions
cldellowcommented, Dec 4, 2018

You’re the best! Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flags Template Teaching Resources - TPT
Want to have your students create a classroom flag? This template will help students to design a flag to represent their specific class....
Read more >
Free, customizable, and printable flag templates - Canva
In need of expert design assistance? Browse Canva's gallery of ready-to-use flag templates and bring your vision to life. Our premade flags come...
Read more >
Flags Templates & Designs - Vistaprint
Vistaprint is here to help. We have a variety of customizable Flags templates, with options to add images, logos and more. Working with...
Read more >
Flag Templates Free - Graphic Design Template - VistaCreate
Edit and Download ➥ Flag Design Templates FREE ⏩ VistaCreate ⚡ Choose and Customize ... Support Peace, Not War in Ukraine Poster US...
Read more >
Blank Flag Template Printable | Make Your Own Flag - Pinterest
Make your own flag using one of these blank flag templates. Design your own flag for a social studies or history project. Free...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found