From 4096bf94190321a76deaf68e398ff3e4ef69cbd2 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 8 Dec 2024 11:48:25 +0100 Subject: [PATCH] Update GCC documentation (14.2.0) --- lib/docs/filters/gnu/clean_html.rb | 3 +++ lib/docs/filters/gnu/entries.rb | 1 + lib/docs/scrapers/gnu/gcc.rb | 14 ++++++++++++-- lib/docs/scrapers/gnu/gnu_fortran.rb | 7 ++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/docs/filters/gnu/clean_html.rb b/lib/docs/filters/gnu/clean_html.rb index 46971266..2966198c 100644 --- a/lib/docs/filters/gnu/clean_html.rb +++ b/lib/docs/filters/gnu/clean_html.rb @@ -2,7 +2,10 @@ module Docs class Gnu class CleanHtmlFilter < Filter def call + css('.nav-panel', '.copiable-link').remove heading = at_css('h1, h2, h3, h4, h5') + heading.content = heading.content + doc.prepend_child heading.remove heading_level = heading.name[/h(\d)/, 1].to_i css('h2, h3, h4, h5, h6').each do |node| diff --git a/lib/docs/filters/gnu/entries.rb b/lib/docs/filters/gnu/entries.rb index 5e3aab48..d17e5438 100644 --- a/lib/docs/filters/gnu/entries.rb +++ b/lib/docs/filters/gnu/entries.rb @@ -11,6 +11,7 @@ module Docs def get_name name = at_css('h1').content name.sub! %r{\A([\d\.]*\d)}, '\1.' + name.remove! %r{\s*¶} name.split('—').first.strip end diff --git a/lib/docs/scrapers/gnu/gcc.rb b/lib/docs/scrapers/gnu/gcc.rb index 732e88e8..2d19b120 100644 --- a/lib/docs/scrapers/gnu/gcc.rb +++ b/lib/docs/scrapers/gnu/gcc.rb @@ -46,13 +46,23 @@ module Docs 'Wtrigraphs.html' => 'Invocation.html' } + version '14' do + self.release = '14.2.0' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" + end + + version '14 CPP' do + self.release = '14.2.0' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" + end + version '13' do - self.release = '13.1.0' + self.release = '13.3.0' self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" end version '13 CPP' do - self.release = '13.1.0' + self.release = '13.3.0' self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" end diff --git a/lib/docs/scrapers/gnu/gnu_fortran.rb b/lib/docs/scrapers/gnu/gnu_fortran.rb index 757db49a..43e3f4f4 100644 --- a/lib/docs/scrapers/gnu/gnu_fortran.rb +++ b/lib/docs/scrapers/gnu/gnu_fortran.rb @@ -6,8 +6,13 @@ module Docs home: 'https://gcc.gnu.org/fortran/' } + version '14' do + self.release = '14.2.0' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" + end + version '13' do - self.release = '13.1.0' + self.release = '13.3.0' self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" end