Clear errors.

Filter empty pages in `process_response?`.
pull/1717/head
xjkdev 3 years ago
parent 6448e19c12
commit c31d71150f

@ -8,12 +8,6 @@ module Docs
downtitle = title.downcase
name = get_name
# Remove Empty pages.
if content.include?('TODO: write this dox page!') ||
content.blank? || content.empty?
return nil
end
if slug.include?('unsupported')
return 'Unsupported'
elsif slug.start_with?('Topic') || downtitle.end_with?("topics")
@ -90,7 +84,7 @@ module Docs
href = node.at_css("a").attr('href')
if not href.include?("#") and (name == 'Eigen' || type = "Classes") then
if not href.include?("#") and (name == 'Eigen' || type == "Classes") then
next
end
if slug.include?('unsupported')

@ -36,7 +36,7 @@ module Docs
HTML
# Skip source code since it doesn't provide any useful docs
options[:skip_patterns] = [/_source/, /-members/, /__Reference\.html/, /_chapter\.html/,]
options[:skip_patterns] = [/_source/, /-members/, /__Reference\.html/, /_chapter\.html/, /\.txt/, /\.tgz/]
# TODO: replace cppreference
# options[:replace_urls] = { 'http://en.cppreference.com/w/cpp/' => 'cpp/' }
@ -65,5 +65,12 @@ module Docs
response.body.gsub! '<div class="fragment">', '<pre class="fragment" data-language="cpp">'
super
end
def process_response?(response)
return false unless super
# Remove Empty pages.
response.body.index(/<div class="contents">[\r\n\s]*<\/div>/m).nil? and \
response.body.index(/<p>TODO: write this dox page!<\/p>/).nil?
end
end
end

Loading…
Cancel
Save