c.rb 938 B

1234567891011121314151617181920212223242526272829
  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.sub! 'http://en.cppreference.com/upload.cppreference.com', 'http://upload.cppreference.com'
  18. url
  19. end
  20. options[:attribution] = <<-HTML
  21. &copy; cppreference.com<br>
  22. Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
  23. HTML
  24. end
  25. end