App-Dapper
view release on metacpan or search on metacpan
Banana
: 1. A delicious fruit that can be hazardous if left on the ground.
2. A fruit that comes with it's own packaging
Orange
: - The fruit of an evergreen tree of the genus Citrus.
```
## Tables
Here is an example table that has a header row and a reference. The first
column is left-justified, the middle column is centered, and the third
column is right justified:
```
| First Header | Second Header | Third Header |
| :----------- | :-----------: | -------------------: |
| First row | Data | Very long data entry |
| Second row | **Cell** | *Cell* |
[simple_table]
```
More information is available in the [MultiMarkdown
documentation](http://fletcher.github.io/MultiMarkdown-4/tables).
## Images
Images can be specified in HTML by simply including the HTML in the
text. Alternatively, here are some short-hand notations:
* Image: ``
* Image with title attribute: ``
* Image with ID: `![Image description.][img_id]`
`[img_id]: img.png "This is a title" height=50px width=200px`
## Footnotes
Footnotes can be accomplished as follows:
```
Here is some text containing a footnote[^somesamplefootnote]. You can then
continue your thought...
[^somesamplefootnote]: Here is the text of the footnote itself.
This is an example of an inline footnote.[^This is the *actual* footnote.]
```
# Layout
Layout templates in Dapper are based on a superset of the [Template
Toolkit](http://template-toolkit.org/) v3 (TT3) mini language as implemented by
[Template::Alloy](http://search.cpan.org/~rhandom/Template-Alloy/).
Although both Dapper and Template::Alloy are both written in Perl, you do
not need to know Perl in order to use them.
Layout templates include a series of directives. Directives can be
used to print the contents of a variable, or perform more sophisticated
computation such as if/then/else, foreach, or case statements. Directives
are surrounded by matched pairs of hard brackets and percent signs. Here is
an example of printing a variable called `site.name`:
```
[% site.name %]
```
When printing variables, you may also use filters to transform the variable
or print information about it. For instance, you can convert a variable
name to all uppercase letters using the `upper` filter. Example:
```
[% site.name | upper %]
```
Another class of "logic" directives are used in a similar fashion.
Here is an example of a for statement that loops through each `page` in
`site.pages`. For each iteration of the loop, print the contents of `page.title`:
```
[% for page in site.pages %]
[% page.title %]
[% end %]
```
The following sections show how to use directives in more depth.
## Variables
This section describes how to use variables, literals, and expressions in Dapper.
Variables are bits of text or numbers that are defined in the project
configuration file or in the source files that can be used in templates. Here is
an example of printing the contents of `page.title`:
```
[% page.title %]
```
In Dapper, there are two top-level variables (think of them as namespaces),
which are `site` and `page`. All `site` variables are defined in
`_config.yml`, and are available in layouts as `[% site.* %]`. All page
variables (defined at the beginning of source files) are available in
layouts as `[% page.* %]`.
Example `_config.yml`:
```
name: Mark Benson Portfolio
```
Example `_source/index.md`:
```
---
title: The title of my post
---
The body of my post.
```
( run in 1.220 second using v1.01-cache-2.11-cpan-39bf76dae61 )