hikidoc 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/COPYING ADDED
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2005, Kazuhiko <kazuhiko@fdiary.net>
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above
11
+ copyright notice, this list of conditions and the following
12
+ disclaimer in the documentation and/or other materials provided
13
+ with the distribution.
14
+ * Neither the name of the HikiDoc nor the names of its
15
+ contributors may be used to endorse or promote products derived
16
+ from this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README ADDED
@@ -0,0 +1,85 @@
1
+ ! HikiDoc
2
+
3
+ !! Introduction
4
+
5
+ 'HikiDoc' is a text-to-HTML conversion tool for web writers. HikiDoc
6
+ allows you to write using an easy-to-read, easy-to-write plain text
7
+ format, then convert it to structurally valid HTML (or XHTML).
8
+
9
+ !! Requirements
10
+
11
+ HikiDoc requires Ruby 1.8.2 or later.
12
+
13
+ !! Download
14
+
15
+ Get from the subversion repository http://hikidoc.rubyforge.org/svn/ .
16
+
17
+ (eg.)
18
+ svn co http://hikidoc.rubyforge.org/svn/trunk/ hikidoc
19
+
20
+ !! Installation
21
+
22
+ Run the 'setup.rb' script like so:
23
+
24
+ $ ruby setup.rb config
25
+ $ ruby setup.rb setup
26
+ # ruby setup.rb install
27
+
28
+ !! Syntax
29
+
30
+ See [[TextFormattingRules]].
31
+
32
+ !! Mailing list
33
+
34
+ To subscribe the HikiDoc ML, please send the following mail. English
35
+ posts are also welcome.
36
+
37
+ To: hikidoc@ml.fdiary.net
38
+ Cc: kazuhiko@fdiary.net
39
+ Subject: subscribe <- any subject
40
+
41
+ Hello. <- any body
42
+
43
+ HikiDoc ML's archive is available at http://www.fdiary.net/ml/hikidoc/ .
44
+
45
+ !! Related softwares
46
+
47
+ The following softwares use the HikiDoc library.
48
+
49
+ :[[tDiary|http://www.tdiary.org/]]:a Weblog/Web-diary software
50
+ :[[Hiki|http://hikiwiki.org/]]:a powerful and fast wiki clone
51
+ :[[lily|http://lily.sourceforge.jp/]]:a simple CMS
52
+ :[[HikiDoc.pm|http://haro.jp/wiki/index.cgi?page=B%27s+Soft#p2]]:HikiDoc by Perl
53
+
54
+ !! License
55
+
56
+ HikiDoc's license is the 'Modified BSD License'.
57
+
58
+ Copyright (c) 2005, Kazuhiko <kazuhiko@fdiary.net>
59
+ All rights reserved.
60
+
61
+ Redistribution and use in source and binary forms, with or without
62
+ modification, are permitted provided that the following conditions are
63
+ met:
64
+
65
+ * Redistributions of source code must retain the above copyright
66
+ notice, this list of conditions and the following disclaimer.
67
+ * Redistributions in binary form must reproduce the above
68
+ copyright notice, this list of conditions and the following
69
+ disclaimer in the documentation and/or other materials provided
70
+ with the distribution.
71
+ * Neither the name of the HikiDoc nor the names of its
72
+ contributors may be used to endorse or promote products derived
73
+ from this software without specific prior written permission.
74
+
75
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
76
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
77
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
78
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
79
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
80
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
82
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
83
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.ja ADDED
@@ -0,0 +1,82 @@
1
+ ! HikiDoc
2
+
3
+ !! �Ϥ����
4
+
5
+ 'HikiDoc' �ϡ֥ƥ����Ȣ� HTML���Ѵ��ġ���Ǥ����񤭤䤹���ɤߤ䤹��ʸˡ��
6
+ �ƥ����Ȥ�ޤȤ�� HTML (�� XHTML) ���Ѵ����ޤ���
7
+
8
+ !! ɬ�פʤ��
9
+
10
+ HikiDoc �μ¹Ԥˤ� Ruby 1.8.2 �ʹߤ�ɬ�פǤ���
11
+
12
+ !! �����������
13
+
14
+ Subversion ��ݥ��ȥ� http://hikidoc.rubyforge.org/svn/ �����������
15
+ ����������
16
+
17
+ (��)
18
+ svn co http://hikidoc.rubyforge.org/svn/trunk/ hikidoc
19
+
20
+ !! ���󥹥ȡ���
21
+
22
+ �ʲ��Τ褦�� 'setup.rb' ������ץȤ��Ѥ��ƥ��󥹥ȡ��뤷�ޤ���
23
+
24
+ $ ruby setup.rb config
25
+ $ ruby setup.rb setup
26
+ # ruby setup.rb install
27
+
28
+ !! ʸˡ
29
+
30
+ [[TextFormattingRules.ja]] ��������������
31
+
32
+ !! �᡼��󥰥ꥹ��
33
+
34
+ ���ä��˾��������ϡ��ʲ��Τ褦�ʥ᡼����������Ƥ���������
35
+ To: hikidoc@ml.fdiary.net
36
+ Cc: kazuhiko@fdiary.net
37
+
38
+ ��ʸ�˼��ʾҲ�ʤ�
39
+
40
+ ���Υ᡼��� http://www.fdiary.net/ml/hikidoc/ �Ǹ������Ƥ��ޤ���
41
+
42
+ !! ��Ϣ���륽�եȥ�����
43
+
44
+ �ʲ��Υ��եȥ������� HikiDoc �饤�֥�꤬�Ѥ����Ƥ��ޤ���
45
+
46
+ :[[tDiary|http://www.tdiary.org/]]:�������������եȥ�����
47
+ :[[Hiki|http://hikiwiki.org/]]:¿��ǽ���Ĺ�®�� Wiki ��������
48
+ :[[lily|http://lily.sourceforge.jp/]]:����ץ�� CMS (Web �����ȹ��ۥ����ƥ�)
49
+ :[[HikiDoc.pm|http://haro.jp/wiki/index.cgi?page=B%27s+Soft#p2]]:Perl �ˤ�� HikiDoc �μ���
50
+
51
+ !! �饤����
52
+
53
+ Modified BSD �饤���󥹤Ǥ���
54
+
55
+ Copyright (c) 2005, Kazuhiko <kazuhiko@fdiary.net>
56
+ All rights reserved.
57
+
58
+ Redistribution and use in source and binary forms, with or without
59
+ modification, are permitted provided that the following conditions are
60
+ met:
61
+
62
+ * Redistributions of source code must retain the above copyright
63
+ notice, this list of conditions and the following disclaimer.
64
+ * Redistributions in binary form must reproduce the above
65
+ copyright notice, this list of conditions and the following
66
+ disclaimer in the documentation and/or other materials provided
67
+ with the distribution.
68
+ * Neither the name of the HikiDoc nor the names of its
69
+ contributors may be used to endorse or promote products derived
70
+ from this software without specific prior written permission.
71
+
72
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
73
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
74
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
75
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
76
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
77
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
78
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
79
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
80
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
81
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
82
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ require 'find'
7
+
8
+ base_dir = File.expand_path(File.dirname(__FILE__))
9
+ $LOAD_PATH.unshift(File.join(base_dir, 'lib'))
10
+ require 'hikidoc'
11
+
12
+ truncate_base_dir = Proc.new do |x|
13
+ x.gsub(/\A#{Regexp.escape(base_dir + File::SEPARATOR)}/, '')
14
+ end
15
+
16
+ manifest = File.join(base_dir, "Manifest.txt")
17
+ manifest_contents = []
18
+ base_dir_included_components = %w(COPYING README README.ja Rakefile
19
+ TextFormattingRules TextFormattingRules.ja
20
+ setup.rb)
21
+ excluded_components = %w(.svn doc log pkg)
22
+ Find.find(base_dir) do |target|
23
+ target = truncate_base_dir[target]
24
+ components = target.split(File::SEPARATOR)
25
+ if components.size == 1 and !File.directory?(target)
26
+ next unless base_dir_included_components.include?(components[0])
27
+ end
28
+ Find.prune if (excluded_components - components) != excluded_components
29
+ manifest_contents << target if File.file?(target)
30
+ end
31
+
32
+ File.open(manifest, "w") do |f|
33
+ f.puts manifest_contents.sort.join("\n")
34
+ end
35
+ at_exit do
36
+ FileUtils.rm_f(manifest)
37
+ end
38
+
39
+ ENV["VERSION"] ||= HikiDoc::VERSION
40
+ project = Hoe.new('hikidoc', HikiDoc::VERSION) do |project|
41
+ project.author = ['Kazuhiko']
42
+ project.email = ['kazuhiko@fdiary.net']
43
+ project.description = project.paragraphs_of('README', 2).join
44
+ project.summary = project.description.split(/(\.)/, 3)[0, 2].join
45
+ project.url = 'http://rubyforge.org/projects/hikidoc/'
46
+ project.test_globs = ['test/test_*.rb']
47
+ project.rdoc_pattern = /(?:^(?:lib|bin)|\AREADME\z)/
48
+ end
@@ -0,0 +1,316 @@
1
+ !Paragraphs
2
+
3
+ Consecutive lines are concatenated into a single paragraph.
4
+
5
+ Blank lines (ones with only a carriage return or with only spaces and tabs) mark the end of a paragraph.
6
+
7
+ *Example statement
8
+
9
+ For example,
10
+ if I write like this, these lines
11
+ will be formatted as one paragraph.
12
+
13
+ *Example output
14
+
15
+ For example,
16
+ if I write like this, these lines
17
+ will be formatted as one paragraph.
18
+
19
+ !Links
20
+
21
+ !!WikiNames
22
+
23
+ WikiNames are comprised of two or more words put together; each word begins with an uppercase letter, and is followed by at least one lowercase letter or number.
24
+
25
+ Words in which this condition is met become a WikiName, and a link is automatically attached.
26
+
27
+ *Example statement
28
+
29
+ WikiName - WikiName
30
+ HogeRule1 - WikiName
31
+ NOTWIKINAME - All of the letters are uppercase, so this is not a WikiName
32
+ WikiNAME - All of the letters in NAME are uppercase, so this is not a WikiName
33
+ fooWikiName - This begins with "foo", which is in all lowercase, so this is not a WikiName
34
+
35
+ *Example output
36
+
37
+ **WikiName - WikiName
38
+ **HogeRule1 - WikiName
39
+ **NOTWIKINAME - All of the letters are uppercase, so this is not a WikiName
40
+ **WikiNAME - All of the letters in NAME are uppercase, so this is not a WikiName
41
+ **fooWikiName - This begins with "foo", which is in all lowercase, so this is not a WikiName
42
+
43
+ You can disable an auto WikiName link by prepending ''^'' to the WikiName.
44
+
45
+ *Example statement
46
+
47
+ WikiName - WikiName
48
+ ^WikiName - Disable WikiName link
49
+
50
+ *Example output
51
+
52
+ **WikiName - WikiName
53
+ **^WikiName - Disable WikiName link
54
+
55
+ !!Linking to other Wiki pages
56
+
57
+ If a page name is surrounded with two pairs of brackets, it becomes a link to that page.
58
+
59
+ *Example statement
60
+
61
+ For example, if you write [[TextFormattingRules]], it becomes a link to that page.
62
+
63
+ *Example output
64
+
65
+ For example, if you write [[TextFormattingRules]], it becomes a link to that page.
66
+
67
+ !!Linking to an arbitrary URL
68
+
69
+ If a phrase and URL, separated by a vertical line, are surrounded with two pairs of brackets, it becomes a link to an arbitrary URL.
70
+
71
+ *Example statement
72
+
73
+ Links like [[Yahoo!|http://www.yahoo.com/]] are also possible.
74
+
75
+ *Example output
76
+
77
+ Links like [[Yahoo!|http://www.yahoo.com/]] are also possible.
78
+
79
+ Text in a paragraph that looks like a URL will automatically become a link.
80
+
81
+ *Example statement
82
+
83
+ Hiki's home page is http://hikiwiki.org/en/ (English).
84
+
85
+ *Example output
86
+
87
+ Hiki's home page is http://hikiwiki.org/en/ (English).
88
+
89
+ In this case, if the URL ends with jpg., .jpeg, .png, or .gif, the image is displayed on the page.
90
+
91
+ *Example statement
92
+
93
+ http://jp.rubyist.net/theme/clover/clover_h1.png
94
+
95
+ *Example output
96
+
97
+ http://jp.rubyist.net/theme/clover/clover_h1.png
98
+
99
+ !Preformatted text
100
+
101
+ Lines beginning with spaces or tabs will be treated as preformatted text.
102
+
103
+ *Example output
104
+
105
+ require 'cgi'
106
+
107
+ cgi = CGI::new
108
+ cgi.header
109
+
110
+ puts <<EOS
111
+ <html>
112
+ <head>
113
+ <title>Hello!</title>
114
+ </head>
115
+ <body>
116
+ <p>Hello!</p>
117
+ </body>
118
+ </html>
119
+ EOS
120
+
121
+ !Text decoration
122
+
123
+ Text surrounded by sets of two single quotes ('') is emphasized.
124
+
125
+ Text surrounded by sets of three single quotes (''') is strongly emphasized.
126
+
127
+ Text surrounded by sets of double equal signs (===) is struck out.
128
+
129
+ *Example statement
130
+
131
+ If you write like this, it becomes ''emphasized''.
132
+ And if you write like this, it becomes '''strongly emphasized'''.
133
+ ==This is dull, but== And struck-out text is supported, too!
134
+
135
+ *Example output
136
+
137
+ If you write like this, it becomes ''emphasized''.
138
+ And if you write like this, it becomes '''strongly emphasized'''.
139
+ ==This is dull, but== And struck-out text is supported, too!
140
+
141
+ !Headings
142
+
143
+ Lines with exclamation marks at the beginning become headings.
144
+
145
+ One can use up to six exclamation marks; they will be converted to <h1> to <h6> tags.
146
+
147
+ *Example statement
148
+
149
+ !Heading1
150
+ !!Heading2
151
+ !!!Heading3
152
+ !!!!Heading4
153
+ !!!!!Heading5
154
+
155
+ *Example output
156
+
157
+ !Heading1
158
+ !!Heading2
159
+ !!!Heading3
160
+ !!!!Heading4
161
+ !!!!!Heading5
162
+
163
+ !Horizontal lines
164
+
165
+ Four hyphens at the beginning of the line (----) become a horizontal rule.
166
+
167
+ *Example statement
168
+
169
+ A B C D E
170
+ ----
171
+ F G H I J
172
+
173
+ *Example output
174
+
175
+ A B C D E
176
+ ----
177
+ F G H I J
178
+
179
+ !Lists
180
+
181
+ Lines beginning with asterisks become list items.
182
+
183
+ It is possible to use up to three asterisks; it is also possible to create nested lists.
184
+
185
+ Lines beginning with a # become numbered lists.
186
+
187
+ *Example statement
188
+
189
+ *Item 1
190
+ **Item 1.1
191
+ **Item 1.2
192
+ ***Item 1.2.1
193
+ ***Item 1.2.2
194
+ ***Item 1.2.3
195
+ **Item 1.3
196
+ **Item 1.4
197
+ *Item 2
198
+
199
+ #Item 1
200
+ #Item 2
201
+ ##Item 2.1
202
+ ##Item 2.2
203
+ ##Item 2.3
204
+ #Item 3
205
+ ##Item 3.1
206
+ ###Item 3.1.1
207
+ ###Item 3.1.2
208
+
209
+ *Example output
210
+
211
+ *Item 1
212
+ **Item 1.1
213
+ **Item 1.2
214
+ ***Item 1.2.1
215
+ ***Item 1.2.2
216
+ ***Item 1.2.3
217
+ **Item 1.3
218
+ **Item 1.4
219
+ *Item 2
220
+
221
+ #Item 1
222
+ #Item 2
223
+ ##Item 2.1
224
+ ##Item 2.2
225
+ ##Item 2.3
226
+ #Item 3
227
+ ##Item 3.1
228
+ ###Item 3.1.1
229
+ ###Item 3.1.2
230
+
231
+ !Quotations
232
+
233
+ Lines beginning with two double quotes become quotations.
234
+
235
+ *Example statement
236
+
237
+ ""This is a quotation.
238
+ ""This is another quote.
239
+ ""This is a continued quote. When there are consecutive quotations,
240
+ ""they are displayed as one quote,
241
+ ""like this.
242
+
243
+ *Example output
244
+
245
+ ""This is a quotation.
246
+ ""This is another quote.
247
+ ""This is a continued quote. When there are consecutive quotations,
248
+ ""they are displayed as one quote,
249
+ ""like this.
250
+
251
+ !Definitions
252
+
253
+ Lines beginning with a colon and have a phrase and explanation separated by another colon will become a definition.
254
+
255
+ *Example statement
256
+
257
+ :ringo:apple
258
+ :gorira:gorilla
259
+ :rakuda:camel
260
+
261
+ *Example output
262
+
263
+ :ringo:apple
264
+ :gorira:gorilla
265
+ :rakuda:camel
266
+
267
+ ! Tables
268
+
269
+ Tables begin with two vertical bars.
270
+
271
+ Leading `!' in a cell means that it is a heading cell.
272
+
273
+ To concatenate columns or rows, put `>'(columns) or `^'(rows) at head of
274
+ the cell.
275
+
276
+ * Example statement
277
+
278
+ ||!row heading \ column heading||!column A||!column B||!column C||!>column D-E (horizontal concatenation)
279
+ ||!row 1||A1||B1||^C1-C2 (vertical concatenation)||D1||E1
280
+ ||!row 2||A2||B2||^>D2-E2-D3-E3 (vertical and horizontal concatenation)
281
+ ||!row 3||>>A3-C3 (horizontal concatenation)
282
+
283
+ * Example output
284
+
285
+ ||!row heading \ column heading||!column A||!column B||!column C||!>column D-E (horizontal concatenation)
286
+ ||!row 1||A1||B1||^C1-C2 (vertical concatenation)||D1||E1
287
+ ||!row 2||A2||B2||^>D2-E2-D3-E3 (vertical and horizontal concatenation)
288
+ ||!row 3||>>A3-C3 (horizontal concatenation)
289
+
290
+ ! Comments
291
+
292
+ Lines starting with `//' becomes a comment line.
293
+ Comment lines is not outputted.
294
+
295
+ * Example statement
296
+ // This is a comment line.
297
+
298
+ * Example output (not displayed)
299
+ // This is a comment line.
300
+
301
+ !Plugins
302
+
303
+ One can use a plugin by surrounding text with two pairs of brackets.
304
+ Multiple lines parameter is supported.
305
+ When a line contains plugin only, it is becomes a block plugin,
306
+ which is not surrounded by <p> ... </p>.
307
+
308
+ *Example statement
309
+
310
+ {{recent(3)}}
311
+
312
+ * Example statement of multiple lines
313
+
314
+ {{pre('
315
+ ...
316
+ ')}}