Permalink
Browse files

Update PDoc Rake task to include proper URLs for source code references.

  • Loading branch information...
1 parent 33477d6 commit 0a0673a24de491452aa9ca8926adc279c14f37f6 @savetheclocktower savetheclocktower committed Nov 15, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 Rakefile
View
@@ -67,6 +67,7 @@ module PrototypeHelper
def self.build_doc_for(file)
rm_rf(DOC_DIR)
mkdir_p(DOC_DIR)
+ hash = current_head
index_header = <<EOF
<h1 style="margin-top: 31px; height: 75px; padding: 1px 0; background: url(images/header-stripe-small.png) repeat-x;">
<a href="http://prototypejs.org" style="padding-left: 120px;">
@@ -76,15 +77,16 @@ module PrototypeHelper
EOF
PDoc.run({
:source_files => Dir[File.join('src', '**', '*.js')],
- :destination => DOC_DIR,
- :index_page => 'README.markdown',
+ :destination => DOC_DIR,
+ :index_page => 'README.markdown',
:syntax_highlighter => syntax_highlighter,
- :markdown_parser => :bluecloth,
+ :markdown_parser => :bluecloth,
+ :src_code_text => "View source on GitHub &rarr;",
:src_code_href => proc { |obj|
- "http://github.com/sstephenson/prototype/blob/#{hash}/#{obj.file}#LID#{obj.line_number}"
+ "https://github.com/sstephenson/prototype/blob/#{hash}/#{obj.file}#L#{obj.line_number}"
},
:pretty_urls => false,
- :bust_cache => false,
+ :bust_cache => false,
:name => 'Prototype JavaScript Framework',
:short_name => 'Prototype',
:home_url => 'http://prototypejs.org',

0 comments on commit 0a0673a

Please sign in to comment.