Skip to content

Commit 0a0673a

Browse files
Update PDoc Rake task to include proper URLs for source code references.
1 parent 33477d6 commit 0a0673a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Rakefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module PrototypeHelper
6767
def self.build_doc_for(file)
6868
rm_rf(DOC_DIR)
6969
mkdir_p(DOC_DIR)
70+
hash = current_head
7071
index_header = <<EOF
7172
<h1 style="margin-top: 31px; height: 75px; padding: 1px 0; background: url(images/header-stripe-small.png) repeat-x;">
7273
<a href="http://prototypejs.org" style="padding-left: 120px;">
@@ -76,15 +77,16 @@ module PrototypeHelper
7677
EOF
7778
PDoc.run({
7879
:source_files => Dir[File.join('src', '**', '*.js')],
79-
:destination => DOC_DIR,
80-
:index_page => 'README.markdown',
80+
:destination => DOC_DIR,
81+
:index_page => 'README.markdown',
8182
:syntax_highlighter => syntax_highlighter,
82-
:markdown_parser => :bluecloth,
83+
:markdown_parser => :bluecloth,
84+
:src_code_text => "View source on GitHub &rarr;",
8385
:src_code_href => proc { |obj|
84-
"http://github.com/sstephenson/prototype/blob/#{hash}/#{obj.file}#LID#{obj.line_number}"
86+
"https://github.com/sstephenson/prototype/blob/#{hash}/#{obj.file}#L#{obj.line_number}"
8587
},
8688
:pretty_urls => false,
87-
:bust_cache => false,
89+
:bust_cache => false,
8890
:name => 'Prototype JavaScript Framework',
8991
:short_name => 'Prototype',
9092
:home_url => 'http://prototypejs.org',

0 commit comments

Comments
 (0)