Skip to content

Commit 8db6ffc

Browse files
committed
Adjust API entry selection and naming
Get all (not only top-level) definitions, add () suffix on functions (and methods of all kinds).
1 parent d6274d6 commit 8db6ffc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/docs/filters/click/entries.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ def additional_entries
3636
entries = []
3737
doc.css('> section').each do |section|
3838
title = section.at_css('h2').content.strip
39-
section.css('> dl.py > dt[id]').each do |dt|
40-
entries << [dt['id'], dt['id'], title]
39+
section.css('dl.py > dt[id]').each do |dt|
40+
name = dt['id'].split('.')[1..].join('.')
41+
name << '()' if dt.parent.classes.intersect?(['function', 'method', 'classmethod', 'staticmethod'])
42+
entries << [name, dt['id'], title]
4143
end
4244
end
4345
return entries

0 commit comments

Comments
 (0)