aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/Rakefile3
-rw-r--r--railties/doc/guides/asciidoc.conf26
2 files changed, 28 insertions, 1 deletions
diff --git a/railties/Rakefile b/railties/Rakefile
index 52357a09c5..98aac97022 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -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
diff --git a/railties/doc/guides/asciidoc.conf b/railties/doc/guides/asciidoc.conf
new file mode 100644
index 0000000000..f8e0c0a32c
--- /dev/null
+++ b/railties/doc/guides/asciidoc.conf
@@ -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;= \ No newline at end of file