aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-03 12:08:47 -0700
committerXavier Noria <fxn@hashref.com>2010-04-03 12:08:47 -0700
commit512b4bccfbe222bd7f94adf6f9af07c2e856767d (patch)
treee6e4e1eb6413f97a4a167077c8c4fe086068d76d /railties
parent11161e6c96fb6686a33e05ead106b96089ff9790 (diff)
downloadrails-512b4bccfbe222bd7f94adf6f9af07c2e856767d.tar.gz
rails-512b4bccfbe222bd7f94adf6f9af07c2e856767d.tar.bz2
rails-512b4bccfbe222bd7f94adf6f9af07c2e856767d.zip
adds a preamble to the guides generator, documents what it does and the environment variables it supports
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/rails_guides/generator.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index d0873bfed5..3d48d6b708 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -1,3 +1,50 @@
+# ---------------------------------------------------------------------------
+#
+# This script generates the guides. It can be invoked either directly or via the
+# generate_guides rake task within the railties directory.
+#
+# Guides are taken from the source directory, and the resulting HTML goes into the
+# output directory. Assets are stored under files, and copied to output/files as
+# part of the generation process.
+#
+# Some arguments may be passed via environment variables:
+#
+# WARN_BROKEN_LINKS
+# Internal references (anchors) are checked. If a reference is broken
+# levenshtein distance is used to suggest an existing one. This is useful
+# since IDs are generated by Textile from titles and thus rewordings alter
+# them.
+#
+# WARN_DUPLICATE_HEADERS
+# Warns about duplicate IDs in headers. Please do resolve them, if any,
+# so guides are valid XHTML.
+#
+# This check only happens if WARN_BROKEN_LINKS is also active.
+#
+# EDGE_GUIDES
+# Set to "1" to indicate edge guides are generated.
+#
+# ALL
+# Generate all guides.
+
+# ONLY
+# If you want to generate only one or a set of guides.
+# Prefixes are enough:
+#
+# # generates only association_basics.html
+# ONLY=assoc ruby rails_guides.rb
+#
+# Separate many using commas:
+#
+# # generates only
+# ONLY=assoc,migrations ruby rails_guides.rb
+#
+# Note that if you are working on a guide, generation will
+# by default process only that one, so ONLY is rarely used
+# nowadays.
+#
+# ---------------------------------------------------------------------------
+
require 'set'
require 'fileutils'