RedCloth 3.0.4 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of RedCloth might be problematic. Click here for more details.
- data/CHANGELOG +17 -0
- data/COPYING +18 -0
- data/README +156 -0
- data/Rakefile +238 -0
- data/bin/redcloth +27 -2
- data/ext/redcloth_scan/extconf.rb +9 -0
- data/ext/redcloth_scan/redcloth.h +149 -0
- data/ext/redcloth_scan/redcloth_attributes.c +650 -0
- data/ext/redcloth_scan/redcloth_attributes.rl +78 -0
- data/ext/redcloth_scan/redcloth_common.rl +113 -0
- data/ext/redcloth_scan/redcloth_inline.c +5102 -0
- data/ext/redcloth_scan/redcloth_inline.rl +282 -0
- data/ext/redcloth_scan/redcloth_scan.c +9300 -0
- data/ext/redcloth_scan/redcloth_scan.rl +523 -0
- data/extras/mingw-rbconfig.rb +176 -0
- data/extras/ragel_profiler.rb +73 -0
- data/lib/redcloth.rb +22 -1128
- data/lib/redcloth/formatters/base.rb +50 -0
- data/lib/redcloth/formatters/html.rb +342 -0
- data/lib/redcloth/formatters/latex.rb +227 -0
- data/lib/redcloth/formatters/latex_entities.yml +2414 -0
- data/lib/redcloth/textile_doc.rb +105 -0
- data/lib/redcloth/version.rb +18 -0
- data/test/basic.yml +794 -0
- data/test/code.yml +195 -0
- data/test/definitions.yml +71 -0
- data/test/extra_whitespace.yml +64 -0
- data/test/filter_html.yml +177 -0
- data/test/filter_pba.yml +12 -0
- data/test/helper.rb +108 -0
- data/test/html.yml +271 -0
- data/test/images.yml +202 -0
- data/{tests → test}/instiki.yml +14 -15
- data/test/links.yml +214 -0
- data/test/lists.yml +283 -0
- data/test/poignant.yml +89 -0
- data/test/sanitize_html.yml +42 -0
- data/test/table.yml +267 -0
- data/test/test_custom_tags.rb +46 -0
- data/test/test_extensions.rb +31 -0
- data/test/test_formatters.rb +15 -0
- data/test/test_parser.rb +68 -0
- data/test/test_restrictions.rb +41 -0
- data/test/textism.yml +480 -0
- data/test/threshold.yml +772 -0
- data/test/validate_fixtures.rb +73 -0
- metadata +94 -60
- data/doc/CHANGELOG +0 -160
- data/doc/COPYING +0 -25
- data/doc/README +0 -106
- data/doc/REFERENCE +0 -216
- data/doc/make.rb +0 -359
- data/run-tests.rb +0 -28
- data/setup.rb +0 -1376
- data/tests/code.yml +0 -105
- data/tests/hard_breaks.yml +0 -26
- data/tests/images.yml +0 -171
- data/tests/links.yml +0 -155
- data/tests/lists.yml +0 -77
- data/tests/markdown.yml +0 -218
- data/tests/poignant.yml +0 -64
- data/tests/table.yml +0 -198
- data/tests/textism.yml +0 -406
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
require 'erb'
|
5
|
+
require 'w3c_validators'
|
6
|
+
|
7
|
+
class ValidateFixtures < Test::Unit::TestCase
|
8
|
+
include W3CValidators
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@v = MarkupValidator.new
|
12
|
+
sleep 1 # delay per WC3 request
|
13
|
+
end
|
14
|
+
|
15
|
+
HTML_4_0_TEMPLATE = <<EOD
|
16
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
17
|
+
<html>
|
18
|
+
<head>
|
19
|
+
<title><%= test_name %></title>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<%= content %>
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
EOD
|
26
|
+
XHTML_1_0_TEMPLATE = <<EOD
|
27
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
28
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
29
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
30
|
+
<head>
|
31
|
+
<title><%= test_name %></title>
|
32
|
+
</head>
|
33
|
+
<body>
|
34
|
+
<%= content %>
|
35
|
+
</body>
|
36
|
+
</html>
|
37
|
+
EOD
|
38
|
+
|
39
|
+
fixtures.each do |name, doc|
|
40
|
+
if doc['html'] && (doc['valid_html'].nil? || doc['valid_html'])
|
41
|
+
define_method("test_html_output_validity_of_#{name}") do
|
42
|
+
assert_produces_valid_html(name, doc['html'])
|
43
|
+
end
|
44
|
+
define_method("test_xhtml_output_validity_of_#{name}") do
|
45
|
+
assert_produces_valid_xhtml(name, doc['html'])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
def assert_produces_valid_html(test_name, content)
|
52
|
+
body = ERB.new(HTML_4_0_TEMPLATE, nil,'-%').result(binding)
|
53
|
+
assert_validates(body)
|
54
|
+
end
|
55
|
+
|
56
|
+
def assert_produces_valid_xhtml(test_name, content)
|
57
|
+
body = ERB.new(XHTML_1_0_TEMPLATE, nil,'-%').result(binding)
|
58
|
+
assert_validates(body)
|
59
|
+
end
|
60
|
+
|
61
|
+
def assert_validates(body)
|
62
|
+
results = @v.validate_text(body)
|
63
|
+
errors = results.errors
|
64
|
+
warnings = results.warnings.reject {|w| w.message_id == "247" } # NET-enabling start-tag requires SHORTTAG YES.
|
65
|
+
|
66
|
+
assert(errors.empty?, "Validator errors: \n" +
|
67
|
+
errors.collect {|e| "'#{e.to_s}'"}.join("\n"))
|
68
|
+
|
69
|
+
assert(warnings.empty?, "Validator warnings: \n" +
|
70
|
+
warnings.collect {|w| "'#{w.to_s}'"}.join("\n"))
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
metadata
CHANGED
@@ -1,68 +1,102 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.10
|
3
|
-
specification_version: 1
|
4
2
|
name: RedCloth
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
7
|
-
date: 2005-09-15
|
8
|
-
summary: RedCloth is a module for using Textile and Markdown in Ruby. Textile and Markdown are text formats. A very simple text format. Another stab at making readable text that can be converted to HTML.
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: why@ruby-lang.org
|
12
|
-
homepage: http://www.whytheluckystiff.net/ruby/redcloth/
|
13
|
-
rubyforge_project: redcloth
|
14
|
-
description: "No need to use verbose HTML to build your docs, your blogs, your pages. Textile
|
15
|
-
gives you readable text while you're writing and beautiful text for your
|
16
|
-
readers. And if you need to break out into HTML, Textile will allow you to do
|
17
|
-
so. Textile also handles some subtleties of formatting which will enhance your
|
18
|
-
document's readability: * Single- and double-quotes around words or phrases are
|
19
|
-
converted to curly quotations, much easier on the eye. \"Observe!\" * Double
|
20
|
-
hyphens are replaced with an em-dash. Observe -- very nice! * Single hyphens
|
21
|
-
are replaced with en-dashes. Observe - so cute! * Triplets of periods become an
|
22
|
-
ellipsis. Observe... * The letter 'x' becomes a dimension sign when used
|
23
|
-
alone. Observe: 2 x 2. * Conversion of ==(TM)== to (TM), ==(R)== to (R),
|
24
|
-
==(C)== to (C). For more on Textile's language, hop over to \"A Textile
|
25
|
-
Reference\":http://hobix.com/textile/. For more on Markdown, see \"Daring
|
26
|
-
Fireball's page\":http://daringfireball.net/projects/markdown/."
|
27
|
-
autorequire: redcloth
|
28
|
-
default_executable: redcloth
|
29
|
-
bindir: bin
|
30
|
-
has_rdoc: false
|
31
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
32
|
-
requirements:
|
33
|
-
-
|
34
|
-
- ">"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.0.0
|
37
|
-
version:
|
4
|
+
version: 4.0.0
|
38
5
|
platform: ruby
|
39
6
|
authors:
|
40
|
-
|
7
|
+
- Jason Garber
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-07-21 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: RedCloth-4.0.0 - Textile parser for Ruby. http://redcloth.org/
|
17
|
+
email: redcloth-upwards@rubyforge.org
|
18
|
+
executables:
|
19
|
+
- redcloth
|
20
|
+
extensions:
|
21
|
+
- ext/redcloth_scan/extconf.rb
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
- CHANGELOG
|
25
|
+
- COPYING
|
41
26
|
files:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
27
|
+
- CHANGELOG
|
28
|
+
- COPYING
|
29
|
+
- README
|
30
|
+
- Rakefile
|
31
|
+
- bin/redcloth
|
32
|
+
- test/basic.yml
|
33
|
+
- test/code.yml
|
34
|
+
- test/definitions.yml
|
35
|
+
- test/extra_whitespace.yml
|
36
|
+
- test/filter_html.yml
|
37
|
+
- test/filter_pba.yml
|
38
|
+
- test/helper.rb
|
39
|
+
- test/html.yml
|
40
|
+
- test/images.yml
|
41
|
+
- test/instiki.yml
|
42
|
+
- test/links.yml
|
43
|
+
- test/lists.yml
|
44
|
+
- test/poignant.yml
|
45
|
+
- test/sanitize_html.yml
|
46
|
+
- test/table.yml
|
47
|
+
- test/test_custom_tags.rb
|
48
|
+
- test/test_extensions.rb
|
49
|
+
- test/test_formatters.rb
|
50
|
+
- test/test_parser.rb
|
51
|
+
- test/test_restrictions.rb
|
52
|
+
- test/textism.yml
|
53
|
+
- test/threshold.yml
|
54
|
+
- test/validate_fixtures.rb
|
55
|
+
- lib/redcloth
|
56
|
+
- lib/redcloth/formatters
|
57
|
+
- lib/redcloth/formatters/base.rb
|
58
|
+
- lib/redcloth/formatters/html.rb
|
59
|
+
- lib/redcloth/formatters/latex.rb
|
60
|
+
- lib/redcloth/formatters/latex_entities.yml
|
61
|
+
- lib/redcloth/textile_doc.rb
|
62
|
+
- lib/redcloth/version.rb
|
63
|
+
- lib/redcloth.rb
|
64
|
+
- extras/mingw-rbconfig.rb
|
65
|
+
- extras/ragel_profiler.rb
|
66
|
+
- ext/redcloth_scan/redcloth.h
|
67
|
+
- ext/redcloth_scan/extconf.rb
|
68
|
+
- ext/redcloth_scan/redcloth_attributes.rl
|
69
|
+
- ext/redcloth_scan/redcloth_common.rl
|
70
|
+
- ext/redcloth_scan/redcloth_inline.rl
|
71
|
+
- ext/redcloth_scan/redcloth_scan.rl
|
72
|
+
- ext/redcloth_scan/redcloth_attributes.c
|
73
|
+
- ext/redcloth_scan/redcloth_inline.c
|
74
|
+
- ext/redcloth_scan/redcloth_scan.c
|
75
|
+
has_rdoc: true
|
76
|
+
homepage: http://redcloth.org/
|
77
|
+
post_install_message:
|
62
78
|
rdoc_options: []
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
79
|
+
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: "0"
|
87
|
+
version:
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: "0"
|
93
|
+
version:
|
67
94
|
requirements: []
|
68
|
-
|
95
|
+
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 1.1.1
|
98
|
+
signing_key:
|
99
|
+
specification_version: 2
|
100
|
+
summary: RedCloth-4.0.0 - Textile parser for Ruby. http://redcloth.org/
|
101
|
+
test_files: []
|
102
|
+
|
data/doc/CHANGELOG
DELETED
@@ -1,160 +0,0 @@
|
|
1
|
-
--- %YAML:1.0
|
2
|
-
- version: 3.0.4
|
3
|
-
date: 2005-02-18
|
4
|
-
changes:
|
5
|
-
- The caps class doesn't swallow spaces.
|
6
|
-
- Horizontal rules required to be on an empty line.
|
7
|
-
- Hard breaks don't screw with Markdown headers any longer.
|
8
|
-
- Fixed error triggered by complex lists.
|
9
|
-
- Inline markups need to be butted up against enclosing text, no spaces.
|
10
|
-
- Fixed problem with intermingled single and double quotes.
|
11
|
-
- Brought back lite_mode.
|
12
|
-
|
13
|
-
- version: 3.0.3
|
14
|
-
date: 2005-02-06
|
15
|
-
changes:
|
16
|
-
- Stack overflow regexp on code inlines obliterated.
|
17
|
-
- Citations scaled back.
|
18
|
-
- Toggle span tags on CAPS with :no_span_tags accessor.
|
19
|
-
|
20
|
-
- version: 3.0.2
|
21
|
-
date: 2005-02-02
|
22
|
-
changes:
|
23
|
-
- Stack overflow Regexps replaced.
|
24
|
-
- All code blocks protected from formatting.
|
25
|
-
- Hard breaks working.
|
26
|
-
- Filter HTML now uses detailed cleaner.
|
27
|
-
|
28
|
-
- version: 3.0.1
|
29
|
-
date: 2004-11-15
|
30
|
-
changes:
|
31
|
-
- Using `float' rather than `text-align' to align image blocks.
|
32
|
-
- Shelving more HTML attributes to prevent them from clashing with Textile glyphs.
|
33
|
-
- Simplifying the block regexp.
|
34
|
-
|
35
|
-
- version: 3.0
|
36
|
-
date: 2004-10-26
|
37
|
-
changes:
|
38
|
-
- Broke up the Textile engine into smaller parts, recoded central block parser.
|
39
|
-
- Added preliminary support for Markdown.
|
40
|
-
- Added support for custom Textile prefixes.
|
41
|
-
- RedCloth now generates XHTML fragments.
|
42
|
-
- Complete HTML documents should now work, RedCloth ignores complex HTML.
|
43
|
-
|
44
|
-
- version: 2.0.12
|
45
|
-
date: 2004-08-09
|
46
|
-
changes:
|
47
|
-
- Escaping tighter for <pre> tags that share a single line.
|
48
|
-
- No more String#htmlesc!. Moved to RedCloth#htmlesc.
|
49
|
-
- Pruned out the code that was handling multibyte.
|
50
|
-
|
51
|
-
- version: 2.0.11
|
52
|
-
date: 2004-06-01
|
53
|
-
changes:
|
54
|
-
- Fixed the new 2.0-style aliased links.
|
55
|
-
- Lines starting with div opening or closing tags aren't given paragraph tags.
|
56
|
-
- Escaped some sample markup that was being translated by RDoc.
|
57
|
-
- Subtle changes to the quick tags to help them interact with surrounding HTML better.
|
58
|
-
- Ensure angle brackets inside code quick tags get escaped.
|
59
|
-
- New patch and test by F. Ros to fix <pre> tags with class settings.
|
60
|
-
- Commented out encode_entities and fix_entities, they do nothing now. Thanks, Denis.
|
61
|
-
- Scaled back QTAGS a back to avoid mixing up hyphens and dels. Thanks, Denis.
|
62
|
-
- Work on the references to ensure they are generating at least XHTML 1.0 Transitional.
|
63
|
-
|
64
|
-
- version: 2.0.10
|
65
|
-
date: 2004-05-26
|
66
|
-
changes:
|
67
|
-
- Table and list problems. Rewrote the <pre> handling code.. again.
|
68
|
-
|
69
|
-
- version: 2.0.9
|
70
|
-
date: 2004-05-26
|
71
|
-
changes:
|
72
|
-
- Improved RDoc. Ri documentation is auto-installed now!
|
73
|
-
- Links were consuming closing HTML tags. (See latest test in tests/links.yml.)
|
74
|
-
- Further speed patch from Denis. Good good.
|
75
|
-
- Patch by F. Ros to fix <pre> tags with class settings.
|
76
|
-
|
77
|
-
- version: 2.0.8
|
78
|
-
date: 2004-05-22
|
79
|
-
changes:
|
80
|
-
- First scan of the glyphs() method only scans for pre|notextile|code, the
|
81
|
-
deeper passes scan for all HTML. Now inlines work around HTML tags!
|
82
|
-
(What a pain!)
|
83
|
-
- Moved tables and blocks into glyphs to keep them shielded from the parser
|
84
|
-
if they are in <pre> tags.
|
85
|
-
- Patch by Denis Mertz to speed up RedCloth by compiling the various RegExps
|
86
|
-
only once. Thanks, David!
|
87
|
-
|
88
|
-
- version: 2.0.7
|
89
|
-
date: 2004-04-21
|
90
|
-
changes:
|
91
|
-
- New REFERENCE and QUICK-REFERENCE. See http://hobix.com/textile/.
|
92
|
-
- Lists rewritten to accomplish better line folding.
|
93
|
-
- Better, greedier links.
|
94
|
-
- Additional link and list tests.
|
95
|
-
|
96
|
-
- version: 2.0.6
|
97
|
-
date: 2004-04-16
|
98
|
-
changes:
|
99
|
-
- Bold and strong tags were mixed up. '*' is now strong. '**' is bold.
|
100
|
-
They were swapped until now.
|
101
|
-
- Horizontal alignments were pretty buggy. Combining alignments with
|
102
|
-
indents was totally broken.
|
103
|
-
- Fixed table problem. Now glyphs are handled between tables and blocks.
|
104
|
-
- Nested <pre> and <code> tags are now escaped. Much better handling of
|
105
|
-
HTML inside <pre> tags. Really: quite nice.
|
106
|
-
- Patch from Florian Gross to fix an html filtration inconsistency.
|
107
|
-
|
108
|
-
- version: 2.0.5
|
109
|
-
date: 2004-04-14
|
110
|
-
changes:
|
111
|
-
- Added safe mode (patch courtesy of Florian Gross).
|
112
|
-
- Added line folding (suggested by Jim Menard).
|
113
|
-
- Fixing notextile tags to work multi-line.
|
114
|
-
- Ambiguity with em-dash and block opener.
|
115
|
-
- Footnote bug. (Thanks, Jim Menard!)
|
116
|
-
|
117
|
-
- version: 2.0.4
|
118
|
-
date: 2004-04-08
|
119
|
-
changes:
|
120
|
-
- Scaled back aggresiveness of the inline matching to aid the em-dash.
|
121
|
-
- Scaled back footnotes to stay out of array indices.
|
122
|
-
|
123
|
-
- version: 2.0.3
|
124
|
-
date: 2004-04-02
|
125
|
-
changes:
|
126
|
-
- Handling of pre, code, notextile was all wrong. Also, got rid of the goofed up
|
127
|
-
split then collect. Now using gsub! and recursion to handle inlines and glyphs.
|
128
|
-
- Better acronym support.
|
129
|
-
- Suppression of Regexp warnings.
|
130
|
-
- Single- and double-quoted string wierdness. Thanks, Bret Pettichord.
|
131
|
-
|
132
|
-
- version: 2.0.2
|
133
|
-
date: 2004-03-08
|
134
|
-
changes:
|
135
|
-
- Fixed broken lists, broken tables.
|
136
|
-
- code/pre tags now escape properly, glyphs are working, spans are working when surrounded by html tags.
|
137
|
-
- Fixed classes and ids.
|
138
|
-
- Restricted notextile tags to a single line.
|
139
|
-
|
140
|
-
- version: 2.0.1
|
141
|
-
date: 2004-02-10
|
142
|
-
changes:
|
143
|
-
- Unmatched closing slash on regexps in ruby 1.6.8.
|
144
|
-
- Fixes to bulleted lists.
|
145
|
-
|
146
|
-
- version: 2.0
|
147
|
-
date: 2004-02-06
|
148
|
-
changes:
|
149
|
-
- Complete rewrite of RedCloth, against beta2 from textism.com.
|
150
|
-
|
151
|
-
- version: 0.41
|
152
|
-
date: 2003-06-20
|
153
|
-
changes:
|
154
|
-
- Newlines were outputing as escaped.
|
155
|
-
|
156
|
-
- version: 0.4
|
157
|
-
date: 2003-06-20
|
158
|
-
changes:
|
159
|
-
- Initial public release.
|
160
|
-
- Integration of YAML-based PyTextile tests.
|
data/doc/COPYING
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
Redistribution and use in source and binary forms, with or without
|
2
|
-
modification, are permitted provided that the following conditions are met:
|
3
|
-
|
4
|
-
* Redistributions of source code must retain the above copyright notice,
|
5
|
-
this list of conditions and the following disclaimer.
|
6
|
-
|
7
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
8
|
-
this list of conditions and the following disclaimer in the documentation
|
9
|
-
and/or other materials provided with the distribution.
|
10
|
-
|
11
|
-
* Neither the name Textile nor the names of its contributors may be used to
|
12
|
-
endorse or promote products derived from this software without specific
|
13
|
-
prior written permission.
|
14
|
-
|
15
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
19
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
20
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
21
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
22
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
23
|
-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
24
|
-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
25
|
-
POSSIBILITY OF SUCH DAMAGE.
|
data/doc/README
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
p=. !redcloth3-title.png!
|
2
|
-
|
3
|
-
<div id="sidebar">
|
4
|
-
|
5
|
-
h4. Get RedCloth 3
|
6
|
-
|
7
|
-
p(example1). *Stable version:* "3.0.3":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz
|
8
|
-
|
9
|
-
Take a complete tour of Textile at "A Textile Reference":http://hobix.com/textile/.
|
10
|
-
|
11
|
-
For fast syntax checking, try the "Quick Reference":http://hobix.com/textile/quick.html.
|
12
|
-
|
13
|
-
p(example1). Upgrade with "RubyGems":http://rubygems.rubyforge.org/! Try:
|
14
|
-
@gem install RedCloth@.
|
15
|
-
|
16
|
-
See the "project page":http://rubyforge.org/projects/redcloth/ for bug reporting, old releases and CVS instructions. "Documentation":http://redcloth.rubyforge.org/rdoc/ is also hosted at RubyForge.
|
17
|
-
|
18
|
-
h4. RedCloth Links
|
19
|
-
|
20
|
-
"Instiki":http://www.instiki.org is the greatest Wiki ever! Uses RedCloth for its markup!
|
21
|
-
|
22
|
-
"Hobix":http://hobix.com is a lovely little blogging package which uses RedCloth for blog entries.
|
23
|
-
|
24
|
-
<div id="css-buttons">
|
25
|
-
|
26
|
-
* "(css-button w3c)%W3C% xhtml 1.0(Valid XHTML 1.0!)":http://validator.w3.org/check?uri=referer
|
27
|
-
* "(css-button w3c w3c2)%W3C% valid css(Valid CSS!)":http://jigsaw.w3.org/css-validator/check/referer
|
28
|
-
|
29
|
-
</div>
|
30
|
-
|
31
|
-
</div>
|
32
|
-
|
33
|
-
RedCloth is a module for using Textile in Ruby. Textile is a text format. A very simple text format. Another stab at making readable text that can be converted to HTML.
|
34
|
-
|
35
|
-
h2. What is Textile?
|
36
|
-
|
37
|
-
Textile is a simple markup language.
|
38
|
-
|
39
|
-
table{width:400px}.
|
40
|
-
|_. textile|_. to|_. html|
|
41
|
-
| <notextile>_a phrase_</notextile> |->|_a phrase_|
|
42
|
-
| <notextile>*a phrase*</notextile> |->|*a phrase*|
|
43
|
-
| <notextile>_*a phrase*_</notextile> |->|_*a phrase*_|
|
44
|
-
| <notextile>"Google":http://google.com</notextile> |->|"Google":http://google.com|
|
45
|
-
|
46
|
-
No need to use verbose HTML to build your docs, your blogs, your pages. Textile gives you readable text while you're writing and beautiful text for your readers. And if you need to break out into HTML, Textile will allow you to do so.
|
47
|
-
|
48
|
-
Textile also handles some subtleties of formatting which will enhance your document's readability:
|
49
|
-
|
50
|
-
* Single- and double-quotes around words or phrases are converted to curly quotations, much easier on
|
51
|
-
the eye. "Observe!"
|
52
|
-
|
53
|
-
* Double hyphens are replaced with an em-dash. Observe -- very nice!
|
54
|
-
|
55
|
-
* Single hyphens are replaced with en-dashes. Observe - so cute!
|
56
|
-
|
57
|
-
* Triplets of periods become an ellipsis. Observe...
|
58
|
-
|
59
|
-
* The letter 'x' becomes a dimension sign when used alone. Observe: 2 x 2.
|
60
|
-
|
61
|
-
* Conversion of <notextile>(TM)</notextile> to (TM), <notextile>(R)</notextile> to (R), <notextile>(C)</notextile> to (C).
|
62
|
-
|
63
|
-
For more on Textile's language, hop over to "A Textile Reference":http://hobix.com/textile/.
|
64
|
-
|
65
|
-
h2. Using RedCloth
|
66
|
-
|
67
|
-
The RedCloth class is an extension of Ruby's String class. Use it like you would a String:
|
68
|
-
|
69
|
-
<pre>
|
70
|
-
>> r = RedCloth.new "*strong text* and _emphasized text_"
|
71
|
-
=> "*strong text* and _emphasized text_"
|
72
|
-
>> r.gsub!( 'text', 'words' )
|
73
|
-
=> "*strong words* and _emphasized words_"
|
74
|
-
</pre>
|
75
|
-
|
76
|
-
To generate HTML from your RedCloth object, use the @RedCloth#to_html@ method:
|
77
|
-
|
78
|
-
<pre>
|
79
|
-
>> r.to_html
|
80
|
-
=> "<p><strong>strong words</strong> and <em>emphasized words</em></p>"
|
81
|
-
</pre>
|
82
|
-
|
83
|
-
|
84
|
-
h2. Installing RedCloth
|
85
|
-
|
86
|
-
To install RedCloth via RubyGems:
|
87
|
-
|
88
|
-
<pre>
|
89
|
-
gem install RedCloth
|
90
|
-
</pre>
|
91
|
-
|
92
|
-
Or "download RedCloth":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz and simply run the install.rb like so:
|
93
|
-
|
94
|
-
<pre>
|
95
|
-
ruby install.rb config
|
96
|
-
ruby install.rb setup
|
97
|
-
sudo ruby install.rb install
|
98
|
-
</pre>
|
99
|
-
|
100
|
-
|
101
|
-
h2. Acknowledgements
|
102
|
-
|
103
|
-
Textile is (c) 2003 Dean Allen. All rights reserved. You can read more "here":http://www.textism.com/tools/textile/.
|
104
|
-
|
105
|
-
RedCloth is also based on PyTextile, which is: Copyright (c) 2003, "Mark Pilgrim":http://diveintomark.org/. All rights reserved. You can read more about PyTextile "here":http://dealmeida.net/projects/textile.
|
106
|
-
|