duckduckgo / zeroclickinfo-goodies

DuckDuckGo Instant Answers based on Perl & JavaScript
https://duckduckhack.com/
Other
980 stars 1.76k forks source link

Convert HTML Goodies to use templates #1163

Closed moollaza closed 7 years ago

moollaza commented 9 years ago

Many legacy Goodies return HTML strings for rendering. This was previously acceptable as we did not have access to the Handlebars templates used in every Spice IA.

Now that we have templates, we should convert all Goodies returning HTML into templated Goodie that ideally won't need to actually declare any HTML! We have many built-in templates and most IA's can leverage these by specifying only the data and letting our template system do the rest of the work.

In some cases the use of a Handlebars sub-template is necessary and acceptable. In rare cases a custom template is required and we now support that (but please check with us first to make sure its absolutely necessary!)

Let's cleanup our Goodies and hopefully simplify them by moving to our new templates!

Details on template usage can be seen here: https://duck.co/duckduckhack/goodie_displaying

Note: Goodies also support JS and CSS now, which means we should remove any inline scripts and styles and if necessary, move them to separate CSS and JS files.

Here's a list of the existing IA's which return HTML:


If you'd like to work on converting any of these, please post below to let us know!

Thanks guys :smile:

moollaza commented 9 years ago

BTW, the Shipping Goodie are already being converted in #1150

mintsoft commented 9 years ago

I'll take the ones I've messed with, i.e:

I think that's the lot

moollaza commented 9 years ago

@mintsoft that's awesome! Thanks :+1:

phoenixwizard commented 9 years ago

I would like to take up

Once I complete this I will take up more.

moollaza commented 9 years ago

@phoenixwizard thanks a lot! We really appreciate it :+1:

javathunderman commented 9 years ago

@moollaza Mind posting the stuff that hasn't been tackled yet?

mintsoft commented 9 years ago

@javathunderman We're just ticking them off as they're done :)

javathunderman commented 9 years ago

@mintsoft Ah, alright.

mintsoft commented 9 years ago

@moollaza I've just added https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/PublicDNS.pm to this list; as it's not immediately obvious from the code, but it's definitely returning HTML

AlterationBrick commented 8 years ago

I'll tackle Dewey if no one else is working on it.

tagawa commented 8 years ago

Hi @AlterationBrick. That would be great - thank you.

GuiltyDolphin commented 8 years ago

@mintsoft Would you mind just checking to see if any of the conversions (specifically yours) in #2767 fix these?

moollaza commented 8 years ago

Update

We've converted many Goodies that were using our "auto-templates" to use our Full Templates. Excellent job everyone! 💯 🎉

However, we still have a few Goodies remaining that return plaintext and HTML (even worse!) that need to be addressed. Some of these may have ongoing PRs that have gone stale, so ping me and I'll try to get it moving along 👍 . Some of these are also not online and in some cases should be removed. RouterPasswords is one example that should probably be moved to a FatHead as we previously ran into issues with it as a Goodie.

The various package tracking Goodies are still live, but several are slated to be replaced by an ongoing Spice PR that may need to be revived (/cc @Mailkov )

Here's a list of Goodies that don't contain structured_answer in their Perl:

/cc @duckduckgo/duckduckhack-contributors

GuiltyDolphin commented 8 years ago

-_- Hold the party everyone, looks like there's more to do :sob:

moollaza commented 8 years ago

I've updated the checklist above accordingly

gautamkrishnar commented 7 years ago

What's the status of this issue?

mintsoft commented 7 years ago

Still in-progress; this list https://github.com/duckduckgo/zeroclickinfo-goodies/issues/1163#issuecomment-224946724 are goodies that are still using the old output format and need to be converted to use structured_answer and a template

kirkins commented 7 years ago

I'm attempting to improve the Sudoku app so I will first convert it to use templates.

kirkins commented 7 years ago

As there hasn't been much activity on this issue for a while I will claim it.

kirkins commented 7 years ago

Notes:

Left to do

rasikapohankar commented 7 years ago

@kirkins CrontabCheatSheet.pm was converted to a cheat sheet.

kirkins commented 7 years ago

We might want to skip the PrivateNetwork Goodie and remove it completely #4257

mintsoft commented 7 years ago

We might want to skip the PrivateNetwork Goodie and remove it completely #4257

Well not remove it, just reduce the scope of the triggering somewhat :)

marianosimone commented 7 years ago

Unidecode was not part of the list, but it wasn't using templates, so I converted it on #4396