| @@ -90,33 +90,33 @@ module Docs · 89 unmodified lines |
| 90 | return config_additional_entries if type && type.include?('Configuration') | 90 | return config_additional_entries if type && type.include?('Configuration') |
| 91 | return data_types_additional_entries if type == 'Data Types' | 91 | return data_types_additional_entries if type == 'Data Types' |
| 92 | return command_additional_entries if type == 'Commands' | 92 | return command_additional_entries if type == 'Commands' |
| 93 | return get_heading_entries('h3[id]') if slug == 'functions-xml' | 93 | return get_heading_entries('h3[id], .sect3[id] > h3:first-child') if slug == 'functions-xml' |
| 94 | | 94 | |
| 95 | entries = get_heading_entries('h2[id]') | 95 | entries = get_heading_entries('h2[id], .sect2[id] > h2:first-child') |
| 96 | | 96 | |
| 97 | case slug | 97 | case slug |
| 98 | when 'queries-union' | 98 | when 'queries-union' |
| 99 | entries.concat get_custom_entries('p > .LITERAL:first-child') | 99 | entries.concat get_custom_entries('p > .literal:first-child') |
| 100 | when 'queries-table-expressions' | 100 | when 'queries-table-expressions' |
| 101 | entries.concat get_heading_entries('h3[id]') | 101 | entries.concat get_heading_entries('h3[id], .sect3[id] > h3:first-child') |
| 102 | entries.concat get_custom_entries('dt > .LITERAL:first-child') | 102 | entries.concat get_custom_entries('dt > .literal:first-child') |
| 103 | when 'functions-logical' | 103 | when 'functions-logical' |
| 104 | entries.concat get_custom_entries('> table td:first-child > code') | 104 | entries.concat get_custom_entries('> table td:first-child > code') |
| 105 | when 'functions-formatting' | 105 | when 'functions-formatting' |
| 106 | entries.concat get_custom_entries('#FUNCTIONS-FORMATTING-TABLE td:first-child > code') | 106 | entries.concat get_custom_entries('#FUNCTIONS-FORMATTING-TABLE td:first-child > code') |
| 107 | when 'functions-admin' | 107 | when 'functions-admin' |
| 108 | entries.concat get_custom_entries('.TABLE td:first-child > code') | 108 | entries.concat get_custom_entries('.table td:first-child > code') |
| 109 | when 'functions-string' | 109 | when 'functions-string' |
| 110 | entries.concat get_custom_entries('> div[id^="FUNC"] td:first-child > code') | 110 | entries.concat get_custom_entries('> div[id^="FUNC"] td:first-child > code') |
| 111 | entries.concat get_custom_entries('> div[id^="FORMAT"] td:first-child > code') | 111 | entries.concat get_custom_entries('> div[id^="FORMAT"] td:first-child > code') |
| 112 | else | 112 | else |
| 113 | if type && type.start_with?('Functions') | 113 | if type && type.start_with?('Functions') |
| 114 | entries.concat get_custom_entries('> .TABLE td:first-child > code.LITERAL:first-child') | 114 | entries.concat get_custom_entries('> .table td:first-child > code.literal:first-child') |
| 115 | entries.concat get_custom_entries('> .TABLE td:first-child > code.FUNCTION:first-child') | 115 | entries.concat get_custom_entries('> .table td:first-child > code.function:first-child') |
| 116 | entries.concat get_custom_entries('> .TABLE td:first-child > code:not(.LITERAL):first-child + code.LITERAL') | 116 | entries.concat get_custom_entries('> .table td:first-child > code:not(.literal):first-child + code.literal') |
| 117 | entries.concat get_custom_entries('> .TABLE td:first-child > p > code.LITERAL:first-child') | 117 | entries.concat get_custom_entries('> .table td:first-child > p > code.literal:first-child') |
| 118 | entries.concat get_custom_entries('> .TABLE td:first-child > p > code.FUNCTION:first-child') | 118 | entries.concat get_custom_entries('> .table td:first-child > p > code.function:first-child') |
| 119 | entries.concat get_custom_entries('> .TABLE td:first-child > p > code:not(.LITERAL):first-child + code.LITERAL') | 119 | entries.concat get_custom_entries('> .table td:first-child > p > code:not(.literal):first-child + code.literal') |
| 120 | if slug == 'functions-comparison' && !at_css('#FUNCTIONS-COMPARISON-PRED-TABLE') # before 9.6 | 120 | if slug == 'functions-comparison' && !at_css('#FUNCTIONS-COMPARISON-PRED-TABLE') # before 9.6 |
| 121 | entries.concat %w(IS NULL BETWEEN DISTINCT\ FROM).map { |name| ["#{self.name}: #{name}"] } | 121 | entries.concat %w(IS NULL BETWEEN DISTINCT\ FROM).map { |name| ["#{self.name}: #{name}"] } |
| 122 | end | 122 | end |
| @@ -127,8 +127,8 @@ module Docs · 4 unmodified lines |
| 127 | end | 127 | end |
| 128 | | 128 | |
| 129 | def config_additional_entries | 129 | def config_additional_entries |
| 130 | css('.VARIABLELIST dt[id]').map do |node| | 130 | css('.variablelist dt[id]').map do |node| |
| 131 | name = node.at_css('.VARNAME').content | 131 | name = node.at_css('.varname').content |
| 132 | ["Config: #{name}", node['id']] | 132 | ["Config: #{name}", node['id']] |
| 133 | end | 133 | end |
| 134 | end | 134 | end |
| @@ -136,27 +136,27 @@ module Docs · 1 unmodified line |
| 136 | def data_types_additional_entries | 136 | def data_types_additional_entries |
| 137 | selector = case slug | 137 | selector = case slug |
| 138 | when 'rangetypes' | 138 | when 'rangetypes' |
| 139 | 'li > p > .TYPE:first-child' | 139 | 'li > p > .type:first-child' |
| 140 | when 'datatype-textsearch' | 140 | when 'datatype-textsearch' |
| 141 | '.SECT2 > .TYPE' | 141 | '.title > .type, .sect2 > .type' |
| 142 | else | 142 | else |
| 143 | '.CALSTABLE td:first-child > .TYPE' | 143 | '.table-contents td:first-child > .type, .calstable td:first-child > .type' |
| 144 | end | 144 | end |
| 145 | get_custom_entries(selector) | 145 | get_custom_entries(selector) |
| 146 | end | 146 | end |
| 147 | | 147 | |
| 148 | def command_additional_entries | 148 | def command_additional_entries |
| 149 | css('.REFSECT2[id^="SQL"]').each_with_object([]) do |node, entries| | 149 | css('.refsect2[id^="SQL"]').each_with_object([]) do |node, entries| |
| 150 | next unless heading = node.at_css('h3') | 150 | next unless heading = node.at_css('h3') |
| 151 | next unless heading.content.strip =~ /[A-Z_\-]+ Clause/ | 151 | next unless heading.content.strip =~ /[A-Z_\-]+ Clause/ |
| 152 | name = heading.at_css('.LITERAL').content | 152 | name = heading.at_css('.literal').content |
| 153 | name.prepend "#{self.name} ... " | 153 | name.prepend "#{self.name} ... " |
| 154 | entries << [name, node['id']] | 154 | entries << [name, node['id']] |
| 155 | end | 155 | end |
| 156 | end | 156 | end |
| 157 | | 157 | |
| 158 | def include_default_entry? | 158 | def include_default_entry? |
| 159 | !initial_page? && !at_css('.TOC') && type | 159 | !initial_page? && (!at_css('.toc') || at_css('.sect2, .variablelist, .refsect1')) && type |
| 160 | end | 160 | end |
| 161 | | 161 | |
| 162 | SKIP_ENTRIES_SLUGS = [ | 162 | SKIP_ENTRIES_SLUGS = [ |
| @@ -199,7 +199,9 @@ module Docs · 36 unmodified lines |
| 199 | css(selector).each_with_object([]) do |node, entries| | 199 | css(selector).each_with_object([]) do |node, entries| |
| 200 | name = node.content | 200 | name = node.content |
| 201 | clean_heading_name(name) | 201 | clean_heading_name(name) |
| 202 | entries << ["#{additional_entry_prefix}: #{name}", node['id']] unless skip_heading?(name) | 202 | id = node['id'] || node.parent['id'] |
| | 203 | raise "missing ids for selector #{selector}" unless id |
| | 204 | entries << ["#{additional_entry_prefix}: #{name}", id] unless skip_heading?(name) |
| 203 | end | 205 | end |
| 204 | end | 206 | end |
| 205 | | 207 | |