c.rb 836 B

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