Skip to content

Commit 8fd21cc

Browse files
committed
Update Bash documentation (5.3)
1 parent 9b010af commit 8fd21cc

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/docs/filters/bash/clean_html.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ class CleanHtmlFilter < Filter
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 @@ def call
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def get_name
1515
name.gsub!(/[[:digit:]]/, '')
1616
end
1717

18+
name.remove! '¶'
1819
name.strip
1920

2021
end
@@ -38,7 +39,7 @@ def additional_entries
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 = {

0 commit comments

Comments
 (0)