Permalink
Browse files

adding a config file for asciidoc, needs latest mizuho to take effect

  • Loading branch information...
1 parent 74569f3 commit 90a1a9a2253381ba0799848beadf29232affb8d5 @fxn fxn committed Nov 17, 2008
Showing with 28 additions and 1 deletion.
  1. +2 −1 railties/Rakefile
  2. +26 −0 railties/doc/guides/asciidoc.conf
View
@@ -282,6 +282,7 @@ task :guides do
FileUtils.mkdir(html)
template = File.expand_path("doc/guides/source/templates/guides.html.erb")
+ asciidoc_conf = 'doc/guides/asciidoc.conf'
ignore = ['..', 'icons', 'images', 'templates', 'stylesheets']
ignore << 'active_record_basics.txt'
@@ -311,7 +312,7 @@ task :guides do
begin
puts "GENERATING => #{output}"
ENV['MANUALSONRAILS_TOC'] = 'no' if indexless.include?(entry)
- Mizuho::Generator.new(input, :output => output, :template => template).start
+ Mizuho::Generator.new(input, :output => output, :template => template, :conf_file => asciidoc_conf).start
rescue Mizuho::GenerationError
STDERR.puts "*** ERROR"
exit 2
@@ -0,0 +1,26 @@
+# Asciidoc substitutes some characters by default, those are called
+# "replacements" in the docs. For example => becomes a unicode arrow.
+#
+# We override replacements to allow copy & paste of source code.
+
+[replacements]
+
+# Ellipsis
+(?<!\\)\.\.\.=...
+\\\.\.\.=...
+
+# -> right arrow
+(?<!\\)-&gt;==-&gt;
+\\-&gt;=-&gt;
+
+# => right double arrow
+(?<!\\)\=&gt;==&gt;
+\\\=&gt;==&gt;
+
+# <- left arrow
+(?<!\\)&lt;-=&lt;-
+\\&lt;-=&lt;-
+
+# <= left double arrow
+(?<!\\)&lt;\==&lt;=
+\\&lt;\==&lt;=

0 comments on commit 90a1a9a

Please sign in to comment.