Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better quickstart page, shell CSS

  • Loading branch information...
commit f3309a1bf5d9716b752a351e6bbce4eb1bd17141 1 parent d58e120
Alexis Sukrieh authored
Showing with 51 additions and 22 deletions.
  1. +9 −0 public/css/style.css
  2. +2 −2 views/home.tt
  3. +40 −20 views/quickstart.tt
View
9 public/css/style.css
@@ -134,3 +134,12 @@ code, pre {
font-size: 14px;
font-family: "lucida console","monaco","andale mono","bitstream vera sans mono","consolas",monospace;
}
+
+pre.shell {
+ border: 1px solid #000;
+ background-color: #333;
+ color: #eee;
+ padding: 6px;
+ -moz-opacity: 0.7;
+ margin-right: 1em;
+}
View
4 views/home.tt
@@ -20,9 +20,9 @@ dance;
<h2>And dance</h2>
-<pre>
-$ sudo cpan HTTP::Server::Simple
+<pre class="shell">
$ sudo cpan Dancer
+[...]
$ perl ./hi.pl
>> Listening on 127.0.0.1:3000
== Entering the dance floor ...
View
60 views/quickstart.tt
@@ -1,38 +1,58 @@
-<h2>Getting Started</h2>
+<h2>Installing Dancer</h2>
<p>
-Dancer implements an idea that was firstly introduced by the Ruby community, with
-the <a href="http://www.sinatrarb.com">Sinatra</a> project.<br />
-Like it's cousin, it's a DSL for quickly creating web applications in Perl with minimal effort:
+Install Dancer via CPAN:
</p>
+<pre class="shell">
+$ sudo cpan Dancer
+</pre>
+
+<h2>Creating an application</h2>
+
+<p>Since version 0.9904, an helper is shipped with the distribution
+and lets you create an application with a single command:
+
+<pre class="shell">
+$ dancer -a mywebapp
++ [D] mywebapp
++ [F] mywebapp/config.yml
++ [D] mywebapp/views
++ [D] mywebapp/views/layouts
++ [F] mywebapp/views/layouts/main.tt
++ [F] mywebapp/views/index.tt
++ [D] mywebapp/environments
++ [F] mywebapp/environments/production.yml
++ [F] mywebapp/environments/development.yml
++ [F] mywebapp/mywebapp.pm
++ [F] mywebapp/mywebapp.pl
++ [F] mywebapp/app.psgi
+</pre>
+
+<p>Everything is ready and works out of the box. It's already a working "Hello
+World" application waiting for being hacked.</p>
+
+<h2>Hacking into the routes</h2>
+
<pre class="prettyprint">
-# myapp.pl
+# myapp.pm
use Dancer;
get '/' => sub {
'Hello world!'
};
-dance;
-</pre>
+# add other routes here and there...
-<p>
-Install Dancer's dependencies and Dancer itself:
-</p>
-
-<pre>
-sudo cpan HTTP::Server::Simple
-sudo cpan File::MimeInfo
-sudo cpan Dancer
+dance;
</pre>
-<p>
-Run it and view at <a href="http://localhost:3000">http://localhost:3000</a>
-</p>
+<h2>Running the dance</h2>
-<pre>
-$ perl ./hi.pl
+<pre class="shell">
+$ cd mywebapp
+$ ./mywebapp.pl
>> Listening on 127.0.0.1:3000
== Entering the dance floor ...
</pre>
+
Please sign in to comment.
Something went wrong with that request. Please try again.