From a03ee6cb8f62e293e8f2577c770b6b158a693901 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 17:59:08 -0700 Subject: [PATCH] Make the compass configuration file more self documenting by adding comments for preferred_syntax, output_style, and line_comments. --- doc-src/content/CHANGELOG.markdown | 2 ++ lib/compass/configuration/comments.rb | 35 ++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 176fb745..25793da7 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -14,6 +14,8 @@ COMPASS CHANGELOG * Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the intermediate values were being scaled to that value. * You can now pass --no-line-comments to the Compass command line to disable line comments. +* Make the compass configuration file more self documenting by adding comments for + `preferred_syntax`, `output_style`, and `line_comments`. 0.10.6 (10/11/2010) ------------------- diff --git a/lib/compass/configuration/comments.rb b/lib/compass/configuration/comments.rb index b62f6a92..b48dd900 100644 --- a/lib/compass/configuration/comments.rb +++ b/lib/compass/configuration/comments.rb @@ -8,7 +8,7 @@ module Compass end def comment_for_relative_assets - unless relative_assets + unless top_level.relative_assets %q{# To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true } @@ -17,6 +17,39 @@ module Compass end end + def comment_for_line_comments + if top_level.line_comments + %q{# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false +} + else + "" + end + end + + def comment_for_output_style + unless top_level.output_style_without_default + %Q{# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed +} + else + "" + end + end + + def comment_for_preferred_syntax + if top_level.preferred_syntax == :scss + %Q{ +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass #{top_level.sass_dir} scss && rm -rf sass && mv scss sass +} + else + "" + end + end end end end