deplate 0.7.3 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS.TXT +3 -0
- data/CHANGES.TXT +248 -175
- data/LICENSE.TXT +0 -0
- data/NEWS.TXT +28 -24
- data/README.TXT +0 -0
- data/TODO.TXT +174 -88
- data/VERSION.TXT +1 -1
- data/bin/deplate +0 -0
- data/bin/deplate.bat +0 -0
- data/etc/deplate.ini +91 -3
- data/lib/action_view/helpers/deplate.rb +45 -0
- data/lib/deplate.rb +6 -1
- data/lib/deplate/abstract-class.rb +0 -0
- data/lib/deplate/bib.rb +576 -0
- data/lib/deplate/builtin.rb +0 -0
- data/lib/deplate/cache.rb +55 -5
- data/lib/deplate/commands.rb +346 -183
- data/lib/deplate/common.rb +209 -48
- data/lib/deplate/converter.rb +12 -6
- data/lib/deplate/core.rb +777 -378
- data/lib/deplate/counters.rb +254 -0
- data/lib/deplate/css/article.css +4 -3
- data/lib/deplate/css/deplate.css +121 -5
- data/lib/deplate/css/heading-navbar.css +0 -0
- data/lib/deplate/css/layout-deplate-print.css +0 -0
- data/lib/deplate/css/layout-deplate.css +0 -0
- data/lib/deplate/css/sans-serif.css +0 -0
- data/lib/deplate/css/serif-e.css +0 -0
- data/lib/deplate/css/serif-rel.css +0 -0
- data/lib/deplate/css/serif.css +9 -3
- data/lib/deplate/css/slides.css +0 -0
- data/lib/deplate/css/tabbar-left.css +0 -0
- data/lib/deplate/css/tabbar-right-ie.css +3 -9
- data/lib/deplate/css/tabbar-right.css +51 -18
- data/lib/deplate/css/tabbar-top.css +7 -1
- data/lib/deplate/css/tabbar.css +0 -0
- data/lib/deplate/css/text-sans-serif.css +0 -0
- data/lib/deplate/css/text-serif.css +0 -0
- data/lib/deplate/define.rb +183 -177
- data/lib/deplate/deplate-string.rb +82 -0
- data/lib/deplate/docbook.rb +236 -128
- data/lib/deplate/elements.rb +584 -417
- data/lib/deplate/etc.rb +163 -101
- data/lib/deplate/external.rb +42 -11
- data/lib/deplate/fmt/dbk-article-4.1.2.rb +0 -0
- data/lib/deplate/fmt/dbk-article.rb +0 -0
- data/lib/deplate/fmt/dbk-book.rb +0 -0
- data/lib/deplate/fmt/dbk-ref.rb +3 -3
- data/lib/deplate/fmt/dbk-slides.rb +0 -0
- data/lib/deplate/fmt/dbk-snippet.rb +0 -0
- data/lib/deplate/fmt/html-snippet.rb +0 -0
- data/lib/deplate/fmt/html.rb +783 -550
- data/lib/deplate/fmt/htmlsite.rb +192 -199
- data/lib/deplate/fmt/htmlslides.rb +0 -0
- data/lib/deplate/fmt/htmlwebsite.rb +3 -3
- data/lib/deplate/fmt/latex-snippet.rb +0 -0
- data/lib/deplate/fmt/latex.rb +242 -83
- data/lib/deplate/fmt/null.rb +32 -0
- data/lib/deplate/fmt/php.rb +4 -4
- data/lib/deplate/fmt/phpsite.rb +6 -5
- data/lib/deplate/fmt/plain.rb +160 -106
- data/lib/deplate/fmt/template.rb +0 -0
- data/lib/deplate/fmt/xhtml10t.rb +0 -0
- data/lib/deplate/formatter-snippet.rb +0 -0
- data/lib/deplate/formatter.rb +613 -301
- data/lib/deplate/input.rb +202 -142
- data/lib/deplate/input/deplate-headings.rb +4 -6
- data/lib/deplate/input/deplate-restricted.rb +15 -9
- data/lib/deplate/input/deplate.rb +2 -4
- data/lib/deplate/input/rdoc.rb +39 -38
- data/lib/deplate/input/template.rb +0 -0
- data/lib/deplate/lib/Makefile.config +29 -0
- data/lib/deplate/lib/latex/deplate.sty +54 -0
- data/lib/deplate/lib/latex/highlight-extra.sty +0 -0
- data/lib/deplate/lib/latex/highlight-typical.sty +0 -0
- data/lib/deplate/lib/php/page-comment.inc.php +216 -0
- data/lib/deplate/lib/tabmenu.js +0 -0
- data/lib/deplate/locale/de.latin1 +155 -17
- data/lib/deplate/locale/ru.koi8-r +0 -0
- data/lib/deplate/locale/zh_cn.gb2312 +0 -0
- data/lib/deplate/macros.rb +133 -82
- data/lib/deplate/messages.rb +6 -4
- data/lib/deplate/metadata.rb +0 -0
- data/lib/deplate/metadata/marshal.rb +0 -0
- data/lib/deplate/metadata/xml.rb +0 -0
- data/lib/deplate/metadata/yaml.rb +0 -0
- data/lib/deplate/mod/anyword.rb +3 -3
- data/lib/deplate/mod/babelfish.rb +4 -4
- data/lib/deplate/mod/code-gvim.rb +8 -4
- data/lib/deplate/mod/code-highlight.rb +3 -3
- data/lib/deplate/mod/colored-log.rb +0 -0
- data/lib/deplate/mod/de.rb +2 -2
- data/lib/deplate/mod/en.rb +0 -0
- data/lib/deplate/mod/endnotes.rb +0 -0
- data/lib/deplate/mod/fr.rb +0 -0
- data/lib/deplate/mod/html-asciimath.rb +0 -0
- data/lib/deplate/mod/html-deplate-button.rb +0 -0
- data/lib/deplate/mod/html-headings-navbar.rb +5 -13
- data/lib/deplate/mod/html-jsmath.rb +39 -0
- data/lib/deplate/mod/html-obfuscate-email.rb +3 -3
- data/lib/deplate/mod/html-sidebar.rb +0 -0
- data/lib/deplate/mod/htmlslides-navbar-fh.rb +3 -3
- data/lib/deplate/mod/iconv.rb +0 -0
- data/lib/deplate/mod/imgurl.rb +4 -4
- data/lib/deplate/mod/inlatex-compound.rb +7 -10
- data/lib/deplate/mod/koma.rb +0 -0
- data/lib/deplate/mod/latex-emph-table-head.rb +0 -0
- data/lib/deplate/mod/latex-styles.rb +7 -4
- data/lib/deplate/mod/latex-verbatim-small.rb +0 -0
- data/lib/deplate/mod/makefile.rb +23 -7
- data/lib/deplate/mod/mark-external-urls.rb +3 -3
- data/lib/deplate/mod/markup-1-warn.rb +10 -10
- data/lib/deplate/mod/markup-1.rb +0 -0
- data/lib/deplate/mod/navbar-png.rb +24 -8
- data/lib/deplate/mod/noindent.rb +0 -0
- data/lib/deplate/mod/numpara.rb +0 -0
- data/lib/deplate/mod/particle-math.rb +4 -4
- data/lib/deplate/mod/php-extra.rb +46 -6
- data/lib/deplate/mod/pstoedit.rb +0 -0
- data/lib/deplate/mod/recode.rb +0 -0
- data/lib/deplate/mod/ru_koi8-r.rb +0 -0
- data/lib/deplate/mod/smart-dash.rb +26 -0
- data/lib/deplate/mod/smiley.rb +69 -7
- data/lib/deplate/mod/soffice.rb +0 -0
- data/lib/deplate/mod/symbols-latin1.rb +14 -23
- data/lib/deplate/mod/symbols-od-utf-8.rb +5 -3
- data/lib/deplate/mod/symbols-plain.rb +5 -35
- data/lib/deplate/mod/symbols-sgml.rb +8 -9
- data/lib/deplate/mod/symbols-utf-8.rb +8 -9
- data/lib/deplate/mod/symbols-xml.rb +5 -9
- data/lib/deplate/mod/syntax-region-alt.rb +5 -5
- data/lib/deplate/mod/utf8.rb +0 -0
- data/lib/deplate/mod/validate-html.rb +0 -0
- data/lib/deplate/mod/xmlrpc.rb +0 -0
- data/lib/deplate/mod/zh-cn-autospace.rb +18 -20
- data/lib/deplate/mod/zh-cn.rb +4 -6
- data/lib/deplate/nukumi2.rb +71 -0
- data/lib/deplate/once-method.rb +0 -0
- data/lib/deplate/output.rb +19 -21
- data/lib/deplate/particles.rb +178 -116
- data/lib/deplate/regions.rb +99 -58
- data/lib/deplate/skeletons.rb +122 -0
- data/lib/deplate/structured.rb +164 -106
- data/lib/deplate/template.rb +67 -43
- data/lib/deplate/templates/html-doc.html +0 -0
- data/lib/deplate/templates/html-left-tabbar-js.html +0 -0
- data/lib/deplate/templates/html-left-tabbar.html +0 -0
- data/lib/deplate/templates/html-tabbar-right-pcomments.php +22 -0
- data/lib/deplate/templates/html-tabbar-right-step.html +24 -0
- data/lib/deplate/templates/html-tabbar-right-table.html +0 -0
- data/lib/deplate/templates/html-tabbar-right.html +2 -4
- data/lib/deplate/templates/html-tabbar-top.html +0 -9
- data/lib/deplate/templates/html-tabbar.html +0 -0
- data/lib/deplate/variables.rb +127 -0
- data/lib/deplate/wiki-markup.rb +99 -33
- data/lib/deplate/xml.rb +18 -18
- data/lib/deplate/zh-cn.rb +0 -0
- data/lib/ps2ppm.rb +0 -0
- data/man/man1/deplate.1 +564 -474
- metadata +201 -186
@@ -3,8 +3,8 @@
|
|
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:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 20-Nov-2005.
|
7
|
+
# @Revision: 0.39
|
8
8
|
#
|
9
9
|
# = Description
|
10
10
|
# = Usage
|
@@ -31,16 +31,14 @@ class Deplate::Input::DeplateHeadings < Deplate::Input
|
|
31
31
|
end
|
32
32
|
|
33
33
|
class Deplate::Element::Swallowed < Deplate::Element::Paragraph
|
34
|
-
|
35
|
-
|
34
|
+
set_formatter :format_paragraph
|
35
|
+
set_rx(/^([ \t]*)(.*)[ \t]*$/)
|
36
36
|
def finish
|
37
37
|
nil
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
class Deplate::Core
|
42
|
-
# declare_input_format(Deplate::Input::DeplateHeadings)
|
43
|
-
|
44
42
|
def input_initialize_deplate
|
45
43
|
@options.input_class = Deplate::Input::DeplateHeadings
|
46
44
|
end
|
@@ -3,8 +3,8 @@
|
|
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:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 14-Apr-2006.
|
7
|
+
# @Revision: 0.42
|
8
8
|
#
|
9
9
|
# = Description
|
10
10
|
# = Usage
|
@@ -23,7 +23,8 @@ class Deplate::Input::DeplateRestricted < Deplate::Input
|
|
23
23
|
Deplate::Command::INC,
|
24
24
|
# Deplate::Command::IMG,
|
25
25
|
Deplate::Command::MODULE,
|
26
|
-
|
26
|
+
Deplate::Command::WITH,
|
27
|
+
Deplate::Command::ABBREV,
|
27
28
|
])
|
28
29
|
remove_named_elements(args, :regions, Deplate::Region.regions, [
|
29
30
|
Deplate::Regions::DefCommand,
|
@@ -32,12 +33,15 @@ class Deplate::Input::DeplateRestricted < Deplate::Input
|
|
32
33
|
Deplate::Regions::DefRegionN,
|
33
34
|
Deplate::Regions::DefMacro,
|
34
35
|
Deplate::Regions::DefMacroN,
|
35
|
-
|
36
|
+
Deplate::Regions::Native,
|
37
|
+
Deplate::Regions::Img,
|
38
|
+
Deplate::Regions::R,
|
39
|
+
Deplate::Regions::Ruby,
|
36
40
|
])
|
37
41
|
remove_named_elements(args, :macros, Deplate::Macro.macros, [
|
38
42
|
Deplate::Macro::Insert,
|
39
|
-
Deplate::Macro::Latex,
|
40
|
-
Deplate::Macro::Math,
|
43
|
+
# Deplate::Macro::Latex,
|
44
|
+
# Deplate::Macro::Math,
|
41
45
|
Deplate::Macro::Ruby,
|
42
46
|
])
|
43
47
|
# remove_named_elements(args, :particles, Deplate::Particle.particles, [])
|
@@ -54,15 +58,17 @@ class Deplate::Input::DeplateRestricted < Deplate::Input
|
|
54
58
|
arr.delete(e)
|
55
59
|
else
|
56
60
|
i = arr.index(e)
|
57
|
-
arr.delete(
|
61
|
+
arr.delete(i) if i
|
58
62
|
end
|
59
63
|
end
|
60
64
|
end
|
65
|
+
|
66
|
+
def allow_set_variable(var)
|
67
|
+
var && var[0..0] == '_'
|
68
|
+
end
|
61
69
|
end
|
62
70
|
|
63
71
|
class Deplate::Core
|
64
|
-
# declare_input_format(Deplate::Input::DeplateRestricted)
|
65
|
-
|
66
72
|
def input_initialize_deplate
|
67
73
|
@options.input_class = Deplate::Input::DeplateRestricted
|
68
74
|
end
|
@@ -3,8 +3,8 @@
|
|
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:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 20-Nov-2005.
|
7
|
+
# @Revision: 0.16
|
8
8
|
#
|
9
9
|
# = Description
|
10
10
|
# = Usage
|
@@ -19,8 +19,6 @@ class Deplate::Input::VikiDeplate < Deplate::Input
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class Deplate::Core
|
22
|
-
# declare_input_format(Deplate::Input::VikiDeplate)
|
23
|
-
|
24
22
|
def input_initialize_deplate
|
25
23
|
@options.input_class = Deplate::Input
|
26
24
|
end
|
data/lib/deplate/input/rdoc.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
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:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 06-Jan-2006.
|
7
|
+
# @Revision: 0.274
|
8
8
|
#
|
9
9
|
# = Description
|
10
10
|
# Based upon Programming Ruby 2, 190ff
|
@@ -21,8 +21,8 @@ class Deplate::Input::Rdoc < Deplate::Input
|
|
21
21
|
args[:elements] ||= [
|
22
22
|
Deplate::Input::Rdoc::Directive,
|
23
23
|
Deplate::Input::Wiki::HeadingPrefixEqual,
|
24
|
-
Deplate::Input::Wiki::
|
25
|
-
Deplate::Input::Wiki::
|
24
|
+
Deplate::Input::Wiki::OrderedNotIndented,
|
25
|
+
Deplate::Input::Wiki::OrderedSharpNotIndented,
|
26
26
|
Deplate::Input::Wiki::ItemizeNotIndented,
|
27
27
|
Deplate::Input::Rdoc::Description4,
|
28
28
|
Deplate::Input::Rdoc::Description3,
|
@@ -36,7 +36,7 @@ class Deplate::Input::Rdoc < Deplate::Input
|
|
36
36
|
Deplate::Particle::Escaped,
|
37
37
|
Deplate::Input::Rdoc::LabelledLink2,
|
38
38
|
Deplate::Input::Rdoc::LabelledLink,
|
39
|
-
Deplate::Input::
|
39
|
+
Deplate::Input::Wiki::ImgUrl,
|
40
40
|
Deplate::Input::Rdoc::Link,
|
41
41
|
Deplate::HyperLink::Url,
|
42
42
|
Deplate::Input::Wiki::ItalicWordSingleUnderscore,
|
@@ -65,7 +65,7 @@ class Deplate::Input::Rdoc < Deplate::Input
|
|
65
65
|
end
|
66
66
|
|
67
67
|
class Deplate::Input::Rdoc::ParagraphOrVerbatim < Deplate::Input::Wiki::ParagraphIndentedVerbatim
|
68
|
-
|
68
|
+
set_rx Deplate::Input::Wiki::ParagraphIndentedVerbatim.rx
|
69
69
|
def setup
|
70
70
|
super
|
71
71
|
@args['wrap'] ||= @deplate.variables['verbatimMargin'] || '72'
|
@@ -73,32 +73,37 @@ class Deplate::Input::Rdoc::ParagraphOrVerbatim < Deplate::Input::Wiki::Paragrap
|
|
73
73
|
end
|
74
74
|
|
75
75
|
class Deplate::Input::Rdoc::Italic2 < Deplate::Particle::Emphasize
|
76
|
-
|
76
|
+
set_rx(/^<em>(.+?)<\/em>/)
|
77
77
|
end
|
78
78
|
|
79
79
|
class Deplate::Input::Rdoc::Italic3 < Deplate::Particle::Emphasize
|
80
|
-
|
80
|
+
set_rx(/^<i>(.+?)<\/i>/)
|
81
81
|
end
|
82
82
|
|
83
83
|
class Deplate::Input::Rdoc::Bold2 < Deplate::Particle::Emphasize
|
84
|
-
|
84
|
+
set_rx(/^<b>(.+?)<\/b>/)
|
85
|
+
def setup
|
86
|
+
@args['style'] = 'bold'
|
87
|
+
update_styles
|
88
|
+
super
|
89
|
+
end
|
85
90
|
end
|
86
91
|
|
87
92
|
class Deplate::Input::Rdoc::Typewriter2 < Deplate::Particle::Code
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
class Deplate::Input::Rdoc::ImgUrl < Deplate::Input::Wiki::AbstractImgUrl
|
92
|
-
@rx = /^((file|https?|mailto|ftps?|www):(\S+?)\.(png|jpg|jpeg|gif|bmp))/
|
93
|
+
set_rx(/^<tt>(.+?)<\/tt>/)
|
93
94
|
end
|
94
95
|
|
95
96
|
class Deplate::Input::Rdoc::Link < Deplate::HyperLink::Extended
|
96
|
-
|
97
|
+
set_rx(/^link:([^+*&<>,.\t :!?#]+(\.\w+)?)(#([^+*?&<>\\\/,.:!?]+?))?/)
|
97
98
|
|
98
99
|
def get_destination
|
99
100
|
@match[1]
|
100
101
|
end
|
101
102
|
|
103
|
+
def get_interwiki
|
104
|
+
nil
|
105
|
+
end
|
106
|
+
|
102
107
|
def get_anchor
|
103
108
|
@match[4]
|
104
109
|
end
|
@@ -113,12 +118,16 @@ class Deplate::Input::Rdoc::Link < Deplate::HyperLink::Extended
|
|
113
118
|
end
|
114
119
|
|
115
120
|
class Deplate::Input::Rdoc::LabelledLink < Deplate::HyperLink::Extended
|
116
|
-
|
121
|
+
set_rx(/^(\S+)\[((file|https?|mailto|ftps?|www):.*?)(#(.+))?\]/)
|
117
122
|
|
118
123
|
def get_destination
|
119
124
|
@match[2]
|
120
125
|
end
|
121
126
|
|
127
|
+
def get_interwiki
|
128
|
+
nil
|
129
|
+
end
|
130
|
+
|
122
131
|
def get_anchor
|
123
132
|
@match[5]
|
124
133
|
end
|
@@ -133,12 +142,16 @@ class Deplate::Input::Rdoc::LabelledLink < Deplate::HyperLink::Extended
|
|
133
142
|
end
|
134
143
|
|
135
144
|
class Deplate::Input::Rdoc::LabelledLink2 < Deplate::HyperLink::Extended
|
136
|
-
|
145
|
+
set_rx(/^\{(.+?)\}\[((file|https?|mailto|ftps?|www):.*?)(#(.+))?\]/)
|
137
146
|
|
138
147
|
def get_destination
|
139
148
|
@match[2]
|
140
149
|
end
|
141
150
|
|
151
|
+
def get_interwiki
|
152
|
+
nil
|
153
|
+
end
|
154
|
+
|
142
155
|
def get_anchor
|
143
156
|
@match[5]
|
144
157
|
end
|
@@ -152,39 +165,29 @@ class Deplate::Input::Rdoc::LabelledLink2 < Deplate::HyperLink::Extended
|
|
152
165
|
end
|
153
166
|
end
|
154
167
|
|
155
|
-
class Deplate::Input::Wiki::
|
168
|
+
class Deplate::Input::Wiki::OrderedSharpNotIndented < Deplate::List::Ordered
|
156
169
|
include Deplate::Input::Wiki::ListExtra
|
157
|
-
|
158
|
-
@name = "Numbered"
|
159
|
-
@rx = /^(()(#)[ \t]+)(.+)$/
|
170
|
+
set_rx(/^(()(#)[ \t]+)(.+)$/)
|
160
171
|
end
|
161
172
|
|
162
173
|
class Deplate::Input::Rdoc::Description1 < Deplate::Input::Wiki::AbstractDescription
|
163
|
-
|
164
|
-
@formatter = :format_list
|
165
|
-
@name = "Description"
|
174
|
+
set_rx(/^(()(\S.*?)\b::[ \t]+)(.*)$/)
|
166
175
|
end
|
167
176
|
|
168
177
|
class Deplate::Input::Rdoc::Description2 < Deplate::Input::Wiki::AbstractDescription
|
169
|
-
|
170
|
-
@formatter = :format_list
|
171
|
-
@name = "Description"
|
178
|
+
set_rx(/^(()\+(.*?)\+::[ \t]+)(.*)$/)
|
172
179
|
end
|
173
180
|
|
174
181
|
class Deplate::Input::Rdoc::Description3 < Deplate::Input::Wiki::AbstractDescription
|
175
|
-
|
176
|
-
@formatter = :format_list
|
177
|
-
@name = "Description"
|
182
|
+
set_rx(/^(()\[(.+?)\][ \t]+)(.*)$/)
|
178
183
|
end
|
179
184
|
|
180
185
|
class Deplate::Input::Rdoc::Description4 < Deplate::Input::Wiki::AbstractDescription
|
181
|
-
|
182
|
-
@formatter = :format_list
|
183
|
-
@name = "Description"
|
186
|
+
set_rx(/^(()\[\+(.+?)\+\][ \t]+)(.*)$/)
|
184
187
|
end
|
185
188
|
|
186
189
|
class Deplate::Input::Rdoc::NoProcess < Deplate::Element
|
187
|
-
|
190
|
+
set_rx(/^(\s*)#--/)
|
188
191
|
|
189
192
|
def setup
|
190
193
|
@endRx = /^(\s*)#\+\+/
|
@@ -195,11 +198,11 @@ class Deplate::Input::Rdoc::NoProcess < Deplate::Element
|
|
195
198
|
end
|
196
199
|
|
197
200
|
class Deplate::Input::Rdoc::Directive < Deplate::Element::Command
|
198
|
-
|
201
|
+
set_rx(/^\s*:(call-seq|include|title|main|stopdoc|startdoc|enddoc|maketitle|author):\s*(.*?)\s*$/)
|
199
202
|
@enddoc = false
|
200
203
|
|
201
204
|
class << self
|
202
|
-
def is_volatile?(match)
|
205
|
+
def is_volatile?(match, input)
|
203
206
|
case match[1]
|
204
207
|
when "title"
|
205
208
|
true
|
@@ -265,8 +268,6 @@ end
|
|
265
268
|
# :main: name
|
266
269
|
|
267
270
|
class Deplate::Core
|
268
|
-
# declare_input_format(Deplate::Input::Rdoc)
|
269
|
-
|
270
271
|
def input_initialize_rdoc
|
271
272
|
unless @variables['inputFormat']
|
272
273
|
@options.input_class = Deplate::Input::Rdoc
|
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
BASE={arg: base0}
|
2
|
+
FILE={arg: base}
|
3
|
+
OTHER={arg: files}
|
4
|
+
|
5
|
+
DEPLATE=deplate
|
6
|
+
|
7
|
+
DFLAGS={arg: options}
|
8
|
+
|
9
|
+
HTML_DIR=html
|
10
|
+
HTML_DFLAGS=-d $\{HTML_DIR\} -f html
|
11
|
+
|
12
|
+
WEBSITE_DIR=website
|
13
|
+
WEBSITE_DFLAGS=-d $\{WEBSITE_DIR\} -f htmlsite
|
14
|
+
|
15
|
+
PHP_DIR=php
|
16
|
+
PHP_DFLAGS=-d $\{PHP_DIR\} -f phpsite
|
17
|
+
|
18
|
+
TEX_DIR=tex
|
19
|
+
TEX_DFLAGS=-d $\{TEX_DIR\} -f latex
|
20
|
+
|
21
|
+
TEXT_DIR=plain
|
22
|
+
TEXT_DFLAGS=-d $\{TEXT_DIR\} -f plain
|
23
|
+
|
24
|
+
DBK_DIR=docbook
|
25
|
+
DBK_DFLAGS=-d $\{DBK_DIR\} -f dbk-article
|
26
|
+
|
27
|
+
REF_DIR=$\{DBK_DIR\}
|
28
|
+
REF_DFLAGS=-d $\{REF_DIR\} -f dbk-ref
|
29
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
% Custom lists
|
2
|
+
\\newcommand{\\customListPrefs}{\\setlength{\\parsep}{0cm}\\setlength{\\itemsep}{0cm}}
|
3
|
+
\\newenvironment{customList}{\\begin{list}{}{\\customListPrefs{}}}{\\end{list}}
|
4
|
+
\\newcommand{\\customItem}[2]{\\item[#1] #2}
|
5
|
+
|
6
|
+
% Task lists
|
7
|
+
\\newenvironment{tasklist}{\\begin{list}{}{\\customListPrefs{}}}{\\end{list}}
|
8
|
+
\\newcommand{\\task}[2]{\\item[\\textbf{#1}] #2}
|
9
|
+
|
10
|
+
% \\usepackage{color}
|
11
|
+
\\definecolor{taskA}{rgb}{1,.5,.5}
|
12
|
+
\\definecolor{taskB}{rgb}{.5,1,.5}
|
13
|
+
\\definecolor{taskC}{rgb}{.5,.5,1}
|
14
|
+
\\definecolor{taskD}{rgb}{.5,1,1}
|
15
|
+
\\definecolor{taskE}{rgb}{1,.5,1}
|
16
|
+
\\definecolor{taskF}{rgb}{1,1,.5}
|
17
|
+
\\definecolor{taskdone}{rgb}{.5,.5,.5}
|
18
|
+
|
19
|
+
\\newcommand{\\taskdone}[1]{{\\footnotesize\\textcolor{taskdone}{#1}}}
|
20
|
+
% \\newcommand{\\taskdone}[1]{\\sout{\\textcolor{taskdone}{#1}}}
|
21
|
+
\\newcommand{\\taskA}[1]{\\colorbox{taskA}{#1}}
|
22
|
+
\\newcommand{\\taskB}[1]{\\colorbox{taskB}{#1}}
|
23
|
+
\\newcommand{\\taskC}[1]{\\colorbox{taskC}{#1}}
|
24
|
+
\\newcommand{\\taskD}[1]{\\colorbox{taskD}{#1}}
|
25
|
+
\\newcommand{\\taskE}[1]{\\colorbox{taskE}{#1}}
|
26
|
+
\\newcommand{\\taskF}[1]{\\colorbox{taskF}{#1}}
|
27
|
+
|
28
|
+
% Text styles
|
29
|
+
\\newcommand{\\emphStyle}{\\em}
|
30
|
+
\\newcommand{\\emphSpan}[1]{\\emph{#1}}
|
31
|
+
\\newcommand{\\boldSpan}[1]{\\textbf{#1}}
|
32
|
+
\\newcommand{\\remoteSpan}[1]{#1}
|
33
|
+
|
34
|
+
\\newenvironment{overlayBlock}{}{}
|
35
|
+
\\newenvironment{scriptsizeBlock}{\\scriptsize{}}{}
|
36
|
+
\\newenvironment{boxBlock}{}{}
|
37
|
+
\\newenvironment{footnotesizeBlock}{\\footnotesize{}}{}
|
38
|
+
\\newenvironment{smallBlock}{\\small{}}{}
|
39
|
+
\\newenvironment{landscapeBlock}{}{}
|
40
|
+
\\newenvironment{gridBlock}{}{}
|
41
|
+
\\newenvironment{formalBlock}{}{}
|
42
|
+
|
43
|
+
|
44
|
+
% From the Deplate manual
|
45
|
+
\\newenvironment{todoBlock}{}{}
|
46
|
+
|
47
|
+
\\newenvironment{bookBlock}{}{}
|
48
|
+
\\newenvironment{booksList}{\\begin{list}{}{\\customListPrefs{}}}{\\end{list}}
|
49
|
+
\\newcommand{\\booksItem}[2]{\\item[\\textbf{#1}] #2}
|
50
|
+
|
51
|
+
\\newenvironment{exampleBlock}{\\bfseries{}}{}
|
52
|
+
\\newenvironment{examplesList}{\\begin{list}{}{\\customListPrefs{}}}{\\end{list}}
|
53
|
+
\\newcommand{\\examplesItem}[2]{\\item[#1] #2}
|
54
|
+
|
File without changes
|
File without changes
|
@@ -0,0 +1,216 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* page-comments.inc.php
|
4
|
+
* @author Thomas Link (samul AT web de)
|
5
|
+
* @license GPL (see http://www.gnu.org/licenses/gpl.txt)
|
6
|
+
* @created 21-Apr-2006.
|
7
|
+
* @date 07-Mai-2006.
|
8
|
+
* @version 0.99
|
9
|
+
*
|
10
|
+
* TODO:
|
11
|
+
* - MySQL backend
|
12
|
+
* - Login
|
13
|
+
* - User interface (edit own messages)
|
14
|
+
* - Admin interface (delete, edit messages)
|
15
|
+
*/
|
16
|
+
|
17
|
+
|
18
|
+
@include('page-comment.cfg.php');
|
19
|
+
|
20
|
+
if (!defined(PAGE_COMMENT_BACKEND))
|
21
|
+
define('PAGE_COMMENT_BACKEND', '{arg default=file: commentBackend}');
|
22
|
+
|
23
|
+
#IF: commentBackend==mysql
|
24
|
+
if (!defined(PAGE_COMMENT_MYSQL_HOST))
|
25
|
+
define('PAGE_COMMENT_MYSQL_HOST', '{arg default=localhost: commentDbHost}');
|
26
|
+
|
27
|
+
if (!defined(PAGE_COMMENT_MYSQL_USER))
|
28
|
+
define('PAGE_COMMENT_MYSQL_USER', '{arg default=user: commentDbUser}');
|
29
|
+
|
30
|
+
if (!defined(PAGE_COMMENT_MYSQL_PW))
|
31
|
+
define('PAGE_COMMENT_MYSQL_PW', '{arg: commentDbPassword}');
|
32
|
+
|
33
|
+
function page_comment_commit_mysql($page, $def) {
|
34
|
+
// <+TBD+>
|
35
|
+
}
|
36
|
+
|
37
|
+
function page_comment_retrieve_mysql($page) {
|
38
|
+
// <+TBD+>
|
39
|
+
}
|
40
|
+
|
41
|
+
#ELSE
|
42
|
+
if (!defined(PAGE_COMMENT_FDIR))
|
43
|
+
define('PAGE_COMMENT_FDIR', '{arg default=%s__comments: commentFdir}');
|
44
|
+
|
45
|
+
function page_comment_commit_file($page, $def) {
|
46
|
+
$def = serialize($def);
|
47
|
+
$mid = page_comment_msg_id();
|
48
|
+
$pdir = sprintf(PAGE_COMMENT_FDIR, $page);
|
49
|
+
$fn = "$pdir/$mid";
|
50
|
+
if (!is_file($fn)) {
|
51
|
+
if (!is_dir($pdir))
|
52
|
+
mkdir($pdir);
|
53
|
+
$h = fopen($fn, 'w');
|
54
|
+
if ($h) {
|
55
|
+
fwrite($h, $def);
|
56
|
+
fclose($h);
|
57
|
+
return $mid;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return null;
|
61
|
+
}
|
62
|
+
|
63
|
+
function page_comment_retrieve_file($page) {
|
64
|
+
$pdir = sprintf(PAGE_COMMENT_FDIR, $page);
|
65
|
+
if (is_dir($pdir)) {
|
66
|
+
$h = opendir($pdir);
|
67
|
+
while ($file = readdir($h)) {
|
68
|
+
if ($file != '.' && $file != '..') {
|
69
|
+
$def = file_get_contents("$pdir/$file");
|
70
|
+
$def = unserialize($def);
|
71
|
+
$idx = $def['date'];
|
72
|
+
$comments[$idx] = $def;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
closedir($h);
|
76
|
+
|
77
|
+
ksort($comments);
|
78
|
+
return $comments;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
#ENDIF
|
83
|
+
|
84
|
+
|
85
|
+
function page_comment_form($page) {
|
86
|
+
?>
|
87
|
+
<div class="comment_form">
|
88
|
+
<form action="" name="comment" method="post">
|
89
|
+
<input type="hidden" name="page" value="<?php echo page_comment_id($page);?>">
|
90
|
+
<table class="comment_form">
|
91
|
+
<tr class="comment_form">
|
92
|
+
<td class="comment_form">{msg: Name}:</td>
|
93
|
+
<td class="comment_form"><input type="text" name="name" value="" size="50" maxlength="50" /></td>
|
94
|
+
</tr>
|
95
|
+
<tr class="comment_form">
|
96
|
+
<td class="comment_form">{msg: E-Mail}:</td>
|
97
|
+
<td class="comment_form"><input type="text" name="email" value="" size="50" maxlength="50" /></td>
|
98
|
+
</tr>
|
99
|
+
<tr class="comment_form">
|
100
|
+
<td class="comment_form">{msg: Subject}:</td>
|
101
|
+
<td class="comment_form"><input type="text" name="subject" value="" size="50" maxlength="30" /></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<td class="comment_form">{msg: Comment}:</td>
|
105
|
+
<td class="comment_form"><textarea name="text" cols="70" rows="8"></textarea></td>
|
106
|
+
</tr>
|
107
|
+
<tr class="comment_form">
|
108
|
+
<td class="comment_form"> </td>
|
109
|
+
<td class="comment_form">
|
110
|
+
<button name="submit" value="<?php echo $page;?>" type="submit">{msg: Submit}</button>
|
111
|
+
<button name="reset" type="reset">{msg: Cancel}</button>
|
112
|
+
</td>
|
113
|
+
</tr>
|
114
|
+
</table>
|
115
|
+
</form>
|
116
|
+
</div>
|
117
|
+
<?php
|
118
|
+
}
|
119
|
+
|
120
|
+
function page_comment_view($def) {
|
121
|
+
$name = htmlentities($def['name']);
|
122
|
+
$email = htmlentities($def['email']);
|
123
|
+
$subj = htmlentities($def['subject']);
|
124
|
+
$date = $def['date'];
|
125
|
+
$text = str_replace("\\n", "<br/>\\n", htmlentities($def['text']));
|
126
|
+
echo <<<EOT
|
127
|
+
<div class="comment">
|
128
|
+
<div class="comment_title">
|
129
|
+
<span class="comment_author">$name</span>
|
130
|
+
<span class="comment_subject">$subj</span>
|
131
|
+
EOT;
|
132
|
+
if ($date) {
|
133
|
+
// $date = strftime('%x %X', $date);
|
134
|
+
$date = strftime('%d. %B %y, %X', $date);
|
135
|
+
echo <<<EOT
|
136
|
+
<br/><span class="comment_date">$date</span>
|
137
|
+
EOT;
|
138
|
+
}
|
139
|
+
echo <<<EOT
|
140
|
+
</div>
|
141
|
+
<div class="comment_text">
|
142
|
+
$text
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
EOT;
|
146
|
+
}
|
147
|
+
|
148
|
+
function page_comment_list($page) {
|
149
|
+
$fn = 'page_comment_retrieve_'. PAGE_COMMENT_BACKEND;
|
150
|
+
$comments = $fn($page);
|
151
|
+
if ($comments) {
|
152
|
+
foreach($comments as $def) {
|
153
|
+
page_comment_view($def);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Get the message ID
|
160
|
+
*/
|
161
|
+
function page_comment_msg_id() {
|
162
|
+
global $r_name, $r_email, $r_submit, $r_text, $r_subject;
|
163
|
+
return md5("$r_name\\n$r_email\\n$r_subject\\n$r_text");
|
164
|
+
}
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Get an ID for a page name
|
168
|
+
*/
|
169
|
+
function page_comment_id($page) {
|
170
|
+
// <+TBD+> encrypt/hash: date + salt + page name
|
171
|
+
return $page;
|
172
|
+
}
|
173
|
+
|
174
|
+
/**
|
175
|
+
* List comments and view an entry form.
|
176
|
+
*/
|
177
|
+
function page_comment($page) {
|
178
|
+
#IF: commentLocale
|
179
|
+
setlocale(LC_ALL, "{arg: commentLocale}");
|
180
|
+
#ENDIF
|
181
|
+
import_request_variables('p', 'r_');
|
182
|
+
global $r_name, $r_email, $r_submit, $r_text, $r_subject;
|
183
|
+
|
184
|
+
// if ($r_submit === $page and $r_text) {
|
185
|
+
if ($r_submit and $page === page_comment_id($page) and $r_text) {
|
186
|
+
if (!$r_name)
|
187
|
+
$r_name = "{msg: Anonymous}";
|
188
|
+
$def = array(
|
189
|
+
'name' => $r_name,
|
190
|
+
'email' => $r_email,
|
191
|
+
'subject' => $r_subject,
|
192
|
+
'text' => $r_text,
|
193
|
+
'date' => time(),
|
194
|
+
'user_ip' => getenv('REMOTE_ADDR'),
|
195
|
+
'user_host' => getenv('REMOTE_HOST'),
|
196
|
+
'user_ref' => getenv('HTTP_REFERER'),
|
197
|
+
'user_agent' => getenv('HTTP_USER_AGENT'),
|
198
|
+
'user_request' => getenv('REQUEST_URI'),
|
199
|
+
);
|
200
|
+
$fn = 'page_comment_commit_'. PAGE_COMMENT_BACKEND;
|
201
|
+
if ($mid = $fn($page, $def)) {
|
202
|
+
$email = '{arg: commentEmail}';
|
203
|
+
if ($email) {
|
204
|
+
$subj = sprintf('{arg default=[Comment] %s -- %s: commentSubject}',
|
205
|
+
$page, $mid);
|
206
|
+
@mail($email, $subj, var_export($def, true),
|
207
|
+
"From: $email\\r\\nX-Mailer: PHP/" . phpversion());
|
208
|
+
}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
page_comment_list($page);
|
213
|
+
|
214
|
+
page_comment_form($page);
|
215
|
+
}
|
216
|
+
?>
|