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
36 entries = []36 entries = []
37 doc.css('> section').each do |section|37 doc.css('> section').each do |section|
38 title = section.at_css('h2').content.strip38 title = section.at_css('h2').content.strip
39 section.css('> dl.py > dt[id]').each do |dt|39 section.css('dl.py > dt[id]').each do |dt|
40 entries << [dt['id'], dt['id'], title]40 name = dt['id'].split('.')[1..].join('.')
41 name << '()' if dt.parent.classes.intersect?(['function', 'method', 'classmethod', 'staticmethod'])
42 entries << [name, dt['id'], title]
41 end43 end
42 end44 end
43 return entries45 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