elixir.rb 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. module Docs
  2. class Elixir < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'Elixir'
  5. self.type = 'elixir'
  6. self.root_path = 'api-reference.html'
  7. self.links = {
  8. home: 'http://elixir-lang.org/',
  9. code: 'https://github.com/elixir-lang/elixir'
  10. }
  11. html_filters.push 'elixir/clean_html', 'elixir/entries', 'title'
  12. options[:container] = ->(filter) {
  13. filter.current_url.path.start_with?('/getting-started') ? '#main' : '#content'
  14. }
  15. options[:title] = false
  16. options[:root_title] = 'Elixir'
  17. options[:attribution] = <<-HTML
  18. &copy; 2012&ndash;2017 Plataformatec<br>
  19. Licensed under the Apache License, Version 2.0.
  20. HTML
  21. def initial_urls
  22. [ "https://hexdocs.pm/elixir/#{self.class.release}/api-reference.html",
  23. "https://hexdocs.pm/eex/#{self.class.release}/EEx.html",
  24. "https://hexdocs.pm/ex_unit/#{self.class.release}/ExUnit.html",
  25. "https://hexdocs.pm/iex/#{self.class.release}/IEx.html",
  26. "https://hexdocs.pm/logger/#{self.class.release}/Logger.html",
  27. "https://hexdocs.pm/mix/#{self.class.release}/Mix.html",
  28. "http://elixir-lang.org/getting-started/introduction.html" ]
  29. end
  30. version '1.4' do
  31. self.release = '1.4.1'
  32. self.base_urls = [
  33. "https://hexdocs.pm/elixir/#{release}/",
  34. "https://hexdocs.pm/eex/#{release}/",
  35. "https://hexdocs.pm/ex_unit/#{release}/",
  36. "https://hexdocs.pm/iex/#{release}/",
  37. "https://hexdocs.pm/logger/#{release}/",
  38. "https://hexdocs.pm/mix/#{release}/",
  39. 'http://elixir-lang.org/getting-started/'
  40. ]
  41. end
  42. version '1.3' do
  43. self.release = '1.3.3'
  44. self.base_urls = [
  45. "https://hexdocs.pm/elixir/#{release}/",
  46. "https://hexdocs.pm/eex/#{release}/",
  47. "https://hexdocs.pm/ex_unit/#{release}/",
  48. "https://hexdocs.pm/iex/#{release}/",
  49. "https://hexdocs.pm/logger/#{release}/",
  50. "https://hexdocs.pm/mix/#{release}/",
  51. 'http://elixir-lang.org/getting-started/'
  52. ]
  53. end
  54. end
  55. end