Sha256: c7913aa497066f1876a67d74a2bcd77f68c89204ae46cd1204442cbf87b97340

Contents?: true

Size: 1.83 KB

Versions: 8

Compression:

Stored size: 1.83 KB

Contents

---
title: Download
inMenu: true
template: /plugin.template
plugin: Tag/Download
---
h2(#description). Description


This tag is used to provide a nice download link. The download link includes the following parts:

* *download icon* [optional]: an icon which shows that the file can be downloaded
* *file icon*: an icon showing the type of the file (PDF file, music file, video file,...)
* *link to file*: the link to the file
* *file size*: the size of the file if it can be calculated

*Caveat*: You should link to the @webgen-css@ resource in your template as this plugin defines some
CSS styles!


h2(#mapping-file). Format of mapping file


You can specify additional type-to-icon mappings using the parameter {param:
Tag/Download:mappingFile} which needs to point to a file with the mappings. The format for the file
is YAML and following is an example:

<pre>
file-mapping:
    /images/mytype.jpg: [.my, .mytype]
    /images/documents.jpg: [.wpd, .doc, .sxw, .odt, .rtf]

resource-mapping:
    webgen-icons-text: [.page, .template]
</pre>

The two possible top level keys are @file-mapping@ and @resource-mapping@. The first specifies which
image file and the second which resource should be used for the specified extensions.


h2(#examples). Examples


<table class="examples">
<tr>
  <th>Usage</th><th>Output</th>
</tr>
<tr>
  <td><notextile>\{download: {url: /images/thumb_example.jpg}}</notextile></td>
  <td><notextile>{download: {url: /images/thumb_example.jpg}}</notextile></td>
</tr>
<tr>
  <td><notextile>\{download: {url: /images/thumb_example.jpg, alwaysShowDownloadIcon: true}}</notextile></td>
  <td><notextile>{download: {url: /images/thumb_example.jpg, alwaysShowDownloadIcon: true}}</notextile></td>
</tr>
<tr>
  <td><notextile>\{download: download.page}</notextile></td>
  <td><notextile>{download: download.page}</notextile></td>
</tr>
</table>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webgen-0.4.2 doc/src/documentation/plugins/tag/download.page
webgen-0.4.1 doc/src/documentation/plugins/tag/download.page
webgen-0.4.0 doc/src/documentation/plugins/tag/download.page
webgen-0.4.5 doc/src/documentation/plugins/tag/download.page
webgen-0.4.3 doc/src/documentation/plugins/tag/download.page
webgen-0.4.4 doc/src/documentation/plugins/tag/download.page
webgen-0.4.6 doc/src/documentation/plugins/tag/download.page
webgen-0.4.7 doc/src/documentation/plugins/tag/download.page