diff --git a/Gemfile.lock b/Gemfile.lock index 0ee3e99a..a708f12b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,9 +56,9 @@ GEM logger (1.6.1) method_source (1.0.0) mini_portile2 (2.8.7) - minitest (5.25.1) + minitest (5.25.2) multi_json (1.15.0) - mustermann (3.0.0) + mustermann (3.0.3) ruby2_keywords (~> 0.0.1) newrelic_rpm (8.16.0) nokogiri (1.16.7) @@ -88,8 +88,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) redcarpet (3.6.0) - rexml (3.2.9) - strscan + rexml (3.3.9) rouge (1.11.1) rr (3.1.1) rss (0.3.1) @@ -125,7 +124,6 @@ GEM unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) - strscan (1.0.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) terser (1.2.4) @@ -135,7 +133,7 @@ GEM eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) thor (1.3.2) - tilt (2.3.0) + tilt (2.4.0) tty-pager (0.14.0) strings (~> 0.2.0) tty-screen (~> 0.8) diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index e56bd8dd..052f4918 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2024-11-23", + "New documentation: DuckDB" + ], [ "2024-08-20", "New documentation: Linux man pages" diff --git a/assets/javascripts/templates/pages/help_tmpl.js b/assets/javascripts/templates/pages/help_tmpl.js index 2fa186c8..e155d829 100644 --- a/assets/javascripts/templates/pages/help_tmpl.js +++ b/assets/javascripts/templates/pages/help_tmpl.js @@ -3,7 +3,7 @@ app.templates.helpPage = function () { const navKey = $.isMac() ? "cmd" : "alt"; const arrowScroll = app.settings.get("arrowScroll"); - const aliases = Object.entries(app.models.Entry.ALIASES); + const aliases = Object.entries(app.config.docs_aliases); const middle = Math.ceil(aliases.length / 2); const aliases_one = aliases.slice(0, middle); const aliases_two = aliases.slice(middle); diff --git a/lib/docs/filters/duckdb/attribution.rb b/lib/docs/filters/duckdb/attribution.rb new file mode 100644 index 00000000..7591fdb8 --- /dev/null +++ b/lib/docs/filters/duckdb/attribution.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Docs + class Duckdb + class AttributionFilter < Docs::AttributionFilter + def attribution_link + url = current_url.to_s.sub! 'http://localhost:8000', 'https://duckdb.org' + %(#{url}) + end + end + end +end diff --git a/lib/docs/filters/duckdb/clean_html.rb b/lib/docs/filters/duckdb/clean_html.rb new file mode 100644 index 00000000..d739275e --- /dev/null +++ b/lib/docs/filters/duckdb/clean_html.rb @@ -0,0 +1,40 @@ +module Docs + class Duckdb + class CleanHtmlFilter < Filter + def call + # First extract the main content + @doc = at_css('#main_content_wrap', 'main') + return doc if @doc.nil? + + doc.prepend_child at_css('.title').remove + at_css('.title').name = 'h1' + + # Remove navigation and header elements + css('.headerline', '.headlinebar', '.landingmenu', '.search_icon', '#sidebar', '.pagemeta', '.toc_menu', '.section-nav').remove + + # Clean up code blocks + css('div.highlighter-rouge').each do |node| + node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class'] + node.content = node.content.strip + node.name = 'pre' + end + + # Remove unnecessary attributes + css('div, span, p').each do |node| + node.remove_attribute('style') + node.remove_attribute('class') + end + + # Remove empty elements + css('div, span').each do |node| + node.remove if node.content.strip.empty? + end + + # Remove script tags + css('script').remove + + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/duckdb/entries.rb b/lib/docs/filters/duckdb/entries.rb new file mode 100644 index 00000000..cb98768a --- /dev/null +++ b/lib/docs/filters/duckdb/entries.rb @@ -0,0 +1,45 @@ +module Docs + class Duckdb + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1', '.title').content + end + + def get_type + case subpath + when /\Asql\// + 'SQL Reference' + when /\Aapi\// + 'Client APIs' + when /\Aguides\// + 'How-to Guides' + when /\Adata\// + 'Data Import' + when /\Aoperations_manual\// + 'Operations Manual' + when /\Adev\// + 'Development' + when /\Ainternals\// + 'Internals' + when /\Aextensions\// + 'Extensions' + when /\Aarchive\// + 'Archive' + else + 'Documentation' + end + end + + def additional_entries + entries = [] + css('h2[id]', 'h3[id]').each do |node| + name = node.content.strip + # Clean up the name + name = name.gsub(/[\r\n\t]/, ' ').squeeze(' ') + entries << [name, node['id'], get_type] + end + entries + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/eslint/clean_html.rb b/lib/docs/filters/eslint/clean_html.rb index 0737acef..f347cef9 100644 --- a/lib/docs/filters/eslint/clean_html.rb +++ b/lib/docs/filters/eslint/clean_html.rb @@ -5,6 +5,7 @@ module Docs @doc = at_css('#main') if at_css('#main') @doc = at_css('.docs-main__content') if at_css('.docs-main__content') + css('.docs-toc').remove css('.eslint-ad').remove css('.glyphicon').remove css('hr', 'colgroup', 'td:empty').remove diff --git a/lib/docs/filters/eslint/entries.rb b/lib/docs/filters/eslint/entries.rb index f5f0f345..e40cd7a5 100644 --- a/lib/docs/filters/eslint/entries.rb +++ b/lib/docs/filters/eslint/entries.rb @@ -10,7 +10,12 @@ module Docs if subpath.start_with?('rules') return 'Rules' else - at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content + type = at_css('nav.docs-index [aria-current="true"]').ancestors('li')[-1].at_css('a').content + # This specific entry is mispelled with a lowercase 'i' + if type.start_with?('integrate') + type = type.sub('integrate', 'Integrate') + end + return type end end end diff --git a/lib/docs/filters/sequelize/clean_html.rb b/lib/docs/filters/sequelize/clean_html.rb index a7d9bc05..62e89b00 100644 --- a/lib/docs/filters/sequelize/clean_html.rb +++ b/lib/docs/filters/sequelize/clean_html.rb @@ -2,7 +2,7 @@ module Docs class Sequelize class CleanHtmlFilter < Filter def call - @doc = at_css('article', '.content') + @doc = at_css('article', '.content .self-detail', '.content') if at_css('header > h1') # Pull the header out of its container diff --git a/lib/docs/filters/svelte/clean_html.rb b/lib/docs/filters/svelte/clean_html.rb index 693825f7..cdc929ea 100644 --- a/lib/docs/filters/svelte/clean_html.rb +++ b/lib/docs/filters/svelte/clean_html.rb @@ -2,11 +2,23 @@ module Docs class Svelte class CleanHtmlFilter < Filter def call - @doc = at_css('main .page.content') + @doc = at_css('main .page.content #docs-content') + + # Remove title header + at_css('> header > div.breadcrumbs').remove() + # Remove extra input toggle + at_css('> aside.on-this-page input').remove() + # Remove "edit this page" link + at_css('> p.edit').remove() + # Remove footer navigation + at_css('> div.controls').remove() + at_css('h1').content = 'Svelte' if root_page? css('pre').each do |node| + # Remove hover popup + node.css('.twoslash-popup-container').remove() node.content = node.css('.line').map(&:content).join("\n") - node['data-language'] = 'javascript' + node['data-language'] = 'typescript' end doc end diff --git a/lib/docs/filters/svelte/entries.rb b/lib/docs/filters/svelte/entries.rb index dcd66cc2..c349898a 100644 --- a/lib/docs/filters/svelte/entries.rb +++ b/lib/docs/filters/svelte/entries.rb @@ -2,29 +2,14 @@ module Docs class Svelte class EntriesFilter < Docs::EntriesFilter def get_type - at_css('ul.sidebar > li:has(.active) > span.section').content + page = at_css("main nav ul.sidebar li ul li a[href$='#{result[:path]}']") + category = page.ancestors('li')[1] + return category.css('h3').inner_text end - def additional_entries - subtype = nil - css('aside').remove - css('.category').remove - css('.controls').remove - css('.edit').remove - css('.permalink').remove - css('h2, h3, h4').each_with_object [] do |node, entries| - if node.name == 'h2' - subtype = nil - elsif node.name == 'h3' - subtype = node.content.strip - subtype = nil unless subtype[/Component directives|Element directives/] - end - next if type == 'Before we begin' - name = node.content.strip - name.concat " (#{subtype})" if subtype && node.name == 'h4' - next if name.starts_with?('Example') - entries << [name, node['id'], get_type] - end + def get_name + page = at_css("main nav ul.sidebar li ul li a[href$='#{result[:path]}']") + return page.inner_text end end end diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb index a7aeb472..fba2c4c3 100644 --- a/lib/docs/filters/wordpress/clean_html.rb +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -8,15 +8,29 @@ module Docs end article = at_css('article[id^="post-"]') - @doc = at_css('article[id^="post-"]') unless article.nil? - - css('hr', '.screen-reader-text', '.table-of-contents', - '.anchor', '.toc-jump', '.source-code-links', '.user-notes', - '.show-more', '.hide-more').remove - - header = at_css('h1') - header.content = header.content.strip - doc.prepend_child header + @doc = article unless article.nil? + + css( + 'hr', + '.screen-reader-text', + '.table-of-contents', + '.anchor', + '.toc-jump', + '.source-code-links', + '.user-notes', + '.show-more', + '.hide-more', + '.wp-block-wporg-sidebar-container', + 'section[data-nosnippet="true"]', + # 'section:contains("before being able to contribute a note or feedback")', + ).remove + + if at_css('.entry-content') + header = at_css('h1') + header.remove_attribute('style') + @doc = at_css('.entry-content') + doc.prepend_child header + end # Remove permalink css('h2 > a, h3 > a').each do |node| diff --git a/lib/docs/filters/wordpress/entries.rb b/lib/docs/filters/wordpress/entries.rb index ba539d67..8acca62a 100644 --- a/lib/docs/filters/wordpress/entries.rb +++ b/lib/docs/filters/wordpress/entries.rb @@ -2,11 +2,13 @@ module Docs class Wordpress class EntriesFilter < Docs::EntriesFilter def get_name - at_css('.breadcrumbs .trail-end').content + at_css('h1').content end def get_type - if subpath.starts_with?('classes') + if subpath.starts_with?('classes') and subpath.count('/') == 3 + 'Methods' + elsif subpath.starts_with?('classes') 'Classes' elsif subpath.starts_with?('hooks') 'Hooks' diff --git a/lib/docs/filters/yarn/clean_html_berry.rb b/lib/docs/filters/yarn/clean_html_berry.rb index 96b3ee53..8a28ce25 100644 --- a/lib/docs/filters/yarn/clean_html_berry.rb +++ b/lib/docs/filters/yarn/clean_html_berry.rb @@ -2,45 +2,18 @@ module Docs class Yarn class CleanHtmlBerryFilter < Filter def call - if slug.empty? - @doc = at_css('main') - css( - (['div:first-child'] * 3).join('>'), # Tagline - 'img', - 'hr', # Footer - 'hr + div', # Footer - ).remove - - css('a').each do |link| - link.name = 'div' - link.css('h3').each do |node| - node.replace("

#{node.content}

") - end - end - - return doc - end - - @doc = at_css('article') - # Heading & edit link - css('h1', 'h1 + a').remove unless slug.start_with?('configuration') - - if slug.start_with?('cli') - css('.header-code').each do |node| - node.name = 'span' - end - end - - if slug.start_with?('configuration') - css('h1', 'h2').each do |node| - node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } - end - end + @doc = at_css('main .container div.theme-doc-markdown.markdown') css('*').each do |node| node.remove_attribute('style') end + css('pre').each do |node| + lang = node['class'][/language-(\w+)/, 1] + node['data-language'] = lang if lang + node.content = node.css('.token-line').map(&:content).join("\n") + end + doc end end diff --git a/lib/docs/filters/yarn/entries_berry.rb b/lib/docs/filters/yarn/entries_berry.rb index 44c1e18e..6b99bfa6 100644 --- a/lib/docs/filters/yarn/entries_berry.rb +++ b/lib/docs/filters/yarn/entries_berry.rb @@ -2,26 +2,11 @@ module Docs class Yarn class EntriesBerryFilter < Docs::EntriesFilter def get_name - if slug.start_with?('configuration') - filename = at_css('main .active code') - content = filename.content - return filename.parent.content.sub content, " (#{content})" - end - - name = at_css('h1').content - - if slug.start_with?('getting-started') - active_link = at_css('main .active') - links = active_link.parent.children.to_a - name.prepend "#{links.index(active_link) + 1}. " - end - - name + at_css('main header h1').content end def get_type - return 'CLI' if slug.start_with?('sdks', 'pnpify') - at_css('header .active').content + at_css('nav.navbar a.navbar__item.navbar__link.navbar__link--active').content end end end diff --git a/lib/docs/scrapers/cmake.rb b/lib/docs/scrapers/cmake.rb index cf14b562..bb2e4aae 100644 --- a/lib/docs/scrapers/cmake.rb +++ b/lib/docs/scrapers/cmake.rb @@ -16,10 +16,39 @@ module Docs options[:skip_patterns] = [/\Agenerator/, /\Acpack_gen/, /\Ainclude/, /\Arelease/, /tutorial\/(\w*%20)+/] options[:attribution] = <<-HTML - © 2000–2023 Kitware, Inc. and Contributors
+ © 2000–2024 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License. HTML + version do + self.base_url = "https://cmake.org/cmake/help/latest/" + end + + version '3.31' do + self.release = '3.31' + self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" + end + + version '3.30' do + self.release = '3.30' + self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" + end + + version '3.29' do + self.release = '3.29' + self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" + end + + version '3.28' do + self.release = '3.28' + self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" + end + + version '3.27' do + self.release = '3.27' + self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" + end + version '3.26' do self.release = '3.26' self.base_url = "https://cmake.org/cmake/help/v#{self.version}/" diff --git a/lib/docs/scrapers/duckdb.rb b/lib/docs/scrapers/duckdb.rb new file mode 100644 index 00000000..98fb16ed --- /dev/null +++ b/lib/docs/scrapers/duckdb.rb @@ -0,0 +1,42 @@ +module Docs + class Duckdb < UrlScraper + self.name = 'DuckDB' + self.type = 'duckdb' + self.root_path = 'index.html' + self.links = { + home: 'https://duckdb.org/', + code: 'https://github.com/duckdb/duckdb' + } + + # https://duckdb.org/docs/guides/offline-copy.html + # curl -O https://duckdb.org/duckdb-docs.zip; bsdtar xf duckdb-docs.zip; cd duckdb-docs; python -m http.server + self.release = '1.1.3' + self.base_url = 'http://localhost:8000/docs/' + + html_filters.push 'duckdb/entries', 'duckdb/clean_html' + text_filters.replace 'attribution', 'duckdb/attribution' + + options[:container] = '.documentation' + + options[:skip_patterns] = [ + /installation/, + /archive/, + /reference/, + ] + + options[:skip] = %w( + docs/archive/ + docs/installation/ + docs/api/ + ) + + options[:attribution] = <<-HTML + © Copyright 2018–2024 Stichting DuckDB Foundation
+ Licensed under the MIT License. + HTML + + def get_latest_version(opts) + get_github_tags('duckdb', 'duckdb', opts)[0]['name'] + end + end +end diff --git a/lib/docs/scrapers/eslint.rb b/lib/docs/scrapers/eslint.rb index 6d069839..e3243171 100644 --- a/lib/docs/scrapers/eslint.rb +++ b/lib/docs/scrapers/eslint.rb @@ -2,9 +2,9 @@ module Docs class Eslint < UrlScraper self.name = 'ESLint' self.type = 'simple' - self.release = '8.56.0' + self.release = '9.15.0' self.base_url = 'https://eslint.org/docs/latest/' - self.root_path = 'user-guide/getting-started' + self.root_path = '/' self.links = { home: 'https://eslint.org/', code: 'https://github.com/eslint/eslint' @@ -14,7 +14,22 @@ module Docs options[:skip_patterns] = [/maintain/, /migrating/, /migrate/, /\Aversions/, /rule-deprecation/] options[:skip] = %w(about about/ versions) - options[:replace_paths] = { 'user-guide' => 'user-guide/' } + # A number of paths have a trailing slash, causing them to be suffixed by "index" during the NormalizePathsFilter + options[:replace_paths] = { + 'configure/' => 'configure', + 'contribute/' => 'contribute', + 'contribute/architecture/' => 'contribute/architecture', + 'extend/' => 'extend', + 'flags/' => 'flags', + 'integrate/' => 'integrate', + 'rules/' => 'rules', + 'use/' => 'use', + 'use/formatters/' => 'use/formatters', + 'use/configure/' => 'use/configure', + 'use/configure/rules/' => 'use/configure/rules', + 'use/core-concepts/' => 'use/core-concepts', + 'use/troubleshooting/' => 'use/troubleshooting', + } options[:attribution] = <<-HTML © OpenJS Foundation and other contributors
diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb index 1486642c..5e30998c 100644 --- a/lib/docs/scrapers/matplotlib.rb +++ b/lib/docs/scrapers/matplotlib.rb @@ -20,8 +20,8 @@ module Docs Licensed under the Matplotlib License Agreement. HTML - version '3.7' do - self.release = '3.7.1' + version do + self.release = '3.9.2' self.base_urls = [ "https://matplotlib.org/stable/api/", "https://matplotlib.org/stable/mpl_toolkits/mplot3d/", @@ -29,6 +29,24 @@ module Docs ] end + version '3.8' do + self.release = '3.8.4' + self.base_urls = [ + "https://matplotlib.org/#{release}/api/", + "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", + "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" + ] + end + + version '3.7' do + self.release = '3.7.5' + self.base_urls = [ + "https://matplotlib.org/#{release}/api/", + "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", + "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" + ] + end + version '3.6' do self.release = '3.6.0' self.base_urls = [ diff --git a/lib/docs/scrapers/mdn/javascript.rb b/lib/docs/scrapers/mdn/javascript.rb index 48b0d1cd..e6aabdb1 100644 --- a/lib/docs/scrapers/mdn/javascript.rb +++ b/lib/docs/scrapers/mdn/javascript.rb @@ -3,7 +3,7 @@ module Docs prepend FixInternalUrlsBehavior prepend FixRedirectionsBehavior - # release = '2024-08-20' + # release = '2024-11-18' self.name = 'JavaScript' self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference' self.links = { diff --git a/lib/docs/scrapers/php.rb b/lib/docs/scrapers/php.rb index 6d38c70c..b9900e82 100644 --- a/lib/docs/scrapers/php.rb +++ b/lib/docs/scrapers/php.rb @@ -5,7 +5,7 @@ module Docs self.name = 'PHP' self.type = 'php' - self.release = '8.3' + self.release = '8.4' self.base_url = 'https://www.php.net/manual/en/' self.root_path = 'index.html' self.initial_paths = %w( @@ -62,7 +62,7 @@ module Docs options[:skip_patterns] = [/mysqlnd/, /xdevapi/i] options[:attribution] = <<-HTML - © 1997–2023 The PHP Documentation Group
+ © 1997–2024 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later. HTML diff --git a/lib/docs/scrapers/playwright.rb b/lib/docs/scrapers/playwright.rb index 2d4aa891..c8e2c70e 100644 --- a/lib/docs/scrapers/playwright.rb +++ b/lib/docs/scrapers/playwright.rb @@ -2,7 +2,7 @@ module Docs class Playwright < UrlScraper self.name = 'Playwright' self.type = 'simple' - self.release = '1.46.1' + self.release = '1.49.0' self.base_url = 'https://playwright.dev/docs/' self.root_path = 'intro' self.links = { diff --git a/lib/docs/scrapers/rxjs.rb b/lib/docs/scrapers/rxjs.rb index 69d2fffc..83827f97 100644 --- a/lib/docs/scrapers/rxjs.rb +++ b/lib/docs/scrapers/rxjs.rb @@ -4,7 +4,7 @@ module Docs class Rxjs < UrlScraper self.name = 'RxJS' self.type = 'rxjs' - self.release = '7.5.5' + self.release = '7.8.1' self.base_url = 'https://rxjs.dev/' self.root_path = 'guide/overview' self.links = { @@ -16,7 +16,7 @@ module Docs options[:follow_links] = false options[:only_patterns] = [/guide\//, /api\//] - options[:skip_patterns] = [/api\/([^\/]+)\.json/] + options[:skip_patterns] = [/api\/([^\/]+)\.json/, /api\/index/] options[:fix_urls_before_parse] = ->(url) do url.sub! %r{\A(\.\/)?guide/}, '/guide/' url.sub! %r{\Aapi/}, '/api/' diff --git a/lib/docs/scrapers/sequelize.rb b/lib/docs/scrapers/sequelize.rb index f170abfe..8410c7ef 100644 --- a/lib/docs/scrapers/sequelize.rb +++ b/lib/docs/scrapers/sequelize.rb @@ -30,7 +30,7 @@ module Docs end version '6' do - self.release = '6.23.2' + self.release = '6.37.5' self.base_url = "https://sequelize.org/docs/v6/" self.base_urls = [ "https://sequelize.org/docs/v6/", diff --git a/lib/docs/scrapers/support_tables.rb b/lib/docs/scrapers/support_tables.rb index 4318edf3..e181fd8f 100644 --- a/lib/docs/scrapers/support_tables.rb +++ b/lib/docs/scrapers/support_tables.rb @@ -7,7 +7,7 @@ module Docs self.name = 'Support Tables' self.slug = 'browser_support_tables' self.type = 'support_tables' - self.release = '1.0.30001642' + self.release = '1.0.30001680' self.base_url = 'https://github.com/Fyrd/caniuse/raw/main/' # https://github.com/Fyrd/caniuse/blob/main/LICENSE diff --git a/lib/docs/scrapers/svelte.rb b/lib/docs/scrapers/svelte.rb index c5900a0b..aac87389 100644 --- a/lib/docs/scrapers/svelte.rb +++ b/lib/docs/scrapers/svelte.rb @@ -3,26 +3,28 @@ module Docs self.name = 'Svelte' self.slug = 'svelte' self.type = 'simple' + self.root_path = '/' self.links = { home: 'https://svelte.dev/', code: 'https://github.com/sveltejs/svelte' } - self.root_path = 'introduction' options[:root_title] = 'Svelte' # https://github.com/sveltejs/svelte/blob/master/LICENSE.md options[:attribution] = <<-HTML - © 2016–2023 Rich Harris and contributors
+ © 2016–2024 Rich Harris and contributors
Licensed under the MIT License. HTML - options[:skip] = %w(team.html plugins/) - - self.base_url = 'https://svelte.dev/docs/' + self.base_url = 'https://svelte.dev/docs/svelte/' html_filters.push 'svelte/entries', 'svelte/clean_html' - + version do + self.release = '5.2.3' + end + + version '4' do self.release = '4.2.1' end diff --git a/lib/docs/scrapers/vite.rb b/lib/docs/scrapers/vite.rb index e6ed5203..937d0916 100644 --- a/lib/docs/scrapers/vite.rb +++ b/lib/docs/scrapers/vite.rb @@ -22,10 +22,15 @@ module Docs html_filters.push 'vite/entries', 'vite/clean_html' version do - self.release = '5.4.11' + self.release = '6.0.1' self.base_url = 'https://vite.dev/' end + version '5' do + self.release = '5.4.11' + self.base_url = 'https://v5.vite.dev/' + end + version '4' do self.release = '4.5.5' self.base_url = 'https://v4.vite.dev/' diff --git a/lib/docs/scrapers/wordpress.rb b/lib/docs/scrapers/wordpress.rb index b15a4fd0..beb23cee 100644 --- a/lib/docs/scrapers/wordpress.rb +++ b/lib/docs/scrapers/wordpress.rb @@ -2,7 +2,7 @@ module Docs class Wordpress < UrlScraper self.name = 'WordPress' self.type = 'wordpress' - self.release = '6.1' + self.release = '6.7' self.base_url = 'https://developer.wordpress.org/reference/' self.initial_paths = %w( functions/ @@ -17,7 +17,7 @@ module Docs html_filters.push 'wordpress/entries', 'wordpress/clean_html' - options[:container] = '#content-area' + options[:container] = 'main' options[:trailing_slash] = false options[:only_patterns] = [ /\Afunctions\//, @@ -32,7 +32,7 @@ module Docs ] options[:attribution] = <<-HTML - © 2003–2022 WordPress Foundation
+ © 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License. HTML diff --git a/lib/docs/scrapers/yarn.rb b/lib/docs/scrapers/yarn.rb index 8cc49260..6539c7d5 100644 --- a/lib/docs/scrapers/yarn.rb +++ b/lib/docs/scrapers/yarn.rb @@ -12,17 +12,30 @@ module Docs Licensed under the BSD License. HTML - version 'Berry' do - self.release = '3.1.1' + version do + self.release = '4.5.1' self.base_url = 'https://yarnpkg.com/' self.links = { home: 'https://yarnpkg.com/', code: 'https://github.com/yarnpkg/berry' } + self.root_path = 'getting-started' + html_filters.push 'yarn/entries_berry', 'yarn/clean_html_berry' + options[:skip] = ['cli', 'cli/builder', 'cli/pnpify', 'cli/sdks', 'protocols'] + options[:skip_patterns] = [/\Aapi/, /\Ablog/, /\Apackage/, /\Aassets/] + end + + version '3' do + self.release = '3.1.1' + self.base_url = 'https://v3.yarnpkg.com/' + self.links = { + home: 'https://v3.yarnpkg.com/', + code: 'https://github.com/yarnpkg/berry' + } + self.root_path = 'getting-started' html_filters.push 'yarn/entries_berry', 'yarn/clean_html_berry', 'title' options[:skip] = ['features', 'cli', 'configuration', 'advanced'] - options[:skip_patterns] = [/\Aapi/, /\Apackage/] - end + options[:skip_patterns] = [/\Aapi/, /\Apackage/] end version 'Classic' do self.release = '1.22.17' @@ -38,5 +51,13 @@ module Docs def get_latest_version(opts) get_latest_github_release('yarnpkg', 'berry', opts)[/[\d.]+/] end + + private + + # Some pages contain null bytes and cause the parser to fail + def parse(response) + response.body.gsub!(/[\x00\u0000\0]/, '') + super + end end end diff --git a/public/icons/docs/cmake/16.png b/public/icons/docs/cmake/16.png index fe82b4bc..b0591445 100644 Binary files a/public/icons/docs/cmake/16.png and b/public/icons/docs/cmake/16.png differ diff --git a/public/icons/docs/cmake/16@2x.png b/public/icons/docs/cmake/16@2x.png index 4dcfc24c..78df82f1 100644 Binary files a/public/icons/docs/cmake/16@2x.png and b/public/icons/docs/cmake/16@2x.png differ diff --git a/public/icons/docs/cmake/SOURCE b/public/icons/docs/cmake/SOURCE index dbfc5e62..1f16be4c 100644 --- a/public/icons/docs/cmake/SOURCE +++ b/public/icons/docs/cmake/SOURCE @@ -1 +1 @@ -https://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=Source/QtDialog/CMakeSetup.ico;hb=refs/heads/master +https://gitlab.kitware.com/cmake/cmake/-/blob/v3.31.0/Source/QtDialog/CMakeSetup32.png diff --git a/public/icons/docs/duckdb/16.png b/public/icons/docs/duckdb/16.png new file mode 100644 index 00000000..855df72e Binary files /dev/null and b/public/icons/docs/duckdb/16.png differ diff --git a/public/icons/docs/duckdb/16@2x.png b/public/icons/docs/duckdb/16@2x.png new file mode 100644 index 00000000..f128c8ca Binary files /dev/null and b/public/icons/docs/duckdb/16@2x.png differ diff --git a/public/icons/docs/duckdb/SOURCE b/public/icons/docs/duckdb/SOURCE new file mode 100644 index 00000000..286d1738 --- /dev/null +++ b/public/icons/docs/duckdb/SOURCE @@ -0,0 +1 @@ +https://github.com/duckdb/duckdb/tree/main/logo \ No newline at end of file