cpp.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. module Docs
  2. class Cpp < FileScraper
  3. self.name = 'C++'
  4. self.slug = 'cpp'
  5. self.type = 'c'
  6. self.dir = '/Users/Thibaut/DevDocs/Docs/C/cpp'
  7. self.base_url = 'http://en.cppreference.com/w/cpp/'
  8. self.root_path = 'header.html'
  9. html_filters.insert_before 'clean_html', 'c/fix_code'
  10. html_filters.push 'cpp/entries', 'c/clean_html', 'title'
  11. text_filters.push 'cpp/fix_urls'
  12. options[:container] = '#content'
  13. options[:title] = false
  14. options[:root_title] = 'C++ Programming Language'
  15. options[:skip] = %w(
  16. language/extending_std.html
  17. language/history.html
  18. regex/ecmascript.html
  19. regex/regex_token_iterator/operator_cmp.html
  20. )
  21. options[:skip_patterns] = [/experimental/]
  22. options[:only_patterns] = [/\.html\z/]
  23. options[:fix_urls] = ->(url) do
  24. url.sub! %r{\A.+/http%3A/}, 'http://'
  25. url.sub! 'http://en.cppreference.com/upload.cppreference.com', 'http://upload.cppreference.com'
  26. url
  27. end
  28. options[:attribution] = <<-HTML
  29. &copy; cppreference.com<br>
  30. Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
  31. HTML
  32. end
  33. end