postgresql.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module Docs
  2. class Postgresql < UrlScraper
  3. include FixInternalUrlsBehavior
  4. self.name = 'PostgreSQL'
  5. self.type = 'postgres'
  6. self.root_path = 'reference.html'
  7. self.initial_paths = %w(sql.html admin.html internals.html appendixes.html tutorial.html)
  8. html_filters.insert_before 'normalize_urls', 'postgresql/extract_metadata'
  9. html_filters.push 'postgresql/clean_html', 'postgresql/entries', 'title'
  10. options[:title] = false
  11. options[:root_title] = 'PostgreSQL'
  12. options[:follow_links] = ->(filter) { filter.initial_page? }
  13. options[:skip] = %w(
  14. index.html
  15. ddl-others.html
  16. functions-event-triggers.html
  17. functions-trigger.html
  18. textsearch-migration.html
  19. supported-platforms.html
  20. error-message-reporting.html
  21. error-style-guide.html
  22. plhandler.html
  23. sourcerepo.html
  24. git.html
  25. bug-reporting.html
  26. client-interfaces.html)
  27. options[:skip_patterns] = [
  28. /\Ainstall/,
  29. /\Aregress/,
  30. /\Aprotocol/,
  31. /\Asource/,
  32. /\Anls/,
  33. /\Afdw/,
  34. /\Atablesample/,
  35. /\Acustom-scan/,
  36. /\Abki/,
  37. /\Arelease/,
  38. /\Acontrib-prog/,
  39. /\Aexternal/,
  40. /\Adocguide/,
  41. /\Afeatures/,
  42. /\Aunsupported-features/ ]
  43. options[:attribution] = <<-HTML
  44. &copy; 1996&ndash;2016 The PostgreSQL Global Development Group<br>
  45. Licensed under the PostgreSQL License.
  46. HTML
  47. version '9.6' do
  48. self.release = '9.6.0'
  49. self.base_url = 'https://www.postgresql.org/docs/9.6/static/'
  50. end
  51. version '9.5' do
  52. self.release = '9.5.4'
  53. self.base_url = 'https://www.postgresql.org/docs/9.5/static/'
  54. end
  55. version '9.4' do
  56. self.release = '9.4.9'
  57. self.base_url = 'https://www.postgresql.org/docs/9.4/static/'
  58. end
  59. end
  60. end