History

Adjust API entry selection and naming

Get all (not only top-level) definitions, add () suffix on functions (and methods of all kinds).

Cimbali committed 2 years ago

Commit 8db6ffc1 parent d6274d61 file · +4 −2Browse files

Showing the changes to lib/docs (1 of 1 file). Show all

Unified · Split

lib/docs/filters/click/entries.rb+4−2
@@ -36,8 +36,10 @@ module Docs · 35 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t