deplate 0.7.3 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/AUTHORS.TXT +3 -0
  2. data/CHANGES.TXT +248 -175
  3. data/LICENSE.TXT +0 -0
  4. data/NEWS.TXT +28 -24
  5. data/README.TXT +0 -0
  6. data/TODO.TXT +174 -88
  7. data/VERSION.TXT +1 -1
  8. data/bin/deplate +0 -0
  9. data/bin/deplate.bat +0 -0
  10. data/etc/deplate.ini +91 -3
  11. data/lib/action_view/helpers/deplate.rb +45 -0
  12. data/lib/deplate.rb +6 -1
  13. data/lib/deplate/abstract-class.rb +0 -0
  14. data/lib/deplate/bib.rb +576 -0
  15. data/lib/deplate/builtin.rb +0 -0
  16. data/lib/deplate/cache.rb +55 -5
  17. data/lib/deplate/commands.rb +346 -183
  18. data/lib/deplate/common.rb +209 -48
  19. data/lib/deplate/converter.rb +12 -6
  20. data/lib/deplate/core.rb +777 -378
  21. data/lib/deplate/counters.rb +254 -0
  22. data/lib/deplate/css/article.css +4 -3
  23. data/lib/deplate/css/deplate.css +121 -5
  24. data/lib/deplate/css/heading-navbar.css +0 -0
  25. data/lib/deplate/css/layout-deplate-print.css +0 -0
  26. data/lib/deplate/css/layout-deplate.css +0 -0
  27. data/lib/deplate/css/sans-serif.css +0 -0
  28. data/lib/deplate/css/serif-e.css +0 -0
  29. data/lib/deplate/css/serif-rel.css +0 -0
  30. data/lib/deplate/css/serif.css +9 -3
  31. data/lib/deplate/css/slides.css +0 -0
  32. data/lib/deplate/css/tabbar-left.css +0 -0
  33. data/lib/deplate/css/tabbar-right-ie.css +3 -9
  34. data/lib/deplate/css/tabbar-right.css +51 -18
  35. data/lib/deplate/css/tabbar-top.css +7 -1
  36. data/lib/deplate/css/tabbar.css +0 -0
  37. data/lib/deplate/css/text-sans-serif.css +0 -0
  38. data/lib/deplate/css/text-serif.css +0 -0
  39. data/lib/deplate/define.rb +183 -177
  40. data/lib/deplate/deplate-string.rb +82 -0
  41. data/lib/deplate/docbook.rb +236 -128
  42. data/lib/deplate/elements.rb +584 -417
  43. data/lib/deplate/etc.rb +163 -101
  44. data/lib/deplate/external.rb +42 -11
  45. data/lib/deplate/fmt/dbk-article-4.1.2.rb +0 -0
  46. data/lib/deplate/fmt/dbk-article.rb +0 -0
  47. data/lib/deplate/fmt/dbk-book.rb +0 -0
  48. data/lib/deplate/fmt/dbk-ref.rb +3 -3
  49. data/lib/deplate/fmt/dbk-slides.rb +0 -0
  50. data/lib/deplate/fmt/dbk-snippet.rb +0 -0
  51. data/lib/deplate/fmt/html-snippet.rb +0 -0
  52. data/lib/deplate/fmt/html.rb +783 -550
  53. data/lib/deplate/fmt/htmlsite.rb +192 -199
  54. data/lib/deplate/fmt/htmlslides.rb +0 -0
  55. data/lib/deplate/fmt/htmlwebsite.rb +3 -3
  56. data/lib/deplate/fmt/latex-snippet.rb +0 -0
  57. data/lib/deplate/fmt/latex.rb +242 -83
  58. data/lib/deplate/fmt/null.rb +32 -0
  59. data/lib/deplate/fmt/php.rb +4 -4
  60. data/lib/deplate/fmt/phpsite.rb +6 -5
  61. data/lib/deplate/fmt/plain.rb +160 -106
  62. data/lib/deplate/fmt/template.rb +0 -0
  63. data/lib/deplate/fmt/xhtml10t.rb +0 -0
  64. data/lib/deplate/formatter-snippet.rb +0 -0
  65. data/lib/deplate/formatter.rb +613 -301
  66. data/lib/deplate/input.rb +202 -142
  67. data/lib/deplate/input/deplate-headings.rb +4 -6
  68. data/lib/deplate/input/deplate-restricted.rb +15 -9
  69. data/lib/deplate/input/deplate.rb +2 -4
  70. data/lib/deplate/input/rdoc.rb +39 -38
  71. data/lib/deplate/input/template.rb +0 -0
  72. data/lib/deplate/lib/Makefile.config +29 -0
  73. data/lib/deplate/lib/latex/deplate.sty +54 -0
  74. data/lib/deplate/lib/latex/highlight-extra.sty +0 -0
  75. data/lib/deplate/lib/latex/highlight-typical.sty +0 -0
  76. data/lib/deplate/lib/php/page-comment.inc.php +216 -0
  77. data/lib/deplate/lib/tabmenu.js +0 -0
  78. data/lib/deplate/locale/de.latin1 +155 -17
  79. data/lib/deplate/locale/ru.koi8-r +0 -0
  80. data/lib/deplate/locale/zh_cn.gb2312 +0 -0
  81. data/lib/deplate/macros.rb +133 -82
  82. data/lib/deplate/messages.rb +6 -4
  83. data/lib/deplate/metadata.rb +0 -0
  84. data/lib/deplate/metadata/marshal.rb +0 -0
  85. data/lib/deplate/metadata/xml.rb +0 -0
  86. data/lib/deplate/metadata/yaml.rb +0 -0
  87. data/lib/deplate/mod/anyword.rb +3 -3
  88. data/lib/deplate/mod/babelfish.rb +4 -4
  89. data/lib/deplate/mod/code-gvim.rb +8 -4
  90. data/lib/deplate/mod/code-highlight.rb +3 -3
  91. data/lib/deplate/mod/colored-log.rb +0 -0
  92. data/lib/deplate/mod/de.rb +2 -2
  93. data/lib/deplate/mod/en.rb +0 -0
  94. data/lib/deplate/mod/endnotes.rb +0 -0
  95. data/lib/deplate/mod/fr.rb +0 -0
  96. data/lib/deplate/mod/html-asciimath.rb +0 -0
  97. data/lib/deplate/mod/html-deplate-button.rb +0 -0
  98. data/lib/deplate/mod/html-headings-navbar.rb +5 -13
  99. data/lib/deplate/mod/html-jsmath.rb +39 -0
  100. data/lib/deplate/mod/html-obfuscate-email.rb +3 -3
  101. data/lib/deplate/mod/html-sidebar.rb +0 -0
  102. data/lib/deplate/mod/htmlslides-navbar-fh.rb +3 -3
  103. data/lib/deplate/mod/iconv.rb +0 -0
  104. data/lib/deplate/mod/imgurl.rb +4 -4
  105. data/lib/deplate/mod/inlatex-compound.rb +7 -10
  106. data/lib/deplate/mod/koma.rb +0 -0
  107. data/lib/deplate/mod/latex-emph-table-head.rb +0 -0
  108. data/lib/deplate/mod/latex-styles.rb +7 -4
  109. data/lib/deplate/mod/latex-verbatim-small.rb +0 -0
  110. data/lib/deplate/mod/makefile.rb +23 -7
  111. data/lib/deplate/mod/mark-external-urls.rb +3 -3
  112. data/lib/deplate/mod/markup-1-warn.rb +10 -10
  113. data/lib/deplate/mod/markup-1.rb +0 -0
  114. data/lib/deplate/mod/navbar-png.rb +24 -8
  115. data/lib/deplate/mod/noindent.rb +0 -0
  116. data/lib/deplate/mod/numpara.rb +0 -0
  117. data/lib/deplate/mod/particle-math.rb +4 -4
  118. data/lib/deplate/mod/php-extra.rb +46 -6
  119. data/lib/deplate/mod/pstoedit.rb +0 -0
  120. data/lib/deplate/mod/recode.rb +0 -0
  121. data/lib/deplate/mod/ru_koi8-r.rb +0 -0
  122. data/lib/deplate/mod/smart-dash.rb +26 -0
  123. data/lib/deplate/mod/smiley.rb +69 -7
  124. data/lib/deplate/mod/soffice.rb +0 -0
  125. data/lib/deplate/mod/symbols-latin1.rb +14 -23
  126. data/lib/deplate/mod/symbols-od-utf-8.rb +5 -3
  127. data/lib/deplate/mod/symbols-plain.rb +5 -35
  128. data/lib/deplate/mod/symbols-sgml.rb +8 -9
  129. data/lib/deplate/mod/symbols-utf-8.rb +8 -9
  130. data/lib/deplate/mod/symbols-xml.rb +5 -9
  131. data/lib/deplate/mod/syntax-region-alt.rb +5 -5
  132. data/lib/deplate/mod/utf8.rb +0 -0
  133. data/lib/deplate/mod/validate-html.rb +0 -0
  134. data/lib/deplate/mod/xmlrpc.rb +0 -0
  135. data/lib/deplate/mod/zh-cn-autospace.rb +18 -20
  136. data/lib/deplate/mod/zh-cn.rb +4 -6
  137. data/lib/deplate/nukumi2.rb +71 -0
  138. data/lib/deplate/once-method.rb +0 -0
  139. data/lib/deplate/output.rb +19 -21
  140. data/lib/deplate/particles.rb +178 -116
  141. data/lib/deplate/regions.rb +99 -58
  142. data/lib/deplate/skeletons.rb +122 -0
  143. data/lib/deplate/structured.rb +164 -106
  144. data/lib/deplate/template.rb +67 -43
  145. data/lib/deplate/templates/html-doc.html +0 -0
  146. data/lib/deplate/templates/html-left-tabbar-js.html +0 -0
  147. data/lib/deplate/templates/html-left-tabbar.html +0 -0
  148. data/lib/deplate/templates/html-tabbar-right-pcomments.php +22 -0
  149. data/lib/deplate/templates/html-tabbar-right-step.html +24 -0
  150. data/lib/deplate/templates/html-tabbar-right-table.html +0 -0
  151. data/lib/deplate/templates/html-tabbar-right.html +2 -4
  152. data/lib/deplate/templates/html-tabbar-top.html +0 -9
  153. data/lib/deplate/templates/html-tabbar.html +0 -0
  154. data/lib/deplate/variables.rb +127 -0
  155. data/lib/deplate/wiki-markup.rb +99 -33
  156. data/lib/deplate/xml.rb +18 -18
  157. data/lib/deplate/zh-cn.rb +0 -0
  158. data/lib/ps2ppm.rb +0 -0
  159. data/man/man1/deplate.1 +564 -474
  160. metadata +201 -186
@@ -0,0 +1,254 @@
1
+ # counters.rb
2
+ # @Author: Thomas Link (samul AT web de)
3
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
+ # @Created: 31-Dez-2005.
5
+ # @Last Change: 04-Jan-2006.
6
+ # @Revision: 0.8
7
+
8
+ class Deplate::Counters
9
+ def initialize(deplate)
10
+ @deplate = deplate
11
+ @counters = {}
12
+ end
13
+
14
+ def def_counter(name, args={})
15
+ parent_counter = args[:parent]
16
+ if parent_counter
17
+ parent, parent_level = parent_counter.split(/[.,:;@-_<> ]+/)
18
+ parent_level = parent_level.to_i
19
+ if parent_level > 0
20
+ parent_level -= 1
21
+ end
22
+ pc = @counters[parent]
23
+ if pc
24
+ pc[:children] << {:name => name, :level => parent_level}
25
+ else
26
+ Deplate::Core.log(['Unknown counter', pc], :error)
27
+ end
28
+ else
29
+ parent = nil
30
+ parent_level = nil
31
+ end
32
+ init = args[:init] || [0]
33
+ @counters[name] = {
34
+ :value => init.dup,
35
+ :init => init.dup,
36
+ :children => [],
37
+ :parent => parent,
38
+ :parent_level => parent_level,
39
+ }
40
+ end
41
+
42
+ def is_defined?(name)
43
+ @counters.keys.include?(name)
44
+ end
45
+
46
+ def get(name, compound=false)
47
+ c = @counters[name]
48
+ if c
49
+ if compound
50
+ c
51
+ else
52
+ [get_parent(name), c[:value]].compact.flatten
53
+ end
54
+ else
55
+ Deplate::Core.log(['Unknown counter', name], :error)
56
+ nil
57
+ end
58
+ end
59
+
60
+ def get_parent(name, compound=false)
61
+ c = get(name, true)
62
+ p = c[:parent]
63
+ if p
64
+ pl = c[:parent_level]
65
+ v = get(p, compound)
66
+ if compound or !pl
67
+ v
68
+ else
69
+ v[0..pl]
70
+ end
71
+ else
72
+ nil
73
+ end
74
+ end
75
+
76
+ def set(name, value)
77
+ c = get(name, true)
78
+ if c
79
+ c[:value] = value
80
+ end
81
+ self
82
+ end
83
+
84
+ def reset(name=nil, args={})
85
+ if name
86
+ c = get(name, true)
87
+ if c
88
+ c[:value] = c[:init].dup
89
+ # i = c[:init].dup
90
+ # l = args[:level]
91
+ # if l
92
+ # v = c[:value]
93
+ # v = v[0..(l - 1)]
94
+ # else
95
+ # v = i
96
+ # end
97
+ # set(name, v)
98
+ c[:children].each do |cn, cl|
99
+ reset(cn, :level => l)
100
+ end
101
+ end
102
+ else
103
+ for name in @counters.keys
104
+ reset(name)
105
+ end
106
+ end
107
+ end
108
+
109
+ # Increase a counter. Optional arguments:
110
+ # +:by+:: The value to add
111
+ # +:level+:: If the counter is hierarchical (an array), increase
112
+ # this level & reset all sublevels
113
+ # +:to_s+:: Return the counter as string
114
+ def increase(name, args={})
115
+ by = args[:by] || 1
116
+ cc = get(name, true)
117
+ if cc
118
+ c = cc[:value]
119
+ mx = c.size - 1
120
+ lv = args[:level]
121
+ lv = lv ? (lv.to_i - 1) : mx
122
+ if lv < 0
123
+ lv = 0
124
+ end
125
+ if lv < mx
126
+ c = c[0..lv]
127
+ end
128
+ if lv > mx
129
+ for i in (mx+1)..(lv-1)
130
+ c[i] = 0
131
+ end
132
+ c[lv] = by
133
+ else
134
+ c[lv] += by
135
+ end
136
+ set(name, c)
137
+ cc[:children].each do |child|
138
+ cn = child[:name]
139
+ cl = child[:level]
140
+ if cl >= lv
141
+ reset(cn)
142
+ end
143
+ end
144
+ if args[:to_s]
145
+ return value_to_string(get(name))
146
+ else
147
+ return self
148
+ end
149
+ else
150
+ Deplate::Core.log(['Unknown counter', name], :error)
151
+ return nil
152
+ end
153
+ end
154
+
155
+ def get_s(name, args={})
156
+ c = get(name)
157
+ value_to_string(c, args)
158
+ end
159
+
160
+ def is_hierarchical?(name)
161
+ c = get(name)
162
+ c.kind_of?(Array)
163
+ end
164
+
165
+ def value_to_string(value, args={})
166
+ delta = (args['delta'] || '').split(/[ .,;]/)
167
+ if value.empty?
168
+ delta.join('.')
169
+ else
170
+ value = value.dup
171
+ depth = args['depth'].to_i - 1
172
+ if depth >= 0
173
+ value = value[0..depth]
174
+ end
175
+ delta.each_with_index do |d,i|
176
+ value[i] = (value[i] || 0) + d.to_i
177
+ end
178
+ value.join('.')
179
+ end
180
+ end
181
+ end
182
+
183
+
184
+ class Deplate::Listings
185
+ def initialize(deplate)
186
+ @deplate = deplate
187
+ @listings = {}
188
+ end
189
+
190
+ def def_listing(name, init=nil, props=nil)
191
+ init ||= []
192
+ props ||= {}
193
+ @listings[name] = {
194
+ :value => init,
195
+ :init => init,
196
+ :props => props,
197
+ }
198
+ end
199
+
200
+ def is_defined?(name)
201
+ @listings.keys.include?(name)
202
+ end
203
+
204
+ def each
205
+ @listings.each do |key, val|
206
+ yield(key, val)
207
+ end
208
+ end
209
+
210
+ def get(name, compound=false)
211
+ c = @listings[name]
212
+ if c
213
+ if compound
214
+ c
215
+ else
216
+ c[:value]
217
+ end
218
+ else
219
+ Deplate::Core.log(['Unknown list', name], :error)
220
+ nil
221
+ end
222
+ end
223
+
224
+ def get_prop(name, prop)
225
+ c = @listings[name]
226
+ if c
227
+ c[:props][prop]
228
+ else
229
+ Deplate::Core.log(['Unknown list', name], :error)
230
+ nil
231
+ end
232
+ end
233
+
234
+ def push(name, value)
235
+ c = get(name)
236
+ if c
237
+ c << value
238
+ end
239
+ end
240
+
241
+ def reset(name=nil)
242
+ if name
243
+ c = get(name, true)
244
+ if c
245
+ set(name, c[:init])
246
+ end
247
+ else
248
+ for name in @listings.keys
249
+ reset(name)
250
+ end
251
+ end
252
+ end
253
+ end
254
+
@@ -1,8 +1,8 @@
1
1
  /* Layout and decoration */
2
2
  /* @Author: Thomas Link (samul AT web.de) */
3
3
  /* @Created: 13-Apr-2004. */
4
- /* @Last Change: 09-Aug-2005. */
5
- /* @Revision: 0.787 */
4
+ /* @Last Change: 06-Apr-2006. */
5
+ /* @Revision: 0.788 */
6
6
 
7
7
  @page {
8
8
  size:portrait;
@@ -257,7 +257,8 @@ ul.toc, li.toc {
257
257
  ul.toc {
258
258
  }
259
259
  a.toc:after {
260
- content: leader('.') target-counter(attr(href), page);
260
+ /* content: leader('.') target-counter(attr(href), page); */
261
+ content: target-counter(attr(href), page);
261
262
  }
262
263
  li.toc {
263
264
  padding: 0;
@@ -1,8 +1,8 @@
1
1
  /* Layout and decoration */
2
2
  /* @Author: Thomas Link (samul AT web.de) */
3
3
  /* @Created: 13-Apr-2004. */
4
- /* @Last Change: 19-Okt-2005. */
5
- /* @Revision: 0.1119 */
4
+ /* @Last Change: 30-Apr-2006. */
5
+ /* @Revision: 0.1197 */
6
6
 
7
7
  body {
8
8
  padding: 1px;
@@ -45,6 +45,7 @@ hr.pagebreak {
45
45
  }
46
46
 
47
47
  img {
48
+ border: 0;
48
49
  }
49
50
  img.latex {
50
51
  vertical-align: middle;
@@ -122,6 +123,51 @@ li {
122
123
  padding: 2px;
123
124
  margin-right: 20px;
124
125
  }
126
+ ul.Task {
127
+ list-style-type: none;
128
+ }
129
+ li[class|=Task] {
130
+ }
131
+ li.Task-A {
132
+ }
133
+ li.Task-B {
134
+ }
135
+ li.Task-C {
136
+ }
137
+ li.Task-D {
138
+ }
139
+ li.Task-E {
140
+ }
141
+ li.Task-F {
142
+ }
143
+ li.done[class^=Task] {
144
+ color: #606060;
145
+ text-decoration: line-through;
146
+ }
147
+ span[class|=Task] {
148
+ font-weight: bold;
149
+ padding: 0 5px 0 5px;
150
+ position: relative;
151
+ right: 10px;
152
+ }
153
+ span.Task-A {
154
+ background-color: #ff7f7f;
155
+ }
156
+ span.Task-B {
157
+ background-color: #7fff7f;
158
+ }
159
+ span.Task-C {
160
+ background-color: #7f7fff;
161
+ }
162
+ span.Task-D {
163
+ background-color: #7fffff;
164
+ }
165
+ span.Task-E {
166
+ background-color: #ff7fff;
167
+ }
168
+ span.Task-F {
169
+ background-color: #ffff7f;
170
+ }
125
171
  br.itempara {
126
172
  }
127
173
  p.itempara {
@@ -457,6 +503,14 @@ hr.list {
457
503
  margin: 0 45% 0 45%;
458
504
  }
459
505
 
506
+ div#List_of_Examples * li {
507
+ list-style-type : none;
508
+ padding: 1px;
509
+ }
510
+ p.example {
511
+ margin-top: 10px;
512
+ font-weight: bold;
513
+ }
460
514
 
461
515
  /* Mini Table of Contents */
462
516
  #Contents {
@@ -524,10 +578,16 @@ li.footnotes {
524
578
  background-color: #e4f8fc;
525
579
  vertical-align: top;
526
580
  color: #30306f;
581
+ margin-right: 4px;
527
582
  }
528
- p.sdfootnote {
529
- margin-left: 5%;
530
- margin-right: 5%;
583
+
584
+ .sdfootnote {
585
+ /* margin-left: 5%; */
586
+ /* margin-right: 5%; */
587
+ padding-top: 0;
588
+ padding-bottom: 0;
589
+ margin-bottom: 2px;
590
+ margin-top: 2px;
531
591
  }
532
592
 
533
593
 
@@ -697,3 +757,59 @@ li.todo[class~="dash"]:before {
697
757
  iframe {
698
758
  border: 0;
699
759
  }
760
+
761
+ .bold {
762
+ font-weight: bold;
763
+ font-style: normal;
764
+ }
765
+
766
+
767
+ div.comment {
768
+ margin: 40px 80px 10px 80px;
769
+ font-size: 80%;
770
+ line-height: 135%;
771
+ }
772
+ span.comment_author {
773
+ font-weight: bold;
774
+ }
775
+ span.comment_author:after {
776
+ content: ": ";
777
+ }
778
+ span.comment_subject {
779
+ font-weight: bold;
780
+ }
781
+ span.comment_date {
782
+ font-style: italic;
783
+ font-size: 70%;
784
+ }
785
+ div.comment_title {
786
+ }
787
+ div.comment_text {
788
+ margin: 0 0 0 20px;
789
+ }
790
+ div.comment_form {
791
+ margin: 40px 80px 5px 80px;
792
+ }
793
+ table.comment_form {
794
+ border: 0;
795
+ }
796
+ tr.comment_form {
797
+ border: 0;
798
+ }
799
+ td.comment_form {
800
+ border: 0;
801
+ vertical-align: top;
802
+ font-size: 80%;
803
+ line-height: 135%;
804
+ }
805
+
806
+ input, textarea {
807
+ border: 1px solid #2f2f5f;
808
+ font-size: 90%;
809
+ line-height: 135%;
810
+ }
811
+ button {
812
+ font-size: 90%;
813
+ line-height: 135%;
814
+ }
815
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes