phoenix.rb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module Docs
  2. class Phoenix < UrlScraper
  3. self.type = 'elixir'
  4. self.release = '1.2.1'
  5. self.base_url = 'https://hexdocs.pm/'
  6. self.root_path = 'phoenix/Phoenix.html'
  7. self.initial_paths = %w(
  8. phoenix/api-reference.html
  9. ecto/api-reference.html
  10. phoenix_html/api-reference.html
  11. phoenix_pubsub/api-reference.html
  12. plug/api-reference.html)
  13. self.links = {
  14. home: 'http://www.phoenixframework.org',
  15. code: 'https://github.com/phoenixframework/phoenix'
  16. }
  17. html_filters.push 'elixir/clean_html', 'elixir/entries'
  18. options[:container] = '#content'
  19. options[:skip_patterns] = [/extra-api-reference/]
  20. options[:only_patterns] = [
  21. /\Aphoenix\//,
  22. /\Aecto\//,
  23. /\Aphoenix_pubsub\//,
  24. /\Aphoenix_html\//,
  25. /\Aplug\//
  26. ]
  27. options[:attribution] = -> (filter) {
  28. if filter.slug.start_with?('ecto')
  29. <<-HTML
  30. &copy; 2012 Plataformatec<br>
  31. Licensed under the Apache License, Version 2.0.
  32. HTML
  33. elsif filter.slug.start_with?('plug')
  34. <<-HTML
  35. &copy; 2013 Plataformatec<br>
  36. Licensed under the Apache License, Version 2.0.
  37. HTML
  38. else
  39. <<-HTML
  40. &copy; 2014 Chris McCord<br>
  41. Licensed under the MIT License.
  42. HTML
  43. end
  44. }
  45. end
  46. end