Skip to content

Instantly share code, notes, and snippets.

@morewry
Created November 26, 2012 20:33
Show Gist options
  • Save morewry/4150439 to your computer and use it in GitHub Desktop.
Save morewry/4150439 to your computer and use it in GitHub Desktop.
Compass config with styledocco to generate styleguide on compile
# we have a separate build process that strips comments & minifies, so I use production mode here to generate the styleguide
project_path = File.dirname(__FILE__) + "/"
utils_dir = "utilities/"
utils_path = project_path + utils_dir
output_style = (compiletype == :production) ? :expanded : :nested
# callback - on_stylesheet_saved
on_stylesheet_saved do |filename|
if File.exists?(filename)
if (compiletype == :production)
# Generate new documentation
styleguide(filename, utils_path + "styledocco.bat")
end
end
end
# fn - Generate styleguide documentation with styledocco
# http://jacobrask.github.com/styledocco/
def styleguide(filename, script)
if File.exists?(filename)
sleep 1
puts "Generating documentation/styleguide"
system script + " " + filename
end
end
@echo off
set projdir=%~d0%~p0
:start
styledocco --name "REMAX.com" --out docs --include docs/preview.css css/all.css --verbose
shift
if NOT x%1==x goto start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment