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 downtitle = title.downcase
name = get_name 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') if slug.include?('unsupported')
return 'Unsupported' return 'Unsupported'
elsif slug.start_with?('Topic') || downtitle.end_with?("topics") elsif slug.start_with?('Topic') || downtitle.end_with?("topics")
@ -90,7 +84,7 @@ module Docs
href = node.at_css("a").attr('href') 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 next
end end
if slug.include?('unsupported') if slug.include?('unsupported')

@ -36,7 +36,7 @@ module Docs
HTML HTML
# Skip source code since it doesn't provide any useful docs # 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 # TODO: replace cppreference
# options[:replace_urls] = { 'http://en.cppreference.com/w/cpp/' => 'cpp/' } # 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">' response.body.gsub! '<div class="fragment">', '<pre class="fragment" data-language="cpp">'
super super
end 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
end end

Loading…
Cancel
Save