hikidoc 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +5 -4
- data/README.ja +3 -2
- data/TextFormattingRules +8 -8
- data/lib/hikidoc.rb +4 -3
- data/test/run-test.rb +7 -3
- data/test/test_hikidoc.rb +23 -0
- metadata +10 -5
data/README
CHANGED
@@ -17,7 +17,7 @@ Get from the subversion repository http://hikidoc.rubyforge.org/svn/ .
|
|
17
17
|
(eg.)
|
18
18
|
svn co http://hikidoc.rubyforge.org/svn/trunk/ hikidoc
|
19
19
|
|
20
|
-
!! Installation
|
20
|
+
!! Installation
|
21
21
|
|
22
22
|
Run the 'setup.rb' script like so:
|
23
23
|
|
@@ -33,7 +33,7 @@ See [[TextFormattingRules]].
|
|
33
33
|
|
34
34
|
To subscribe the HikiDoc ML, please send the following mail. English
|
35
35
|
posts are also welcome.
|
36
|
-
|
36
|
+
|
37
37
|
To: hikidoc@ml.fdiary.net
|
38
38
|
Cc: kazuhiko@fdiary.net
|
39
39
|
Subject: subscribe <- any subject
|
@@ -44,12 +44,13 @@ HikiDoc ML's archive is available at http://www.fdiary.net/ml/hikidoc/ .
|
|
44
44
|
|
45
45
|
!! Related softwares
|
46
46
|
|
47
|
-
The following softwares use the HikiDoc library.
|
47
|
+
The following softwares use the HikiDoc library or the HikiDoc format.
|
48
48
|
|
49
49
|
:[[tDiary|http://www.tdiary.org/]]:a Weblog/Web-diary software
|
50
50
|
:[[Hiki|http://hikiwiki.org/]]:a powerful and fast wiki clone
|
51
51
|
:[[lily|http://lily.sourceforge.jp/]]:a simple CMS
|
52
|
-
:[[HikiDoc
|
52
|
+
:[[Text::HikiDoc|http://search.cpan.org/perldoc?Text::HikiDoc]]:HikiDoc by Perl
|
53
|
+
:[[PikiDoc|http://github.com/moro/piki_doc/]]:a library that you can add plugin functions on HikiDoc
|
53
54
|
|
54
55
|
!! License
|
55
56
|
|
data/README.ja
CHANGED
@@ -41,12 +41,13 @@ Subversion
|
|
41
41
|
|
42
42
|
!! ��Ϣ���륽�եȥ�����
|
43
43
|
|
44
|
-
�ʲ��Υ��եȥ������� HikiDoc
|
44
|
+
�ʲ��Υ��եȥ������� HikiDoc �饤�֥�ꡢ�ޤ��� HikiDoc �ե����ޥåȤ��Ѥ����Ƥ��ޤ���
|
45
45
|
|
46
46
|
:[[tDiary|http://www.tdiary.org/]]:�������������եȥ�����
|
47
47
|
:[[Hiki|http://hikiwiki.org/]]:¿��ǽ���Ĺ�®�� Wiki ��������
|
48
48
|
:[[lily|http://lily.sourceforge.jp/]]:����ץ�� CMS (Web �����ȹ��ۥ����ƥ�)
|
49
|
-
:[[HikiDoc
|
49
|
+
:[[Text::HikiDoc|http://search.cpan.org/perldoc?Text::HikiDoc]]:Perl �ˤ�� HikiDoc �μ���
|
50
|
+
:[[PikiDoc|http://github.com/moro/piki_doc/]]:HikiDoc�Ρ֥ץ饰�����ǽ���ɲäǤ���饤�֥��Ǥ�
|
50
51
|
|
51
52
|
!! �饤����
|
52
53
|
|
data/TextFormattingRules
CHANGED
@@ -40,7 +40,7 @@ Words in which this condition is met become a WikiName, and a link is automatica
|
|
40
40
|
**WikiNAME - All of the letters in NAME are uppercase, so this is not a WikiName
|
41
41
|
**fooWikiName - This begins with "foo", which is in all lowercase, so this is not a WikiName
|
42
42
|
|
43
|
-
You can disable an auto WikiName link by
|
43
|
+
You can disable an auto WikiName link by putting ''^'' to the WikiName.
|
44
44
|
|
45
45
|
*Example statement
|
46
46
|
|
@@ -120,22 +120,22 @@ Lines beginning with spaces or tabs will be treated as preformatted text.
|
|
120
120
|
|
121
121
|
!Text decoration
|
122
122
|
|
123
|
-
Text surrounded by sets of two single quotes ('') is
|
123
|
+
Text surrounded by sets of two single quotes ('') is emphasised.
|
124
124
|
|
125
|
-
Text surrounded by sets of three single quotes (''') is strongly
|
125
|
+
Text surrounded by sets of three single quotes (''') is strongly emphasised.
|
126
126
|
|
127
127
|
Text surrounded by sets of double equal signs (===) is struck out.
|
128
128
|
|
129
129
|
*Example statement
|
130
130
|
|
131
|
-
If you write like this, it becomes ''
|
132
|
-
And if you write like this, it becomes '''strongly
|
131
|
+
If you write like this, it becomes ''emphasised''.
|
132
|
+
And if you write like this, it becomes '''strongly emphasised'''.
|
133
133
|
==This is dull, but== And struck-out text is supported, too!
|
134
134
|
|
135
135
|
*Example output
|
136
136
|
|
137
|
-
If you write like this, it becomes ''
|
138
|
-
And if you write like this, it becomes '''strongly
|
137
|
+
If you write like this, it becomes ''emphasised''.
|
138
|
+
And if you write like this, it becomes '''strongly emphasised'''.
|
139
139
|
==This is dull, but== And struck-out text is supported, too!
|
140
140
|
|
141
141
|
!Headings
|
@@ -302,7 +302,7 @@ Comment lines is not outputted.
|
|
302
302
|
|
303
303
|
One can use a plugin by surrounding text with two pairs of brackets.
|
304
304
|
Multiple lines parameter is supported.
|
305
|
-
When a line contains plugin only, it
|
305
|
+
When a line contains plugin only, it becomes a block plugin,
|
306
306
|
which is not surrounded by <p> ... </p>.
|
307
307
|
|
308
308
|
*Example statement
|
data/lib/hikidoc.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8; -*-
|
1
2
|
# Copyright (c) 2005, Kazuhiko <kazuhiko@fdiary.net>
|
2
3
|
# Copyright (c) 2007 Minero Aoki
|
3
4
|
# All rights reserved.
|
@@ -37,7 +38,7 @@ rescue LoadError
|
|
37
38
|
end
|
38
39
|
|
39
40
|
class HikiDoc
|
40
|
-
VERSION = "0.0.
|
41
|
+
VERSION = "0.0.4" # FIXME
|
41
42
|
|
42
43
|
class Error < StandardError
|
43
44
|
end
|
@@ -90,7 +91,7 @@ class HikiDoc
|
|
90
91
|
#
|
91
92
|
|
92
93
|
def valid_plugin_syntax?(code)
|
93
|
-
/['"]/ !~ code.gsub(/'
|
94
|
+
/['"]/ !~ code.gsub(/\\\\/, "").gsub(/\\['"]/,"").gsub(/'[^']*'|"[^"]*"/m, "")
|
94
95
|
end
|
95
96
|
|
96
97
|
def escape_plugin_blocks(text)
|
@@ -726,7 +727,7 @@ class HikiDoc
|
|
726
727
|
end
|
727
728
|
|
728
729
|
def inline_plugin(src)
|
729
|
-
%Q(<span class="plugin">{{#{src}}}</span>)
|
730
|
+
%Q(<span class="plugin">{{#{escape_html(src)}}}</span>)
|
730
731
|
end
|
731
732
|
|
732
733
|
#
|
data/test/run-test.rb
CHANGED
@@ -2,8 +2,12 @@
|
|
2
2
|
|
3
3
|
require "test/unit"
|
4
4
|
|
5
|
-
if Test::Unit
|
6
|
-
|
5
|
+
if Test::Unit.respond_to?(:setup_argv)
|
6
|
+
Test::Unit::setup_argv{[File.dirname($0)]}
|
7
7
|
else
|
8
|
-
|
8
|
+
if Test::Unit::AutoRunner.respond_to?(:standalone?)
|
9
|
+
exit Test::Unit::AutoRunner.run($0, File.dirname($0))
|
10
|
+
else
|
11
|
+
exit Test::Unit::AutoRunner.run(false, File.dirname($0))
|
12
|
+
end
|
9
13
|
end
|
data/test/test_hikidoc.rb
CHANGED
@@ -32,6 +32,29 @@ class HikiDocTestCase < Test::Unit::TestCase
|
|
32
32
|
def test_plugin_with_meta_char
|
33
33
|
assert_convert("<div class=\"plugin\">{{hoge(\"a\\\"b\")}}</div>\n",
|
34
34
|
'{{hoge("a\\"b")}}')
|
35
|
+
assert_convert("<div class=\"plugin\">{{hoge(\"<a>\")}}</div>\n",
|
36
|
+
'{{hoge("<a>")}}')
|
37
|
+
assert_convert("<p>a<span class=\"plugin\">{{hoge(\"<a>\")}}</span></p>\n",
|
38
|
+
'a{{hoge("<a>")}}')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_plugin_with_default_syntax
|
42
|
+
# test HikiDoc#valid_plugin_syntax?
|
43
|
+
# default syntax checking pairs of quote like "..." or '...'
|
44
|
+
assert_convert(%q!<p>{{'}}</p>! + "\n",
|
45
|
+
%q!{{'}}!)
|
46
|
+
assert_convert(%q!<div class="plugin">{{''}}</div>! + "\n",
|
47
|
+
%q!{{''}}!)
|
48
|
+
assert_convert(%q!<p>{{'"}}</p>! + "\n",
|
49
|
+
%q!{{'"}}!)
|
50
|
+
assert_convert(%q!<div class="plugin">{{'\''}}</div>! + "\n",
|
51
|
+
%q!{{'\''}}!)
|
52
|
+
assert_convert(%q!<div class="plugin">{{'abc\\\\'}}</div>! + "\n",
|
53
|
+
%q!{{'abc\\\\'}}!)
|
54
|
+
assert_convert(%q!<div class="plugin">{{\"""}}</div>! + "\n",
|
55
|
+
%q!{{\"""}}!)
|
56
|
+
assert_convert(%q!<div class="plugin">{{"ab\c"}}</div>! + "\n",
|
57
|
+
%q!{{"ab\c"}}!)
|
35
58
|
end
|
36
59
|
|
37
60
|
def test_plugin_with_custom_syntax
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hikidoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuhiko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-08-17 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,7 +22,10 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 1.7.0
|
24
24
|
version:
|
25
|
-
description:
|
25
|
+
description: |-
|
26
|
+
'HikiDoc' is a text-to-HTML conversion tool for web writers. HikiDoc
|
27
|
+
allows you to write using an easy-to-read, easy-to-write plain text
|
28
|
+
format, then convert it to structurally valid HTML (or XHTML).
|
26
29
|
email:
|
27
30
|
- kazuhiko@fdiary.net
|
28
31
|
executables:
|
@@ -47,6 +50,8 @@ files:
|
|
47
50
|
- test/test_hikidoc.rb
|
48
51
|
has_rdoc: true
|
49
52
|
homepage: http://rubyforge.org/projects/hikidoc/
|
53
|
+
licenses: []
|
54
|
+
|
50
55
|
post_install_message:
|
51
56
|
rdoc_options:
|
52
57
|
- --main
|
@@ -68,9 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
73
|
requirements: []
|
69
74
|
|
70
75
|
rubyforge_project: hikidoc
|
71
|
-
rubygems_version: 1.
|
76
|
+
rubygems_version: 1.3.4
|
72
77
|
signing_key:
|
73
|
-
specification_version:
|
78
|
+
specification_version: 3
|
74
79
|
summary: "'HikiDoc' is a text-to-HTML conversion tool for web writers."
|
75
80
|
test_files:
|
76
81
|
- test/test_hikidoc.rb
|