webgen logo

webgen / static website generator

static website generation made easy!

Latest news

2007-12-31: Minor release with feature enhancements. More...

2007-09-08: Small bug fix release. More...

2007-06-29: Some bug fixes and one small feature enhancement. More...

Links

Generated by webgen

General Information

Plugin name:Tag/IncludeFile (Tag/Default)
Author:Thomas Leitner <t_leitner@gmx.at>
Summary:Includes a file verbatim
Parameters:

escapeHTML: true
Special HTML characters in the file content will be escaped if true

filename (=default mandatory parameter): nil
The name of the file which should be included (relative to the file specifying the tag).

highlight: nil
Name of language that should be used for syntax highlighting of the content of the file. If set to nil, no highlighting is performed. Available langs:

processOutput: true
The file content will be scanned for tags if true

Handled tags:includeFile

Description

The include file tag is used to include the content of a file. The content can be highlighted via Misc/SyntaxHighlighter by specifying an available language for the parameter highlight.

Examples

UsageOutput
{includeFile: {filename: includefile.page, processOutput: false}}
---
title: IncludeFile
inMenu: true
template: /plugin.template
plugin: Tag/IncludeFile
---
h2(#description). Description


The include file tag is used to include the content of a file. The content can be highlighted via
{plugin: Misc/SyntaxHighlighter} by specifying an available language for the parameter {param:
Tag/IncludeFile:highlight}.


h2(#examples). Examples


<table class="examples">
<tr>
  <th>Usage</th><th>Output</th>
</tr>
<tr>
  <td>\{includeFile: {filename: includefile.page, processOutput: false}}</td>
  <td><pre>{includeFile: {filename: includefile.page, processOutput: false}}</pre></td>
</tr>
<tr>
  <td>\{includeFile: {filename: ../../../../plugin/emoticon.rb, escapeHTML: false, processOutput: false, highlight: ruby}}</td>
  <td>{includeFile: {filename: ../../../../plugin/emoticon.rb, escapeHTML: false, processOutput: false, highlight: ruby}}</td>
</tr>
</table>
{includeFile: {filename: ../../../../plugin/emoticon.rb, escapeHTML: false, processOutput: false, highlight: ruby}} class ShowEmoticonsTag < Tags::DefaultTag infos( :name => 'WebgenDocu/EmoticonTag', :summary => "Creates a table of the existing emoticon packs" ) register_tag 'showEmoticonPacks' def process_tag( tag, chain ) res = @plugin_manager['Core/ResourceManager'].resources packs = Dir[File.join( Webgen.data_dir, 'resources', 'emoticons', '*/')].collect {|p| File.basename( p )}.sort map = @plugin_manager['Misc/SmileyReplacer'].class::SMILEY_MAP output = '' header = map.sort {|a,b| a[1] <=> b[1]}.collect {|s, name| "" }.join('') output << "#{header}" packs.each do |pack| output << "" output << map.values.sort.collect do |v| "" end.join('') output << "" end output << "
#{s}
(#{name})
Smiley/Pack
#{pack}\"smiley\"/
" end end