templates.yml: Add javascript-focused template group
Minimal: A Perl mod template geared toward processing the query in javascriptmaster
parent
53fc09c09c
commit
53b8c46fb5
|
@ -0,0 +1,46 @@
|
|||
package DDG::Goodie::<: $ia_package_name :>;
|
||||
|
||||
# ABSTRACT: Write an abstract here
|
||||
# Start at https://duck.co/duckduckhack/goodie_overview if you are new
|
||||
# to instant answer development
|
||||
|
||||
use DDG::Goodie;
|
||||
use strict;
|
||||
|
||||
zci answer_type => '<: $ia_id :>';
|
||||
|
||||
# Caching - https://duck.co/duckduckhack/spice_advanced_backend#caching-api-responses
|
||||
zci is_cached => 1;
|
||||
|
||||
# Triggers - https://duck.co/duckduckhack/goodie_triggers
|
||||
triggers any => 'triggerWord', 'trigger phrase';
|
||||
|
||||
# Handle statement
|
||||
handle remainder => sub {
|
||||
|
||||
return "plain text response",
|
||||
structured_answer => {
|
||||
|
||||
# ID - Must be unique and match Instant Answer page
|
||||
# E.g. https://duck.co/ia/view/calculator has `id => 'calculator'``
|
||||
id => '<: $ia_id :>',
|
||||
|
||||
# Name - Used for Answer Bar Tab
|
||||
# Value should be chosen from existing Instant Answer topics
|
||||
# see https://duck.co/duckduckhack/display_reference#codenamecode-emstringem-required
|
||||
name => 'Answer',
|
||||
|
||||
data => {
|
||||
remainder => $_
|
||||
},
|
||||
|
||||
templates => {
|
||||
group => "text",
|
||||
# options => {
|
||||
#
|
||||
# }
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
1;
|
|
@ -8,6 +8,11 @@ templates:
|
|||
input: lib/DDG/Goodie/Example.pm
|
||||
output: lib/DDG/Goodie/<:$ia_path:>.pm
|
||||
|
||||
min-pm:
|
||||
label: Minimal Perl Module
|
||||
input: lib/DDG/Goodie/Minimal.pm
|
||||
output: lib/DDG/Goodie/<:$ia_path:>.pm
|
||||
|
||||
test:
|
||||
label: Perl Module Test
|
||||
input: t/Example.t
|
||||
|
@ -50,6 +55,11 @@ template_sets:
|
|||
required: [ cheatsheet_json ]
|
||||
subdir_support: false
|
||||
|
||||
javascript:
|
||||
description: Javascript-focused instant answer
|
||||
required: [ min-pm, js, test ]
|
||||
optional: [ css, handlebars ]
|
||||
|
||||
all:
|
||||
description: Goodie with all backend and frontend files
|
||||
required: [ pm, test, js, css, handlebars ]
|
||||
|
|
Loading…
Reference in New Issue