Skip to content
Browse files

Fixing the doc templates

  • Loading branch information...
1 parent f037c0a commit 6e57f56eeb3f95cc60b08c553a01b19d145581cd @quirkey quirkey committed
Showing with 7 additions and 8 deletions.
  1. +2 −3 vendor/jsdoc/jsdoc.rb
  2. +3 −3 vendor/jsdoc/templates/menu.haml
  3. +2 −2 vendor/jsdoc/templates/method.haml
View
5 vendor/jsdoc/jsdoc.rb
@@ -162,7 +162,6 @@ def sort_docs
def convert_doc(text)
final_text = ""
text.strip.each_line do |l|
- puts l.inspect
final_text << l.gsub(/^\ #\s/,'#')
end
final_text = RDiscount.new(final_text).to_html
@@ -171,8 +170,8 @@ def convert_doc(text)
end
def gh_url(doc_node)
- version = "v#{version}" if version =~ /^\d/
- "https://github.com/quirkey/sammy/tree/#{version}#{doc_node[:filename]}#L#{doc_node[:lineno]}"
+ v = version =~ /^\d/ ? "v#{version}" : version
+ "https://github.com/quirkey/sammy/tree/#{v}#{doc_node[:filename]}#L#{doc_node[:lineno]}"
end
def docs
View
6 vendor/jsdoc/templates/menu.haml
@@ -1,11 +1,11 @@
-%ol
+%ol.api-menu
- docs.each do |klass_name, klass|
%li
%h3
- %a{:href => "#{klass[:name]}"}= klass[:name]
+ %a{:href => "index.html##{klass[:name]}", :target => 'content'}= klass[:name]
- unless klass[:methods].empty?
%h4 Methods
%ol
- klass[:methods].each do |method|
%li
- %a{:href => "#{klass[:name]}##{method[:name]}"}= method[:name]
+ %a{:href => "index.html##{klass[:name]}-#{method[:name]}", :target => 'content'}= method[:name]
View
4 vendor/jsdoc/templates/method.haml
@@ -2,13 +2,13 @@
%h4
- if individual
%strong= klass[:name]
- %a{:href => "#{klass[:name]}._method_.#{meth[:name]}"}=meth[:name]
+ %a{:href => "#{klass[:name]}._methods_.#{meth[:name]}.html"}=meth[:name]
%span
(
%em=meth[:args].join(', ')
)
.links
- %a{:href => "#{klass[:name]}._method_.#{meth[:name]}#comments"} Comments
+ %a{:href => "#{klass[:name]}._methods_.#{meth[:name]}.html#comments"} Comments
|
%a{:href => gh_url(meth)} Show in GitHub
.doc><

0 comments on commit 6e57f56

Please sign in to comment.
Something went wrong with that request. Please try again.