History

Update Bash documentation (5.3)

Simon Legner committed 1 year ago

Commit 8fd21cc1 parent 9b010af3 files · +7 −6Browse files

Unified · Split

3 files
  1. lib/docs/filters/bash/clean_html.rb +4 −4
  2. lib/docs/filters/bash/entries.rb +2 −1
  3. lib/docs/scrapers/bash.rb +1 −1
lib/docs/filters/bash/clean_html.rb+4−4
@@ -4,16 +4,16 @@ module Docs · 3 unmodified lines
44 def call
55 @doc = at_css('> div[id]') if at_css('> div[id]')
66 # Remove the navigation header and footer and the lines underneath and above it
7− at_css('.header + hr').remove
7+ at_css('.nav-panel + hr').remove
88 line_above = at_xpath('//div[@class="header"]/preceding::hr[1]')
99 line_above.remove unless line_above.nil?
10− css('.header').remove
10+ css('.nav-panel').remove
1111
1212 css('.copiable-anchor').remove
1313
1414 # Remove chapter and section numbers from title
1515 title_node = at_css('h1, h2, h3, h4, h5, h6')
16− title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip
16+ title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').gsub('¶', '').strip
1717 title_node.name = 'h1'
1818
1919 # Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
@@ -52,7 +52,7 @@ module Docs · 32 unmodified lines
5252 end
5353
5454 # Remove the rows with a horizontal line in them from the index tables
55− css('td[colspan="4"]').remove
55+ css('td[colspan="3"]').remove
5656
5757 # Remove additional text from menu entry and index entry cells
5858 css('td[valign=top]').each do |node|
lib/docs/filters/bash/entries.rb+2−1
@@ -15,6 +15,7 @@ module Docs · 14 unmodified lines
1515 name.gsub!(/[[:digit:]]/, '')
1616 end
1717
18+ name.remove! '¶'
1819 name.strip
1920
2021 end
@@ -38,7 +39,7 @@ module Docs · 17 unmodified lines
3839
3940 entries = []
4041
41− css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node|
42+ css('dt > a').each_slice(2) do |entry_node, section_node|
4243 entry_name = entry_node.content
4344 entry_path = entry_node['href']
4445 entries << [entry_name, entry_path, entry_type]
lib/docs/scrapers/bash.rb+1−1
@@ -1,7 +1,7 @@
11 module Docs
22 class Bash < FileScraper
33 self.type = 'bash'
4− self.release = '5.2'
4+ self.release = '5.3'
55 self.base_url = 'https://www.gnu.org/software/bash/manual/html_node'
66 self.root_path = 'index.html'
77 self.links = {