postgresql.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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)
  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. options[:skip_patterns] = [
  24. /\Atutorial/,
  25. /\Ainstall/,
  26. /\Aregress/,
  27. /\Aprotocol/,
  28. /\Asource/,
  29. /\Anls/,
  30. /\Afdw/,
  31. /\Atablesample/,
  32. /\Acustom-scan/,
  33. /\Abki/ ]
  34. options[:attribution] = <<-HTML
  35. &copy; 1996&ndash;2016 The PostgreSQL Global Development Group<br>
  36. Licensed under the PostgreSQL License.
  37. HTML
  38. version '9.5' do
  39. self.release = '9.5'
  40. self.base_url = 'http://www.postgresql.org/docs/9.5/static/'
  41. end
  42. version '9.4' do
  43. self.release = '9.4'
  44. self.base_url = 'http://www.postgresql.org/docs/9.4/static/'
  45. end
  46. end
  47. end