History

python: include h2 entries for library docs

See #696.

Simon Legner committed 4 years ago

Commit 6e419991 parent ec4885d1 file · +2 −1Browse files

Unified · Split

lib/docs/filters/python/entries_v3.rb+2−1
@@ -57,7 +57,7 @@ module Docs · 56 unmodified lines
57 end57 end
58 58
59 def include_h2?59 def include_h2?
60 return slug.start_with?('reference') || slug.start_with?('tutorial') || slug.start_with?('using')60 return slug.start_with?('library') || slug.start_with?('reference') || slug.start_with?('tutorial') || slug.start_with?('using')
61 end61 end
62 62
63 def include_default_entry?63 def include_default_entry?
@@ -81,6 +81,7 @@ module Docs · 17 unmodified lines
81 if include_h2?81 if include_h2?
82 css('section[id] > h2').each do |node|82 css('section[id] > h2').each do |node|
83 name = node.content.remove("\u{00b6}")83 name = node.content.remove("\u{00b6}")
84 name.concat " (#{self.name})" if slug.start_with?('library')
84 entries << [name, node.parent['id']]85 entries << [name, node.parent['id']]
85 end86 end
86 end87 end