diff --git a/lib/docs/filters/homebrew/clean_html.rb b/lib/docs/filters/homebrew/clean_html.rb index 5bf6aa29..6a81a5c6 100644 --- a/lib/docs/filters/homebrew/clean_html.rb +++ b/lib/docs/filters/homebrew/clean_html.rb @@ -4,6 +4,11 @@ module Docs def call css('hr') + if at_css('h1').nil? + title = current_url.normalized_path[1..-1].gsub(/-/, ' ') + doc.children.before("

#{title}

") + end + css('div.highlighter-rouge').each do |node| lang = node['class'][/language-(\w+)/, 1] node['data-language'] = lang if lang diff --git a/lib/docs/filters/homebrew/entries.rb b/lib/docs/filters/homebrew/entries.rb index 03650ad9..c698cf72 100644 --- a/lib/docs/filters/homebrew/entries.rb +++ b/lib/docs/filters/homebrew/entries.rb @@ -2,7 +2,8 @@ module Docs class Homebrew class EntriesFilter < Docs::EntriesFilter def get_name - name = at_css('h1').content.strip + header = at_css('h1') + name = header.nil? ? current_url.normalized_path[1..-1].gsub(/-/, ' ') : header.content.strip name.remove! %r{\(.*} name end @@ -16,6 +17,7 @@ module Docs Python-for-Formula-Authors Migrating-A-Formula-To-A-Tap Rename-A-Formula + Building-Against-Non-Homebrew-Dependencies How-to-Create-and-Maintain-a-Tap Brew-Test-Bot Prose-Style-Guidelines) diff --git a/lib/docs/scrapers/homebrew.rb b/lib/docs/scrapers/homebrew.rb index 9dd1581a..5743735f 100644 --- a/lib/docs/scrapers/homebrew.rb +++ b/lib/docs/scrapers/homebrew.rb @@ -2,7 +2,7 @@ module Docs class Homebrew < UrlScraper self.name = 'Homebrew' self.type = 'simple' - self.release = '1.8.1' + self.release = '2.1.9' self.base_url = 'https://docs.brew.sh/' self.links = { home: 'https://brew.sh',