c.rb 792 B

123456789101112131415161718192021222324252627
  1. module Docs
  2. class C < FileScraper
  3. self.type = 'c'
  4. self.dir = '/Users/Thibaut/DevDocs/Docs/C/en/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[:fix_urls] = ->(url) do
  15. url.sub! %r{\A.+/http%3A/}, "http://"
  16. url
  17. end
  18. options[:attribution] = <<-HTML
  19. &copy; cppreference.com<br>
  20. Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
  21. HTML
  22. end
  23. end