File: list.rb

package info (click to toggle)
tdiary 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,088 kB
  • sloc: ruby: 23,031; javascript: 1,029; xml: 325; makefile: 26; sh: 4
file content (39 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
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
# list.rb
#
# <ol> 順番付きリスト生成
#   <%= ol l %>
#   パラメタ:
#     l: リスト文字列(\nくぎり)
#
# <ul> 順番無しリスト
#   <%= ul l , t %>
#   パラメタ:
#     l: リスト文字列(\nくぎり)
#
# Copyright (c) 2002 abbey <inlet@cello.no-ip.org>
# Distributed under the GPL2 or any later version.
#

def ol( l, t = nil, s = nil )
	apply_plugin( %Q[<ol>#{li l}</ol>] )
end

def ul( l, t = nil)
	apply_plugin( %Q[<ul>#{li l}</ul>] )
end

def li( text )
	list = ""
	text.each_line do |line|
		list << ("<li>" + line.chomp + "</li>")
	end
	list
end


# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End: