From aedb9c3b31fe95b4d303bdbf0d55b10d1278aee0 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Fri, 4 Nov 2022 22:11:01 +0100 Subject: [PATCH] Update Astro documentation (1.6.3) --- lib/docs/filters/astro/clean_html.rb | 5 +++++ lib/docs/filters/astro/entries.rb | 2 ++ lib/docs/scrapers/astro.rb | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/astro/clean_html.rb b/lib/docs/filters/astro/clean_html.rb index 245bf8b8..0bcccd22 100644 --- a/lib/docs/filters/astro/clean_html.rb +++ b/lib/docs/filters/astro/clean_html.rb @@ -5,6 +5,11 @@ module Docs @doc = at_css('article > section') css('.anchor-link').remove + css('.avatar-list').remove + + css('header > h1').each do |node| + node.parent.before(node).remove + end css('pre').each do |node| node.content = node.css('.line').map(&:content).join("\n") diff --git a/lib/docs/filters/astro/entries.rb b/lib/docs/filters/astro/entries.rb index c451058c..eef550b4 100644 --- a/lib/docs/filters/astro/entries.rb +++ b/lib/docs/filters/astro/entries.rb @@ -14,6 +14,8 @@ module Docs end def additional_entries + return if slug.start_with?('guides/deploy') + return if slug.start_with?('guides/integrations-guide') at_css('article').css('h2, h3').each_with_object [] do |node, entries| type = node.content.strip type.sub! %r{\s*#\s*}, '' diff --git a/lib/docs/scrapers/astro.rb b/lib/docs/scrapers/astro.rb index 1bf3e083..7529bc5f 100644 --- a/lib/docs/scrapers/astro.rb +++ b/lib/docs/scrapers/astro.rb @@ -14,7 +14,9 @@ module Docs Licensed under the MIT License. HTML - self.release = '1.4.7' + options[:skip_patterns] = [/tutorial/] + + self.release = '1.6.3' self.base_url = 'https://docs.astro.build/en/' self.initial_paths = %w(getting-started/)