Permalink
Browse files

Update the custom YARD CSS to use the proper YARD methodology.

  • Loading branch information...
1 parent cb04561 commit 6d887f78ae1e90b8cc74131f7ec9d64a3a88d16f @nex3 nex3 committed Nov 23, 2009
View
13 Rakefile
@@ -225,6 +225,17 @@ end
begin
require 'yard'
+ namespace :yard do
+ task :sass do
+ require File.dirname(__FILE__) + '/lib/sass'
+ Dir[File.dirname(__FILE__) + "/yard/default/**/*.sass"].each do |sass|
+ File.open(sass.gsub(/sass$/, 'css'), 'w') do |f|
+ f.write(Sass::Engine.new(File.read(sass)).render)
+ end
+ end
+ end
+ end
+
YARD::Rake::YardocTask.new do |t|
t.files = FileList.new('lib/**/*.rb') do |list|
list.exclude('lib/haml/template/*.rb')
@@ -234,7 +245,9 @@ begin
t.options += FileList.new('yard/*.rb').to_a.map {|f| ['-e', f]}.flatten
files = FileList.new('doc-src/*').to_a.sort_by {|s| s.size} + %w[MIT-LICENSE VERSION]
t.options << '--files' << files.join(',')
+ t.options << '--template-path' << File.dirname(__FILE__) + '/yard'
end
+ Rake::Task['yard'].prerequisites.insert(0, 'yard:sass')
Rake::Task['yard'].instance_variable_set('@comment', nil)
desc "Generate Documentation"
View
1 yard/default/.gitignore
@@ -0,0 +1 @@
+*.css
View
0 yard/haml-style.sass → yard/default/fulldoc/html/css/common.sass
File renamed without changes.
View
20 yard/full_doc_mods.rb
@@ -1,20 +0,0 @@
-require File.dirname(__FILE__) + "/../lib/sass"
-
-class YARD::Generators::FullDocGenerator
- protected
-
- def generate_assets_with_haml
- generate_assets_without_haml
-
- if format == :html && serializer
- template_file = find_template template_path(css_file)
- haml_style = Sass::Engine.new(File.read(
- File.dirname(__FILE__) + "/haml-style.sass")).render
- serializer.serialize(css_file, File.read(template_file) + haml_style)
- end
-
- true
- end
- alias_method :generate_assets_without_haml, :generate_assets
- alias_method :generate_assets, :generate_assets_with_haml
-end

0 comments on commit 6d887f7

Please sign in to comment.