deplate 0.8 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/AUTHORS.TXT +19 -16
  2. data/CHANGES.TXT +214 -248
  3. data/NEWS.TXT +47 -30
  4. data/README.TXT +0 -1
  5. data/TODO.TXT +93 -20
  6. data/VERSION.TXT +1 -1
  7. data/bin/deplate.exy +192 -0
  8. data/etc/deplate.ini +70 -9
  9. data/lib/action_view/helpers/deplate.rb +33 -33
  10. data/lib/deplate.rb +2 -2
  11. data/lib/deplate/bib.rb +72 -41
  12. data/lib/deplate/builtin.rb +1 -1
  13. data/lib/deplate/cache.rb +1 -1
  14. data/lib/deplate/commands.rb +161 -102
  15. data/lib/deplate/common.rb +93 -7
  16. data/lib/deplate/converter.rb +10 -4
  17. data/lib/deplate/core.rb +215 -108
  18. data/lib/deplate/counters.rb +23 -8
  19. data/lib/deplate/css/article.css +9 -5
  20. data/lib/deplate/css/deplate.css +37 -3
  21. data/lib/deplate/css/heading-navbar.css +1 -1
  22. data/lib/deplate/css/highstep.css +18 -0
  23. data/lib/deplate/css/htmldoc.css +43 -0
  24. data/lib/deplate/css/layout-deplate-print.css +1 -1
  25. data/lib/deplate/css/layout-deplate.css +1 -1
  26. data/lib/deplate/css/play.css +101 -0
  27. data/lib/deplate/css/sans-serif.css +1 -1
  28. data/lib/deplate/css/serif-e.css +1 -1
  29. data/lib/deplate/css/serif-rel.css +1 -1
  30. data/lib/deplate/css/serif.css +1 -1
  31. data/lib/deplate/css/slides.css +1 -1
  32. data/lib/deplate/css/styles.css +4 -0
  33. data/lib/deplate/css/tabbar-right.css +54 -8
  34. data/lib/deplate/css/tabbar-top.css +28 -9
  35. data/lib/deplate/css/text-sans-serif.css +1 -1
  36. data/lib/deplate/css/text-serif.css +1 -1
  37. data/lib/deplate/define.rb +71 -38
  38. data/lib/deplate/deplate-string.rb +3 -3
  39. data/lib/deplate/docbook.rb +9 -9
  40. data/lib/deplate/elements.rb +173 -84
  41. data/lib/deplate/etc.rb +6 -8
  42. data/lib/deplate/external.rb +9 -5
  43. data/lib/deplate/fmt/dbk-article-4.1.2.rb +4 -3
  44. data/lib/deplate/fmt/dbk-article.rb +9 -8
  45. data/lib/deplate/fmt/dbk-book.rb +4 -3
  46. data/lib/deplate/fmt/dbk-ref.rb +5 -4
  47. data/lib/deplate/fmt/dbk-slides.rb +4 -3
  48. data/lib/deplate/fmt/dbk-snippet.rb +4 -3
  49. data/lib/deplate/fmt/html-snippet.rb +1 -1
  50. data/lib/deplate/fmt/html.rb +186 -46
  51. data/lib/deplate/fmt/htmlsite.rb +19 -9
  52. data/lib/deplate/fmt/htmlslides.rb +1 -1
  53. data/lib/deplate/fmt/htmlwebsite.rb +1 -1
  54. data/lib/deplate/fmt/latex-dramatist.rb +175 -0
  55. data/lib/deplate/fmt/latex-snippet.rb +1 -1
  56. data/lib/deplate/fmt/latex.rb +132 -80
  57. data/lib/deplate/fmt/null.rb +1 -1
  58. data/lib/deplate/fmt/php.rb +1 -1
  59. data/lib/deplate/fmt/phpsite.rb +1 -1
  60. data/lib/deplate/fmt/plain.rb +16 -9
  61. data/lib/deplate/fmt/template.rb +1 -1
  62. data/lib/deplate/fmt/xhtml10t.rb +1 -1
  63. data/lib/deplate/formatter-snippet.rb +1 -1
  64. data/lib/deplate/formatter.rb +272 -81
  65. data/lib/deplate/guesslanguage.rb +57 -0
  66. data/lib/deplate/input.rb +205 -50
  67. data/lib/deplate/input/deplate-headings.rb +9 -11
  68. data/lib/deplate/input/deplate-restricted.rb +3 -23
  69. data/lib/deplate/input/deplate.rb +1 -1
  70. data/lib/deplate/input/play.rb +208 -0
  71. data/lib/deplate/input/rdoc.rb +37 -15
  72. data/lib/deplate/input/template.rb +6 -11
  73. data/lib/deplate/lib/Makefile.config +53 -4
  74. data/lib/deplate/lib/html/parbreak +3 -0
  75. data/lib/deplate/lib/javascript/StepwiseNextPage.js +8 -0
  76. data/lib/deplate/lib/javascript/StepwiseNextPage_confirm.js +8 -0
  77. data/lib/deplate/lib/latex/deplate.sty +36 -0
  78. data/lib/deplate/lib/latex/parbreak +6 -0
  79. data/lib/deplate/lib/php/page-comment.inc.php +5 -5
  80. data/lib/deplate/lib/plain/parbreak +6 -0
  81. data/lib/deplate/locale/de.latin1 +87 -15
  82. data/lib/deplate/locale/de.latin1_data +60 -0
  83. data/lib/deplate/locale/en.latin1_data +46 -0
  84. data/lib/deplate/locale/fr.latin1_data +74 -0
  85. data/lib/deplate/locale/ru.koi8-r_data +63 -0
  86. data/lib/deplate/locale/{zh_cn.gb2312 → zh_CN.GB2312} +0 -0
  87. data/lib/deplate/macros.rb +106 -32
  88. data/lib/deplate/messages.rb +22 -8
  89. data/lib/deplate/metadata.rb +1 -1
  90. data/lib/deplate/metadata/marshal.rb +1 -1
  91. data/lib/deplate/metadata/xml.rb +1 -1
  92. data/lib/deplate/metadata/yaml.rb +1 -1
  93. data/lib/deplate/mod/anyword.rb +4 -4
  94. data/lib/deplate/mod/babelfish.rb +1 -1
  95. data/lib/deplate/mod/code-gvim.rb +14 -8
  96. data/lib/deplate/mod/code-gvim71.rb +52 -0
  97. data/lib/deplate/mod/code-highlight.rb +35 -19
  98. data/lib/deplate/mod/colored-log.rb +1 -1
  99. data/lib/deplate/mod/endnotes.rb +1 -1
  100. data/lib/deplate/mod/guesslanguage.rb +75 -0
  101. data/lib/deplate/mod/html-asciimath.rb +1 -1
  102. data/lib/deplate/mod/html-deplate-button.rb +1 -1
  103. data/lib/deplate/mod/html-headings-navbar.rb +1 -1
  104. data/lib/deplate/mod/html-highstep.rb +43 -0
  105. data/lib/deplate/mod/html-jsmath.rb +1 -1
  106. data/lib/deplate/mod/html-obfuscate-email.rb +1 -1
  107. data/lib/deplate/mod/html-sidebar.rb +1 -1
  108. data/lib/deplate/mod/iconv.rb +1 -1
  109. data/lib/deplate/mod/imgurl.rb +1 -1
  110. data/lib/deplate/mod/inlatex-compound.rb +1 -1
  111. data/lib/deplate/mod/koma.rb +4 -4
  112. data/lib/deplate/mod/{de.rb → lang-de.rb} +1 -1
  113. data/lib/deplate/mod/{en.rb → lang-en.rb} +1 -1
  114. data/lib/deplate/mod/{ru_koi8-r.rb → lang-ru-koi8-r.rb} +1 -1
  115. data/lib/deplate/mod/lang-ru.rb +9 -0
  116. data/lib/deplate/mod/{zh-cn-autospace.rb → lang-zh_CN-autospace.rb} +3 -3
  117. data/lib/deplate/mod/{zh-cn.rb → lang-zh_CN.rb} +8 -8
  118. data/lib/deplate/mod/latex-emph-table-head.rb +1 -1
  119. data/lib/deplate/mod/latex-styles.rb +6 -6
  120. data/lib/deplate/mod/latex-verbatim-small.rb +1 -1
  121. data/lib/deplate/mod/linkmap.rb +128 -0
  122. data/lib/deplate/mod/makefile.rb +23 -22
  123. data/lib/deplate/mod/mark-external-urls.rb +13 -7
  124. data/lib/deplate/mod/markup-1-warn.rb +1 -1
  125. data/lib/deplate/mod/markup-1.rb +1 -1
  126. data/lib/deplate/mod/navbar-png.rb +5 -4
  127. data/lib/deplate/mod/noindent.rb +1 -1
  128. data/lib/deplate/mod/numpara.rb +1 -1
  129. data/lib/deplate/mod/particle-math.rb +1 -1
  130. data/lib/deplate/mod/php-extra.rb +1 -1
  131. data/lib/deplate/mod/pstoedit.rb +1 -1
  132. data/lib/deplate/mod/recode.rb +1 -1
  133. data/lib/deplate/mod/smart-dash.rb +1 -1
  134. data/lib/deplate/mod/smiley.rb +1 -1
  135. data/lib/deplate/mod/soffice.rb +1 -1
  136. data/lib/deplate/mod/symbols-latin1.rb +1 -1
  137. data/lib/deplate/mod/symbols-od-utf-8.rb +1 -1
  138. data/lib/deplate/mod/symbols-plain.rb +1 -1
  139. data/lib/deplate/mod/symbols-sgml.rb +1 -1
  140. data/lib/deplate/mod/symbols-utf-8.rb +1 -1
  141. data/lib/deplate/mod/symbols-xml.rb +1 -1
  142. data/lib/deplate/mod/syntax-region-alt.rb +1 -1
  143. data/lib/deplate/mod/utf8.rb +1 -1
  144. data/lib/deplate/mod/validate-html.rb +1 -1
  145. data/lib/deplate/mod/xmlrpc.rb +37 -36
  146. data/lib/deplate/nukumi2.rb +4 -4
  147. data/lib/deplate/once-method.rb +1 -1
  148. data/lib/deplate/output.rb +12 -4
  149. data/lib/deplate/particles.rb +52 -22
  150. data/lib/deplate/regions.rb +160 -90
  151. data/lib/deplate/skeletons.rb +4 -3
  152. data/lib/deplate/structured.rb +19 -13
  153. data/lib/deplate/template.rb +17 -9
  154. data/lib/deplate/templates/html-doc.html +8 -11
  155. data/lib/deplate/templates/html-tabbar-right.html +1 -1
  156. data/lib/deplate/templates/html-tabbar-top.html +3 -3
  157. data/lib/deplate/variables.rb +25 -9
  158. data/lib/deplate/wiki-markup.rb +14 -3
  159. data/lib/deplate/xml.rb +3 -4
  160. data/lib/deplate/{zh-cn.rb → zh_CN.rb} +16 -16
  161. data/man/man1/deplate.1 +80 -65
  162. metadata +72 -48
  163. data/lib/deplate/mod/fr.rb +0 -46
@@ -1,9 +1,9 @@
1
1
  # skeletons.rb
2
- # @Author: Thomas Link (samul AT web de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
4
  # @Created: 28-Apr-2006.
5
- # @Last Change: 03-Jun-2006.
6
- # @Revision: 0.147
5
+ # @Last Change: 2007-02-24.
6
+ # @Revision: 0.149
7
7
 
8
8
  # Skeletons:
9
9
  class Deplate::SkeletonExpander < Deplate::CommonObject
@@ -24,6 +24,7 @@ class Deplate::SkeletonExpander < Deplate::CommonObject
24
24
  def require_skeleton(name, source=nil)
25
25
  skels = @skeletons_tmpl[@formatter_name] ||= {}
26
26
  # names = @deplate.formatter_family_members.collect {|f| "#{name}.#{f}"}
27
+ # names = @deplate.formatter.formatter_family_members.collect {|f| "#{name}.#{f}"}
27
28
  # names << name
28
29
  # names.each do |name|
29
30
  t = skels[name] ||= load_skeleton(name)
@@ -1,10 +1,10 @@
1
1
  # structured.rb
2
- # @Author: Thomas Link (samul AT web.de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @Website: http://deplate.sf.net/
4
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
5
  # @Created: 17-M�r-2004.
6
- # @Last Change: 05-Jun-2006.
7
- # @Revision: 0.2707
6
+ # @Last Change: 2007-07-01.
7
+ # @Revision: 0.2740
8
8
  #
9
9
  # TODO:
10
10
  # - am Ende des Dokuments muss ein Stapel mit offenen tags abgearbeitet werden
@@ -502,8 +502,7 @@ class Deplate::Formatter::Structured < Deplate::Formatter
502
502
  cc = bib_entry(c)
503
503
  if cc
504
504
  e = {}
505
- yr = cc.assoc('year')
506
- yr = if yr then yr[1] else '' end
505
+ yr = cc['year'] || ''
507
506
  e[:year] = yr
508
507
  if n
509
508
  e[:note] = @deplate.parse_and_format(container, n)
@@ -513,10 +512,14 @@ class Deplate::Formatter::Structured < Deplate::Formatter
513
512
  p = @deplate.parse_and_format(container, "#{@deplate.msg("p.\\ ")}#{p}")
514
513
  e[:pages] = p
515
514
  end
516
- nm = cc.assoc('author') || cc.assoc('editor')
515
+ nm = cc['author'] || cc['editor']
517
516
  if nm
518
- nm = nm[1].gsub(/\s+/, ' ').split(' and ').collect do |a|
519
- a.scan(/\w+$/)
517
+ if nm =~ /^\{(.*?)\}$/
518
+ nm = [[$1]]
519
+ else
520
+ nm = nm.gsub(/\s+/, ' ').split(/ +and +/).collect do |a|
521
+ a.scan(/\w+$/)
522
+ end
520
523
  end
521
524
  e[:name] = nm
522
525
  else
@@ -599,7 +602,8 @@ class Deplate::Formatter::Structured < Deplate::Formatter
599
602
  alias :format_bib_entry_re_structured :format_bib_entry
600
603
  def format_bib_entry(invoker, key, bibdef)
601
604
  args = invoker.args
602
- bib = Hash[*bibdef.flatten]
605
+ # bib = Hash[*bibdef.flatten]
606
+ bib = bibdef
603
607
  be = ["author", "title", "pages"]
604
608
  entry = {}
605
609
  process_bib_entry_part(invoker, args, entry, bib, be)
@@ -618,7 +622,7 @@ class Deplate::Formatter::Structured < Deplate::Formatter
618
622
  # ee = bib[e]
619
623
  # container[e] = self.send("get_bib_%s" % e, args, simple_latex_reformat(ee)) if ee
620
624
  # end
621
- return get_bib_relation(args, bib['@type'], entry, container)
625
+ return get_bib_relation(args, bib['_type'], entry, container)
622
626
  end
623
627
 
624
628
  def process_bib_entry_part(invoker, args, accum, bibdef, parts)
@@ -627,9 +631,11 @@ class Deplate::Formatter::Structured < Deplate::Formatter
627
631
  if ee
628
632
  ee = simple_latex_reformat(ee)
629
633
  ee = @deplate.parse_and_format(invoker, ee, false, [
630
- Deplate::HyperLink::Extended,
631
- Deplate::HyperLink::Simple,
632
- Deplate::HyperLink::Url,
634
+ Deplate::Particle::Macro,
635
+ Deplate::Particle::CurlyBrace,
636
+ Deplate::HyperLink::Extended,
637
+ Deplate::HyperLink::Simple,
638
+ Deplate::HyperLink::Url,
633
639
  ])
634
640
  accum[e] = self.send("get_bib_#{e}", args, ee)
635
641
  end
@@ -1,10 +1,10 @@
1
1
  # template.rb -- simple templates for deplate
2
- # @Author: Thomas Link (samul AT web.de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @Website: http://deplate.sf.net/
4
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
5
  # @Created: 10-Aug-2004.
6
- # @Last Change: 28-Mai-2006.
7
- # @Revision: 0.465
6
+ # @Last Change: 2007-09-28.
7
+ # @Revision: 0.550
8
8
  #
9
9
  # Description:
10
10
  #
@@ -105,6 +105,7 @@ class Deplate::Template
105
105
  :onthefly_particles => false,
106
106
  :vanilla => true,
107
107
  :inherit_options => true,
108
+ :paragraph_class => Deplate::Element::Paragraph,
108
109
 
109
110
  :elements => [
110
111
  Deplate::Element::Region,
@@ -133,8 +134,8 @@ class Deplate::Template
133
134
  'Mingle' => Deplate::Regions::Mingle,
134
135
  'Native' => Deplate::Regions::Native,
135
136
  'Ruby' => Deplate::Regions::Ruby,
136
- 'Doc' => Deplate::Regions::Doc,
137
- 'Var' => Deplate::Regions::Doc,
137
+ 'Doc' => Deplate::Regions::Var,
138
+ 'Var' => Deplate::Regions::Var,
138
139
  },
139
140
 
140
141
  :particles => [
@@ -188,10 +189,14 @@ class Deplate::Template
188
189
  @template = args[:template]
189
190
  @container = args[:container]
190
191
  @master = args[:master]
192
+ # @deplate_options = @@deplate_options.dup
193
+ @deplate_options = @@deplate_options
191
194
  if @master
192
- @@deplate_options[:options] = @master.options
195
+ @deplate_options[:options] = @master.options.dup
196
+ @deplate_options[:options].input_def = nil
197
+ @deplate_options[:options].input_class = nil
193
198
  else
194
- @@deplate_options[:options] = OpenStruct.new
199
+ @deplate_options[:options] = OpenStruct.new
195
200
  end
196
201
 
197
202
  if @template
@@ -229,7 +234,8 @@ class Deplate::Template
229
234
  :post => [],
230
235
  }
231
236
  @keep_whitespace = args.has_key?(:keep_whitespace) ? args[:keep_whitespace] : true
232
- if deplate.variables['template_version'] == '1'
237
+ case deplate.variables['template_version']
238
+ when '1'
233
239
  fill_in_1
234
240
  else
235
241
  fill_in_2
@@ -240,7 +246,9 @@ class Deplate::Template
240
246
  if @@deplate_for_template
241
247
  d = @@deplate_for_template
242
248
  else
243
- d = @@deplate_for_template = Deplate::DeplateForTemplates.new('', @@deplate_options)
249
+ d = @@deplate_for_template = Deplate::DeplateForTemplates.new('', @deplate_options)
250
+ d.reset(true)
251
+ d.push_input_format('template')
244
252
  end
245
253
  keep_whitespace = d.options.keep_whitespace
246
254
  master = d.options.master
@@ -1,24 +1,21 @@
1
1
  #Mingle type=pre slot=css:
2
+ <!--[if IE]>
2
3
  <style type="text/css">
3
- <!--
4
4
  @media screen {
5
- table.navbar {
6
- border-left:10px solid #ffdf70;
7
- background-color: #fff0c0;
8
- }
9
- body {
10
- background-color: #dfdfff;
5
+ table.tabBarTop {
6
+ border-collapse: collapse;
11
7
  }
12
8
  }
13
- -->
14
9
  </style>
10
+ <![endif]-->
15
11
  #End
12
+
16
13
  #PREMATTER
17
14
 
18
15
  <div id="tabFrame">
19
- <div class="tabBodyFrame" style="max-width:650pt; text-align:left">
20
- <div class="tabBody">
21
- #BODY: -navbar_top -navbar_bottom
16
+ <div id="tabBodyFrame" class="tabBodyFrame">
17
+ <div id="tabBody" class="tabBody">
18
+ #BODY
22
19
  </div>
23
20
  #POSTMATTER: html_pageicons_beg..html_pageicons_end
24
21
  </div>
@@ -14,7 +14,7 @@
14
14
  #POSTMATTER: html_pageicons_beg..html_pageicons_end
15
15
  </div>
16
16
  <div id="tabBar">
17
- #ARG: tabBarRight(spacer=spacer.png depth=2 depthInactive=1)
17
+ #XARG: tabBarRight(spacer=spacer.png depth=2 depthInactive=1)
18
18
  </div>
19
19
  </div>
20
20
 
@@ -16,11 +16,11 @@
16
16
  <div id="tabBodyFrame" class="tabBodyFrame">
17
17
  <div id="tabBar" class="tabBar">
18
18
  #IF: tabBarPos==top
19
- #ARG: tabBarTop()
19
+ #XARG: tabBarTop()
20
20
  #ELSEIF: tabBarPos==right
21
- #ARG: tabBarRight(progressBar! nextKey! depth=2 depthInactive=1)
21
+ #XARG: tabBarRight(progressBar! nextKey! depth=2 depthInactive=1)
22
22
  #ELSE
23
- #ARG: tabBarLeft(progressBar! nextKey! depth=2 depthInactive=1)
23
+ #XARG: tabBarLeft(progressBar! nextKey! depth=2 depthInactive=1)
24
24
  #ENDIF
25
25
  </div>
26
26
  <div id="tabBody" class="tabBody">
@@ -1,16 +1,17 @@
1
1
  # variables.rb
2
- # @Author: Thomas Link (samul AT web de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
4
  # @Created: 31-Dez-2005.
5
- # @Last Change: 18-Apr-2006.
6
- # @Revision: 0.37
5
+ # @Last Change: 2007-05-22.
6
+ # @Revision: 0.75
7
7
 
8
8
  class Deplate::Variables < Hash
9
9
  attr_accessor :deplate
10
10
 
11
11
  def initialize(deplate=nil)
12
12
  super()
13
- @deplate = deplate
13
+ @deplate = deplate
14
+ @priority = false
14
15
  end
15
16
 
16
17
  def log(*args)
@@ -22,8 +23,21 @@ class Deplate::Variables < Hash
22
23
  self[key] = val
23
24
  end
24
25
  end
25
-
26
+
27
+ def set_value(name, value)
28
+ begin
29
+ @priority = true
30
+ self[name] = value
31
+ ensure
32
+ @priority = false
33
+ end
34
+ end
35
+
26
36
  def []=(name, value)
37
+ if name =~ /^[[:upper:]]+?([@\[]|$)/ and !@priority
38
+ Deplate::Core.log(['No permisson', name, value], :error)
39
+ return
40
+ end
27
41
  if name.kind_of?(String) and (m = /^(\S+)\[(\S+)?\]$/.match(name))
28
42
  key = m[1]
29
43
  field = m[2]
@@ -48,16 +62,16 @@ class Deplate::Variables < Hash
48
62
  field = field.to_i
49
63
  var[field] = value
50
64
  else
51
- Deplate::Core.log(["Wrong index", field, name, var.class], :error)
65
+ Deplate::Core.log(['Wrong index', field, name, var.class], :error)
52
66
  end
53
67
  elsif var
54
- Deplate::Core.log(["Doc variable has wrong type", key, var.class], :error)
68
+ Deplate::Core.log(['Doc variable has wrong type', key, var.class], :error)
55
69
  end
56
70
  else
57
- super
71
+ super(name, value)
58
72
  end
59
73
  end
60
-
74
+
61
75
  def [](name)
62
76
  begin
63
77
  if !name.kind_of?(String) or keys.include?(name)
@@ -119,6 +133,8 @@ class Deplate::Variables < Hash
119
133
  else
120
134
  Deplate::Core.log(['Wrong index', field, name, val.class], :error)
121
135
  end
136
+ elsif val.respond_to?('[]')
137
+ return val[field]
122
138
  else
123
139
  Deplate::Core.log(['Variable has wrong type', key, val.class], :warning)
124
140
  end
@@ -1,10 +1,10 @@
1
1
  # wiki-markup.rb
2
- # @Author: Thomas Link (samul AT web.de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @Website: http://deplate.sf.net/
4
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
5
  # @Created: 10-M�r-2005.
6
- # @Last Change: 30-Mrz-2006.
7
- # @Revision: 0.260
6
+ # @Last Change: 2007-09-01.
7
+ # @Revision: 0.284
8
8
  #
9
9
  # = Description
10
10
  # Various elements for defining input filters
@@ -108,6 +108,7 @@ end
108
108
  class Deplate::Input::Wiki::ParagraphIndentedVerbatim < Deplate::Element::Paragraph
109
109
  set_rx(/^([ \t]*)(.+)[ \t]*$/)
110
110
  set_formatter nil
111
+ attr_reader :regNote
111
112
 
112
113
  def get_text
113
114
  @leading_whitespace = @match[1]
@@ -129,6 +130,7 @@ class Deplate::Input::Wiki::ParagraphIndentedVerbatim < Deplate::Element::Paragr
129
130
  format_as_paragraph
130
131
  else
131
132
  @elt = @leading_whitespace + @accum.join("\n")
133
+ # p "DBG format_special", @deplate.input.class, @deplate.input.elements, @elt
132
134
  format_as_verbatim
133
135
  end
134
136
  end
@@ -138,11 +140,20 @@ class Deplate::Input::Wiki::ParagraphIndentedVerbatim < Deplate::Element::Paragr
138
140
  end
139
141
 
140
142
  def format_as_verbatim
143
+ # <+TBD+> Register a code region in rdoc
144
+ # if @deplate.variables['codeSyntax']
145
+ # r = Deplate::Element::Region.new(@deplate, @source, @accum, @match, 'Code', @args)
146
+ # r = r.finish
147
+ # r = r.process
148
+ # r = r.format_compound
149
+ # r
150
+ # else
141
151
  margin = @args["wrap"]
142
152
  if margin
143
153
  @elt = @deplate.formatter.wrap_text(@elt, :margin => margin.to_i)
144
154
  end
145
155
  format_element(:format_verbatim, self)
156
+ # end
146
157
  end
147
158
  end
148
159
 
@@ -1,10 +1,10 @@
1
1
  # xml.rb
2
- # @Author: Thomas Link (samul AT web.de)
2
+ # @Author: Thomas Link (micathom AT gmail com)
3
3
  # @Website: http://deplate.sf.net/
4
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
5
  # @Created: 17-M�r-2004.
6
- # @Last Change: 15-Apr-2006.
7
- # @Revision: 0.2315
6
+ # @Last Change: 2007-07-21.
7
+ # @Revision: 0.2318
8
8
  #
9
9
  # TODO:
10
10
  # -
@@ -17,7 +17,6 @@ class Deplate::Formatter::XML < Deplate::Formatter::Structured
17
17
  self.suffix = ".xml"
18
18
 
19
19
  def initialize(deplate, args)
20
- @consumed_ids = []
21
20
  deplate.options.indentation_level = [0]
22
21
  super
23
22
  @special_symbols = {
@@ -1,10 +1,10 @@
1
1
  # zh-cn.rb -- Simplified Chinese messages
2
- # @Author: Thomas Link; localization by Jjgod Jiang (gzjjgod@21cn.com)
2
+ # @Author: Thomas Link; localization by Jjgod Jiang (gzjjgod AT 21cn com)
3
3
  # @Website: http://deplate.sf.net/
4
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
5
  # @Created: 01-Aug-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.207
6
+ # @Last Change: 2007-09-02.
7
+ # @Revision: 0.217
8
8
 
9
9
  require 'deplate/messages'
10
10
 
@@ -12,21 +12,21 @@ class Deplate::Formatter
12
12
  attr_reader :cjk_smart_blanks
13
13
 
14
14
  def hook_pre_setup_zh_cn
15
- # @deplate.variables["encoding"] = "gb2312"
16
- @cjk_smart_blanks = !(@deplate.variables["noSmartBlanks"] || false)
15
+ # @deplate.variables['encoding'] = 'GB2312'
16
+ @cjk_smart_blanks = !(@deplate.variables['noSmartBlanks'] || false)
17
17
  end
18
18
  end
19
19
 
20
20
  class Deplate::Formatter::LaTeX
21
21
  def prepare_zh_cn
22
- family = @deplate.variables["cjk_family"] || "gbsn"
23
- encoding = @deplate.variables["cjk_encoding"] || "GB"
24
- union_at(:pre, :mod_packages, "\\usepackage{CJK}")
25
- union_at(:pre, :mod_packages, "\\usepackage{CJKnumb}")
26
- union_at(:pre, :mod_packages, "\\usepackage{indentfirst}")
22
+ family = @deplate.variables['cjk_family'] || 'gbsn'
23
+ encoding = @deplate.variables['cjk_encoding'] || 'GB'
24
+ union_at(:pre, :mod_packages, '\\usepackage{CJK}')
25
+ union_at(:pre, :mod_packages, '\\usepackage{CJKnumb}')
26
+ union_at(:pre, :mod_packages, '\\usepackage{indentfirst}')
27
27
  output_at(:pre, :body_beg, "\\begin{CJK*}{#{encoding}}{#{family}}",
28
- "\\CJKtilde{}", "\\CJKcaption{GB}", "\\CJKindent{}")
29
- output_at(:post, :prepend_body_end, "\\end{CJK*}")
28
+ '\\CJKtilde{}', '\\CJKcaption{GB}', '\\CJKindent{}')
29
+ output_at(:post, :prepend_body_end, '\\end{CJK*}')
30
30
  end
31
31
 
32
32
  def set_document_encoding
@@ -50,10 +50,10 @@ class Deplate::Formatter
50
50
  end
51
51
 
52
52
  class Deplate::Messages::ZhCnGb2312 < Deplate::Messages
53
- setup 'zh-cn'
54
- def_prop 'lang', 'zh-cn'
55
- def_prop 'encoding', 'gb2312'
53
+ setup 'zh_CN'
54
+ def_prop 'lang', 'zh_CN'
55
+ def_prop 'encoding', 'GB2312'
56
56
  def_prop 'latex_encoding', nil
57
- load_catalog 'zh_cn.gb2312'
57
+ load_catalog 'zh_CN.GB2312'
58
58
  end
59
59
 
@@ -2,13 +2,13 @@
2
2
  .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
3
3
  .\" Instead of manually editing it, you probably should edit the DocBook XML
4
4
  .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
5
- .TH "DEPLATE" "1" "07. Jun 2006" "" ""
5
+ .TH "DEPLATE" "1" "25. Sep 2007" "" ""
6
6
  .\" disable hyphenation
7
7
  .nh
8
8
  .\" disable justification (adjust text to left margin only)
9
9
  .ad l
10
10
  .SH "NAME"
11
- deplate \- Deplate 0.8 \-\- convert wiki\-like markup to latex, docbook, html, or "html\-slides"
11
+ deplate \- Deplate 0.8.1 \-\- convert wiki\-like markup to latex, docbook, html, or "html\-slides"
12
12
  .SH "USAGE"
13
13
  .PP
14
14
  The command\-line options:
@@ -22,35 +22,35 @@ the terms of the GNU General Public License version 2.
22
22
 
23
23
 
24
24
  General Options:
25
- \-a, \-\-[no\-]ask On certain actions, query
25
+ \-a, \-\-[no\-]ask On certain actions, query
26
26
  user before overwriting files
27
- \-A, \-\-allow ALLOW Allow certain things: l,
27
+ \-A, \-\-allow ALLOW Allow certain things: l,
28
28
  r, t, w, W, x, X, $
29
29
  \-c, \-\-config FILE Alternative user cfg file
30
30
  \-\-[no\-]clean Clean up temporary files
31
31
  \-\-color Colored output
32
- \-\-css NAME Copy NAME.css to the destination
32
+ \-\-css NAME Copy NAME.css to the destination
33
33
  directory, if inexistent
34
- \-\-copy\-css NAME Copy NAME.css to the destination
34
+ \-\-copy\-css NAME Copy NAME.css to the destination
35
35
  directory
36
36
  \-d, \-\-dir DIR Output directory
37
37
  \-D, \-\-define NAME=VALUE Define a document option
38
38
  \-e, \-\-[no\-]each Handle each file separately
39
39
  \-\-[no\-]force Force output
40
- \-f, \-\-format FORMAT Output format (default:
40
+ \-f, \-\-format FORMAT Output format (default:
41
41
  html)
42
42
  \-\-[no\-]included Output body only
43
43
  \-i, \-\-input NAME Input definition
44
- \-\-list FILE A file that contains a list
44
+ \-\-list FILE A file that contains a list
45
45
  of input files
46
- \-\-log FILE A file (or \- for stdout)
46
+ \-\-log FILE A file (or \- for stdout)
47
47
  where to put the log
48
- \-\-[no\-]loop Read from stdin forever
48
+ \-\-[no\-]loop Read from stdin forever
49
49
  and ever
50
- \-\-metadata [NAME] Save metadata in this format
50
+ \-\-metadata [NAME] Save metadata in this format
51
51
  (default: yaml)
52
52
  \-m, \-\-module MODULE Load a module
53
- \-o, \-\-out FILE Output to file or stdout
53
+ \-o, \-\-out FILE Output to file or stdout
54
54
  ('\-')
55
55
  \-p, \-\-pattern GLOBPATTERN File name pattern
56
56
  \-P, \-\-exclude GLOBPATTERN Excluded file name pattern
@@ -63,9 +63,9 @@ General Options:
63
63
  \-\-suffix SUFFIX Suffix for output files
64
64
  \-t, \-\-template NAME Template to use
65
65
  \-\-[no\-]vanilla Ignore user configuration
66
- \-x, \-\-allow\-ruby [RUBY SAFE] Allow the execution of ruby
66
+ \-x, \-\-allow\-ruby [RUBY SAFE] Allow the execution of ruby
67
67
  code
68
- \-X, \-\-[no\-]allow\-exec Allow the execution of helper
68
+ \-X, \-\-[no\-]allow\-exec Allow the execution of helper
69
69
  applications
70
70
  \-\-[no\-]external
71
71
 
@@ -75,13 +75,14 @@ LaTeX Formatter:
75
75
 
76
76
 
77
77
  Available input defintions:
78
- deplate, deplate\-headings, deplate\-restricted, rdoc, template
78
+ deplate, deplate\-headings, deplate\-restricted, play, rdoc, template
79
79
 
80
80
 
81
81
  Available formatters:
82
- dbk\-article, dbk\-article\-4.1.2, dbk\-book, dbk\-ref, dbk\-slides,
83
- dbk\-snippet, html, html\-snippet, htmlsite, htmlslides, htmlwebsite,
84
- latex, latex\-snippet, null, php, phpsite, plain, template, xhtml10t
82
+ dbk\-article, dbk\-article\-4.1.2, dbk\-book, dbk\-ref, dbk\-slides,
83
+ dbk\-snippet, html, html\-snippet, htmlsite, htmlslides, htmlwebsite,
84
+ latex, latex\-dramatist, latex\-snippet, null, php, phpsite, plain,
85
+ template, xhtml10t
85
86
 
86
87
 
87
88
  Available metadata formats:
@@ -89,28 +90,30 @@ marshal, xml, yaml
89
90
 
90
91
 
91
92
  Available modules:
92
- anyword, babelfish, code\-gvim, code\-highlight, colored\-log, de,
93
- en, endnotes, fr, html\-asciimath, html\-deplate\-button, html\-headings\-navbar,
94
- html\-jsmath, html\-obfuscate\-email, html\-sidebar, htmlslides\-navbar\-fh,
95
- iconv, imgurl, inlatex\-compound, koma, latex\-emph\-table\-head,
96
- latex\-styles, latex\-verbatim\-small, makefile, mark\-external\-urls,
97
- markup\-1, markup\-1\-warn, navbar\-png, noindent, numpara, particle\-math,
98
- php\-extra, pstoedit, recode, ru_koi8\-r, smart\-dash, smiley, soffice,
99
- symbols\-latin1, symbols\-od\-utf\-8, symbols\-plain, symbols\-sgml,
100
- symbols\-utf\-8, symbols\-xml, syntax\-region\-alt, utf8, validate\-html,
101
- xmlrpc, zh\-cn, zh\-cn\-autospace
93
+ anyword, babelfish, code\-gvim, code\-gvim71, code\-highlight, colored\-log,
94
+ endnotes, guesslanguage, html\-asciimath, html\-deplate\-button,
95
+ html\-headings\-navbar, html\-highstep, html\-jsmath, html\-obfuscate\-email,
96
+ html\-sidebar, htmlslides\-navbar\-fh, iconv, imgurl, inlatex\-compound,
97
+ koma, lang\-de, lang\-en, lang\-ru, lang\-ru\-koi8\-r, lang\-zh_CN,
98
+ lang\-zh_CN\-autospace, latex\-emph\-table\-head, latex\-styles, latex\-verbatim\-small,
99
+ makefile, mark\-external\-urls, markup\-1, markup\-1\-warn, navbar\-png,
100
+ noindent, numpara, particle\-math, php\-extra, pstoedit, quiz,
101
+ recode, smart\-dash, smiley, soffice, symbols\-latin1, symbols\-od\-utf\-8,
102
+ symbols\-plain, symbols\-sgml, symbols\-utf\-8, symbols\-xml, syntax\-region\-alt,
103
+ utf8, validate\-html, xmlrpc
102
104
 
103
105
 
104
106
  Available css files:
105
- article, deplate, heading\-navbar, layout\-deplate, layout\-deplate\-print,
106
- sans\-serif, serif, serif\-e, serif\-rel, slides, tabbar, tabbar\-left,
107
- tabbar\-right, tabbar\-right\-ie, tabbar\-top, text\-sans\-serif, text\-serif
107
+ article, deplate, heading\-navbar, highstep, htmldoc, layout\-deplate,
108
+ layout\-deplate\-print, play, sans\-serif, serif, serif\-e, serif\-rel,
109
+ slides, styles, tabbar, tabbar\-left, tabbar\-right, tabbar\-right\-ie,
110
+ tabbar\-top, text\-sans\-serif, text\-serif
108
111
 
109
112
 
110
113
  Available templates:
111
- html\-doc.html, html\-left\-tabbar\-js.html, html\-left\-tabbar.html,
112
- html\-tabbar\-right\-pcomments.php, html\-tabbar\-right\-step.html,
113
- html\-tabbar\-right\-table.html, html\-tabbar\-right.html, html\-tabbar\-top.html,
114
+ html\-doc.html, html\-left\-tabbar\-js.html, html\-left\-tabbar.html,
115
+ html\-tabbar\-right\-pcomments.php, html\-tabbar\-right\-step.html,
116
+ html\-tabbar\-right\-table.html, html\-tabbar\-right.html, html\-tabbar\-top.html,
114
117
  html\-tabbar.html
115
118
 
116
119
 
@@ -120,9 +123,9 @@ Other Options:
120
123
  \-\-[no\-]quiet Be quiet
121
124
  \-v, \-\-[no\-]verbose Run verbosely
122
125
  \-h, \-\-help Show this message
123
- \-\-list\-modules [REGEXP] List modules matching a
126
+ \-\-list\-modules [REGEXP] List modules matching a
124
127
  pattern
125
- \-\-list\-css [REGEXP] List css files matching
128
+ \-\-list\-css [REGEXP] List css files matching
126
129
  a pattern
127
130
  \-\-version Show version
128
131
  \-\-microversion Show version
@@ -160,7 +163,6 @@ Notes:
160
163
  .TP
161
164
  \-D VAR, \-D VAR=VALUE
162
165
  You can define document variables via the command line; if no value is provided the variable is set to "1".
163
- .sp
164
166
  The option parser library, which
165
167
  deplate
166
168
  uses, doesn't deal well with spaces in command line arguments. This is why spaces have to be replaced with tildes; a tilde and backslashes have to be preceded with backslashes. Example:
@@ -203,7 +205,7 @@ Flags is a list of comma separated letters which may contain:
203
205
  l
204
206
  Allow the
205
207
  #LANG
206
- command to automatically load a module of the language's name
208
+ command to automatically load a module of the language's name (this would make it possible for a malicious user to load any module as deplate cannot distinguish localization modules from other modules)
207
209
  .TP
208
210
  r
209
211
  Check files in $PWD/deplate.rc in some cases (e.g. check for a local config.rb); templates, css files, and library snippets are always searched in the
@@ -297,7 +299,13 @@ Configuration requires some knowledge of the ruby language. If you don't already
297
299
  \fIfully\fR
298
300
  object\-oriented interpreted language in the spirit of Smalltalk (but with a rather modern syntax) plus some features from Perl and Lisp/Scheme (e.g. continuations).
299
301
  .PP
300
- The configuration files are regular ruby files and are loaded after requiring all the libraries necessary. Theses files reside in the directory "$HOME/.deplate/" or "$USERPROFILE/deplate.rc/". This directory may also contain custom modules or css files etc. On Win 2000/XP etc., $USERPROFILE is usually set to "C:\\Documents and Settings\\USERNAME\\".
302
+ The configuration files are regular ruby files and are loaded after requiring all the libraries necessary. Theses files reside in the directory "$HOME/.deplate/" or "$USERPROFILE/deplate.rc/". If these directories are not found, the files are searched in
303
+ $WINDIR/deplate.rc/
304
+ or
305
+ /etc/deplate.rc/. Some files are also looked for in the "datadir" (usually something like
306
+ /usr/share/deplate/).
307
+ .PP
308
+ This directory may also contain custom modules or css files etc. On Win 2000/XP etc., $USERPROFILE is usually set to "C:\\Documents and Settings\\USERNAME\\".
301
309
  .PP
302
310
  The user configuration directory should look like this:
303
311
  .TP 3
@@ -730,53 +738,60 @@ mixes up your template, you should prefix these curly braces that cause problems
730
738
  .PP
731
739
  Backslashes have always to be doubled.
732
740
  .PP
733
- A LaTeX template could then look like this:
741
+ Example 2.2: A letter template
742
+ .PP
743
+ In this example, we use get for the author's name because the corresponding clip is automatically defined by the standard #AU(THOR) command. For other data we use variables.
744
+ .PP
745
+ Template: tmpl_letter.tex
734
746
  .sp
735
747
  .nf
736
- % The author and date clips are automatically set by the #AUTHOR and
737
- % #DATE commands
738
- % (c) {get: date}, {get: author}
739
-
740
- \\\\documentclass[12pt,a4paper]{letter}
741
-
742
- % Insert all the prematter stuff except the documentclass definition,
743
- % which is provided by this template
748
+ \\\\documentclass[12pt,a4paper,english]{letter}
744
749
  #PREMATTER: \-doc_def
745
-
746
750
  \\\\address{{get: author}\\\\\\\\
747
- Where I live}
751
+ {val escapebackslash!: address}}
748
752
  \\\\signature{{get: author}}
749
753
 
750
- % addresseeAddress and addresseeName refer to document variables defined
751
- % using the #VAR command or provided at the command line
752
- \\\\begin{letter}{{get: addresseeAddress}}
753
-
754
- \\\\opening{Dear {get: addresseeName},}
754
+ \\\\begin{letter}{{val: addresseeName}\\\\\\\\
755
+ {val escapebackslash!: addresseeAddress}}
756
+ \\\\opening{Dear {val: addresseeName},}
755
757
 
756
- % Insert the body
757
758
  #BODY
758
759
 
759
760
  \\\\closing{Sincerly,}
760
-
761
761
  \\\\vfill{}
762
- % "enclosure" refers to a clip define by the #PUT command
763
762
  \\\\encl{{val: enclosure}}
764
-
765
763
  \\\\end{letter}
766
-
767
- % Insert post\-body stuff
768
764
  #POSTMATTER
769
765
  .fi
770
766
  .PP
771
- You could now copy this example template to "~/.deplate/templates/letter.tex" and call
772
- deplate
773
- as:
767
+ Input file: example\-letter.txt
774
768
  .sp
775
769
  .nf
776
- deplate \-f latex \-t letter.tex DEPLATE.FILE
770
+ #AU: John Smith
771
+ #DATE: today
772
+ #VAR id=address: Cool Place 1{nl inline!}Hiptown 10000
773
+ #VAR id=enclosure: Important Document
774
+ #VAR: addresseeName=Max Mustermann
775
+ #VAR: addresseeAddress=Tolle Straße 2{nl}Neustadt 20000
776
+
777
+ I would like to say thanks for your last letter which I read with much joy. I
778
+ hope to be hearing from you soon.
777
779
  .fi
780
+ .PP
781
+ Command line:
782
+ .sp
783
+ .nf
784
+ deplate \-t tmpl_letter.tex \-f latex example\-letter.txt
785
+ pdflatex example\-letter.tex
786
+ .fi
787
+ .PP
788
+ Result:
789
+ [2]\&\fIexample\-letter.pdf\fR
778
790
  .RE
779
791
  .SH "REFERENCES"
780
792
  .TP 3
781
793
  1.\ Vim viki plugin
782
794
  \%http://www.vim.org/scripts/script.php?script_id=861
795
+ .TP 3
796
+ 2.\ example\-letter.pdf
797
+ \%example\-letter.pdf