From 8fd21ccc6bab57ae6ba3ecfa17e78e5ebac29384 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 29 Jul 2025 18:39:06 +0200 Subject: [PATCH] Update Bash documentation (5.3) --- lib/docs/filters/bash/clean_html.rb | 8 ++++---- lib/docs/filters/bash/entries.rb | 3 ++- lib/docs/scrapers/bash.rb | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/docs/filters/bash/clean_html.rb b/lib/docs/filters/bash/clean_html.rb index 1baf1629c1..206ecce40b 100644 --- a/lib/docs/filters/bash/clean_html.rb +++ b/lib/docs/filters/bash/clean_html.rb @@ -4,16 +4,16 @@ class CleanHtmlFilter < Filter def call @doc = at_css('> div[id]') if at_css('> div[id]') # Remove the navigation header and footer and the lines underneath and above it - at_css('.header + hr').remove + at_css('.nav-panel + hr').remove line_above = at_xpath('//div[@class="header"]/preceding::hr[1]') line_above.remove unless line_above.nil? - css('.header').remove + css('.nav-panel').remove css('.copiable-anchor').remove # Remove chapter and section numbers from title title_node = at_css('h1, h2, h3, h4, h5, h6') - title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip + title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').gsub('¶', '').strip title_node.name = 'h1' # Remove the "D. " from names like "D. Concept Index" and "D. Function Index" @@ -52,7 +52,7 @@ def call end # Remove the rows with a horizontal line in them from the index tables - css('td[colspan="4"]').remove + css('td[colspan="3"]').remove # Remove additional text from menu entry and index entry cells css('td[valign=top]').each do |node| diff --git a/lib/docs/filters/bash/entries.rb b/lib/docs/filters/bash/entries.rb index c22316a2c2..f892fc86a1 100644 --- a/lib/docs/filters/bash/entries.rb +++ b/lib/docs/filters/bash/entries.rb @@ -15,6 +15,7 @@ def get_name name.gsub!(/[[:digit:]]/, '') end + name.remove! '¶' name.strip end @@ -38,7 +39,7 @@ def additional_entries entries = [] - css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node| + css('dt > a').each_slice(2) do |entry_node, section_node| entry_name = entry_node.content entry_path = entry_node['href'] entries << [entry_name, entry_path, entry_type] diff --git a/lib/docs/scrapers/bash.rb b/lib/docs/scrapers/bash.rb index 3c91a05608..2c0295625e 100644 --- a/lib/docs/scrapers/bash.rb +++ b/lib/docs/scrapers/bash.rb @@ -1,7 +1,7 @@ module Docs class Bash < FileScraper self.type = 'bash' - self.release = '5.2' + self.release = '5.3' self.base_url = 'https://www.gnu.org/software/bash/manual/html_node' self.root_path = 'index.html' self.links = {