PerlDancer / PerlDancer/Dancer2
Document how write a Dancer2 CGI app
Open
Nobody has claimed this yet.
Beginner Suitable
Documentation
- Dominant language
- Perl
- Stars
- 604
- Forks
- 288
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
I worked with @xsawyerx today and we figured out how to write a Dancer2 app in CGI. We feel like it should be documented but we're not sure where:
use Dancer2;
use Plack::Loader;
use Template::Provider::FromDATA;
# Tell Dancer to use the DATA section for templates
my $provider = Template::Provider::FromDATA->new( { CLASSES => __PACKAGE__ } );
set engines => {template => { template_toolkit => { LOAD_TEMPLATES => [ $provider ] }}};
set template => 'template_toolkit';
get '/' => sub {
template 'mytemplate' => { bar => "foo" };
};
Plack::Loader->auto->run(main->to_app);
__DATA__
__mytemplate.tt__
Flib [% bar %]
__anothertemplate.tt__
Something else here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CGI application example in the issue and inspect the repository's existing documentation structure to find the appropriate location. Document the demonstrated Dancer2 CGI setup, including the embedded templates, so a reader can follow it as a complete example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100