From f6c4cefa54a0ae4dca8ad3ed4062fbdabd83af12 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Thu, 8 Aug 2019 15:30:17 +0200 Subject: [PATCH] python: do not exclude constants --- lib/docs/filters/python/entries_v2.rb | 8 +------- lib/docs/filters/python/entries_v3.rb | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/docs/filters/python/entries_v2.rb b/lib/docs/filters/python/entries_v2.rb index 35168aac..562790df 100644 --- a/lib/docs/filters/python/entries_v2.rb +++ b/lib/docs/filters/python/entries_v2.rb @@ -57,16 +57,10 @@ module Docs clean_id_attributes entries = [] - css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| + css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]', '.data > dt[id]').each do |node| entries << [node['id'], node['id']] end - css('.data > dt[id]').each do |node| - if node['id'].split('.').last.upcase! # skip constants - entries << [node['id'], node['id']] - end - end - css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node| entries << [node['id'] + '()', node['id']] end diff --git a/lib/docs/filters/python/entries_v3.rb b/lib/docs/filters/python/entries_v3.rb index 2bd06de2..bbf1fbe6 100644 --- a/lib/docs/filters/python/entries_v3.rb +++ b/lib/docs/filters/python/entries_v3.rb @@ -55,16 +55,10 @@ module Docs clean_id_attributes entries = [] - css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| + css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]', '.data > dt[id]').each do |node| entries << [node['id'], node['id']] end - css('.data > dt[id]').each do |node| - if node['id'].split('.').last.upcase! # skip constants - entries << [node['id'], node['id']] - end - end - css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node| entries << [node['id'] + '()', node['id']] end