Add entries for Go's constants and variables

Fixes #80.
pull/90/head
Thibaut 11 years ago
parent f657dfddf6
commit b481c58851

@ -15,13 +15,17 @@ module Docs
css('#manual-nav a').each_with_object [] do |node, entries| css('#manual-nav a').each_with_object [] do |node, entries|
case node.content case node.content
when /type\ (\w+)/ when /type\ (\w+)/
name = $1 name = "#{$1} (#{self.name})"
when /func\ (?:\(.+\)\ )?(\w+)\(/ when /func\ (?:\(.+\)\ )?(\w+)\(/
name = "#{$1}()" name = "#{$1}() (#{self.name})"
name.prepend "#{$1}." if node['href'] =~ /#(\w+)\.#{$1}/ name.prepend "#{$1}." if node['href'] =~ /#(\w+)\.#{$1}/
when 'Constants'
name = "#{self.name} constants"
when 'Variables'
name = "#{self.name} variables"
end end
entries << ["#{name} (#{self.name})", node['href'][1..-1]] if name entries << [name, node['href'][1..-1]] if name
end end
end end

Loading…
Cancel
Save