Class: Juli::Command::Tag
- Inherits:
-
Object
- Object
- Juli::Command::Tag
- Includes:
- Util, Visitor::Html::TagHelper
- Defined in:
- lib/juli/command/tag.rb
Overview
generate _tag.shtml which shows tag-search-result HTML page.
Instance Method Summary collapse
-
#initialize ⇒ Tag
constructor
A new instance of Tag.
- #run(opts) ⇒ Object
Methods included from Visitor::Html::TagHelper
Methods included from Util
#camelize, conf, find_template, in_filename, juli_repo, mkdir, out_filename, str_limit, str_trim, to_wikiname, underscore, usage, visitor, visitor_list
Constructor Details
Instance Method Details
#run(opts) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/juli/command/tag.rb', line 13 def run(opts) # tag list body = content_tag(:a, '', :name=>'top').force_encoding('UTF-8') + "<h2>#{I18n.t('tag_list')}</h2>\n".force_encoding('UTF-8') for tag in @tag_macro.tag_db.keys do body += gen_tag_list(tag) end body += gen_tag_list( Juli::Macro::Tag::NO_TAG, I18n.t(Juli::Macro::Tag::NO_TAG)) body += "\n\n" + '<br/>'*50 # tag detail for tag in @tag_macro.tag_db.keys do body += gen_tag_detail(tag) end body += gen_tag_detail( Juli::Macro::Tag::NO_TAG, I18n.t(Juli::Macro::Tag::NO_TAG)) title = I18n.t('tag_list') contents = '' prototype = 'prototype.js' javascript = 'juli.js' stylesheet = 'juli.css' erb = ERB.new(File.read(find_template('simple.html'))) File.open(File.join(conf['output_top'], '_tag.shtml'), 'w') do |f| f.write(erb.result(binding)) end end |