sqlite.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. module Docs
  2. class Sqlite < FileScraper
  3. self.name = 'SQLite'
  4. self.type = 'sqlite'
  5. self.release = '3.15.2'
  6. self.dir = '/Users/Thibaut/DevDocs/Docs/sqlite/'
  7. self.base_url = 'https://sqlite.org/'
  8. self.root_path = 'docs.html'
  9. self.initial_paths = %w(keyword_index.html)
  10. self.links = {
  11. home: 'https://sqlite.org/',
  12. code: 'https://www.sqlite.org/src/'
  13. }
  14. html_filters.insert_before 'clean_html', 'sqlite/clean_js_tables'
  15. html_filters.push 'sqlite/entries', 'sqlite/clean_html'
  16. options[:only_patterns] = [/\.html\z/]
  17. options[:skip_patterns] = [/releaselog/, /consortium/]
  18. options[:skip] = %w(
  19. index.html
  20. about.html
  21. download.html
  22. copyright.html
  23. support.html
  24. prosupport.html
  25. hp1.html
  26. news.html
  27. oldnews.html
  28. doclist.html
  29. dev.html
  30. chronology.html
  31. not-found.html
  32. famous.html
  33. books.html
  34. crew.html
  35. mostdeployed.html
  36. requirements.html
  37. session/intro.html
  38. syntax.html
  39. )
  40. options[:attribution] = 'SQLite is in the Public Domain.'
  41. private
  42. def parse(html)
  43. html.gsub! %r{(<h2[^>]*>[^<]+)</h1>}, '\1</h2>'
  44. super
  45. end
  46. end
  47. end