diff --git a/.gitignore b/.gitignore index 2460a37a8..9a1118d7b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ pkg test/unit/tmp/* doc -tmp \ No newline at end of file +tmp +*.pdoc.yaml \ No newline at end of file diff --git a/Rakefile b/Rakefile index a61f3fd90..31069c5e7 100755 --- a/Rakefile +++ b/Rakefile @@ -65,29 +65,19 @@ module PrototypeHelper end def self.build_doc_for(file) - mkdir_p TMP_DIR - temp_path = File.join(TMP_DIR, "prototype.temp.js") - sprocketize( - :path => 'src', - :source => file, - :destination => temp_path, - :selector_engine => ENV['SELECTOR_ENGINE'] || DEFAULT_SELECTOR_ENGINE, - :strip_comments => false - ) - rm_rf DOC_DIR - - highlighter = syntax_highlighter - puts "Using syntax highlighter: #{highlighter}\n" + rm_rf(DOC_DIR) + mkdir_p(DOC_DIR) PDoc.run({ - :source_files => [temp_path], + :source_files => Dir[File.join('src', '**', '*.js')], :destination => DOC_DIR, :index_page => 'README.markdown', - :syntax_highlighter => highlighter, - :markdown_parser => :bluecloth + :syntax_highlighter => syntax_highlighter, + :markdown_parser => :bluecloth, + :repository_url => "http://github.com/sstephenson/prototype/tree/#{current_head}/", + :pretty_urls => true, + :bust_cache => false }) - - rm_rf temp_path end def self.syntax_highlighter @@ -103,7 +93,7 @@ module PrototypeHelper def self.require_highlighter(name, verbose=false) case name when :pygments - success = system("pygmentize -V") + success = system("pygmentize -V > /dev/null") if !success && verbose puts "\nYou asked to use Pygments, but I can't find the 'pygmentize' binary." puts "To install, visit:\n" @@ -194,6 +184,10 @@ module PrototypeHelper exit end end + + def self.current_head + `git show-ref --hash HEAD`.chomp + end end task :default => [:dist, :dist_helper, :package, :clean_package_source] diff --git a/vendor/pdoc b/vendor/pdoc index 472a55dd0..14c5c89e0 160000 --- a/vendor/pdoc +++ b/vendor/pdoc @@ -1 +1 @@ -Subproject commit 472a55dd0019acf034d4f72522915a5e9efd0a1a +Subproject commit 14c5c89e0147376563370e5925eeccc80990f202