postgresql.rb 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. module Docs
  2. class Postgresql < UrlScraper
  3. self.name = 'PostgreSQL'
  4. self.type = 'postgres'
  5. self.release = '9.4'
  6. self.base_url = "http://www.postgresql.org/docs/#{release}/static/"
  7. self.root_path = 'reference.html'
  8. self.initial_paths = %w(sql.html admin.html)
  9. html_filters.insert_before 'normalize_urls', 'postgresql/extract_metadata'
  10. html_filters.push 'postgresql/clean_html', 'postgresql/entries', 'title'
  11. options[:title] = false
  12. options[:root_title] = 'PostgreSQL'
  13. options[:follow_links] = ->(filter) { filter.initial_page? }
  14. options[:only] = %w(
  15. arrays.html
  16. rowtypes.html
  17. rangetypes.html
  18. transaction-iso.html
  19. explicit-locking.html
  20. applevel-consistency.html
  21. locking-indexes.html
  22. config-setting.html
  23. locale.html
  24. collation.html
  25. multibyte.html
  26. using-explain.html
  27. planner-stats.html
  28. explicit-joins.html
  29. populate.html
  30. non-durability.html
  31. logfile-maintenance.html
  32. continuous-archiving.html
  33. dynamic-trace.html)
  34. options[:only_patterns] = [
  35. /\Asql\-/,
  36. /\Aapp\-/,
  37. /\Addl\-/,
  38. /\Adml\-/,
  39. /\Aqueries\-/,
  40. /\Adatatype\-/,
  41. /\Afunctions\-/,
  42. /\Atypeconv\-/,
  43. /\Atextsearch\-/,
  44. /\Amvcc\-/,
  45. /\Aindexes\-/,
  46. /\Aruntime\-config\-/,
  47. /\Aauth\-/,
  48. /\Aclient\-authentication/,
  49. /\Amanage\-ag/,
  50. /\Aroutine/,
  51. /\Abackup\-/,
  52. /\Amonitoring\-/,
  53. /\Awal\-/,
  54. /\Adisk/,
  55. /role/,
  56. /recovery/,
  57. /standby/]
  58. options[:skip] = %w(
  59. ddl-others.html
  60. functions-event-triggers.html
  61. functions-trigger.html
  62. textsearch-migration.html)
  63. options[:attribution] = <<-HTML
  64. &copy; 1996&ndash;2014 The PostgreSQL Global Development Group<br>
  65. Licensed under the PostgreSQL License.
  66. HTML
  67. end
  68. end