From aafcac1fdec05b144b044b621987a039217f2259 Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 10 Feb 2024 17:46:41 -0800 Subject: [PATCH 1/2] Now generates output, still need to perfect filters --- lib/docs/scrapers/nextjs.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/docs/scrapers/nextjs.rb b/lib/docs/scrapers/nextjs.rb index b678caa4..299eb70c 100644 --- a/lib/docs/scrapers/nextjs.rb +++ b/lib/docs/scrapers/nextjs.rb @@ -1,10 +1,20 @@ module Docs class Nextjs < UrlScraper - self.name = 'nextjs`' + self.name = 'nextjs' self.type = 'simple' self.release = 'v14.1.0' self.base_url = 'https://nextjs.org/docs' - self.initial_paths = %w(reference/) - html_filters.push 'nextjs/entries', 'nextjs/clean_html' + self.initial_paths = %w(reference/) + self.links = { + home: 'https://www.nextjs.org/', + code: 'https://github.com/vercel/next.js' + } + + html_filters.push 'nextjs/entries', 'nextjs/clean_html' + + options[:attribution] = <<-HTML + © 2024 Vercel, Inc. + Licensed under the MIT License. + HTML end -end \ No newline at end of file +end From deb5f816549329f09299a6c044e8cd230c4e2f2b Mon Sep 17 00:00:00 2001 From: murphnomer Date: Tue, 13 Feb 2024 19:25:07 -0800 Subject: [PATCH 2/2] Fixed project name --- lib/docs/filters/nextjs/clean_html.rb | 2 +- lib/docs/scrapers/nextjs.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/nextjs/clean_html.rb b/lib/docs/filters/nextjs/clean_html.rb index 4f4f6240..2ff629df 100644 --- a/lib/docs/filters/nextjs/clean_html.rb +++ b/lib/docs/filters/nextjs/clean_html.rb @@ -3,7 +3,7 @@ module Docs class CleanHtmlFilter < Filter def call css('.zola-anchor').remove - doc.prepend_child("

htmx

") if root_page? + doc.prepend_child("

NextJS

") if root_page? css('div:contains("NEWS:")').remove css('h2:contains("sponsors"), #sponsor-table').remove doc diff --git a/lib/docs/scrapers/nextjs.rb b/lib/docs/scrapers/nextjs.rb index 299eb70c..a20cf800 100644 --- a/lib/docs/scrapers/nextjs.rb +++ b/lib/docs/scrapers/nextjs.rb @@ -1,6 +1,6 @@ module Docs class Nextjs < UrlScraper - self.name = 'nextjs' + self.name = 'NextJS' self.type = 'simple' self.release = 'v14.1.0' self.base_url = 'https://nextjs.org/docs'