From 496225804b47414f1f3a786a9b8e1de6e6d4b10f Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Thu, 17 Nov 2022 21:44:44 +0100 Subject: [PATCH] axios: fix root_page --- lib/docs/filters/axios/clean_html.rb | 4 ++++ lib/docs/scrapers/axios.rb | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/docs/filters/axios/clean_html.rb b/lib/docs/filters/axios/clean_html.rb index e09c7ef4..ab71d1ad 100644 --- a/lib/docs/filters/axios/clean_html.rb +++ b/lib/docs/filters/axios/clean_html.rb @@ -2,6 +2,10 @@ module Docs class Axios class CleanHtmlFilter < Filter def call + if root_page? + return '

Axios

Promise based HTTP client for the browser and node.js

Axios is a simple promise based HTTP client for the browser and node.js. Axios provides a simple to use library in a small package with a very extensible interface.

' + end + @doc = at_css('main > .body') css('.links').remove css('pre').each do |node| node.content = node.content diff --git a/lib/docs/scrapers/axios.rb b/lib/docs/scrapers/axios.rb index cd2ddde1..ed1d63f2 100755 --- a/lib/docs/scrapers/axios.rb +++ b/lib/docs/scrapers/axios.rb @@ -7,12 +7,10 @@ module Docs } self.release = '1.1.3' self.base_url = "https://axios-http.com/docs/" - self.initial_paths = %w(intro) + self.initial_paths = %w(index intro) html_filters.push 'axios/entries', 'axios/clean_html' - options[:container] = 'main > .body' - # https://github.com/axios/axios-docs/blob/master/LICENSE options[:attribution] = <<-HTML © 2020-present John Jakob "Jake" Sarjeant
@@ -22,5 +20,11 @@ module Docs def get_latest_version(opts) get_latest_github_release('axios', 'axios', opts) end + + private + + def process_response?(response) + true + end end end