File: root.tpl

package info (click to toggle)
ruby-rgen 0.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,428 kB
  • sloc: ruby: 11,344; xml: 1,368; yacc: 72; makefile: 10
file content (31 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (11)
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
<% define 'Root' do %>
	<% file 'testout.txt' do %>
		Document: <%= title %>
		<%nl%>
		<%iinc%>
		by <% expand 'content/author::Author', :foreach => authors, :separator => ' and ' %>
		<%idec%>
		<%nl%>
		Index:<%iinc%>
		<% for c in chapters %>
			<% nr = (nr || 0); nr += 1 %>
			<% expand 'index/chapter::Root', nr, this, :for => c %>
		<% end %><%idec%>
		<%nl%>
		----------------
		<%nl%>
		Chapters in one line:
		<% expand 'content/chapter::Root', :foreach => chapters, :separator => ", " %><%nl%>
		<%nl%>
		Chapters each in one line:
		<% expand 'content/chapter::Root', :foreach => chapters, :separator => ",\r\n" %><%nl%>
		<%nl%>
		Here are some code examples:
		<% expand 'code/array::ArrayDefinition', :for => sampleArray %>
	<% end %>
<% end %>

<% define 'TextFromRoot' do %>
	Text from Root
<% end %>