1
0

elixir.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. module Docs
  2. class Elixir < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'Elixir'
  5. self.type = 'elixir'
  6. self.release = '1.3.4'
  7. self.base_urls = ['http://elixir-lang.org/docs/stable/', 'http://elixir-lang.org/getting-started/']
  8. self.root_path = 'elixir/api-reference.html'
  9. self.initial_paths = %w(
  10. eex/EEx.html
  11. ex_unit/ExUnit.html
  12. iex/IEx.html
  13. logger/Logger.html
  14. mix/Mix.html
  15. )
  16. self.links = {
  17. home: 'http://elixir-lang.org/',
  18. code: 'https://github.com/elixir-lang/elixir'
  19. }
  20. html_filters.push 'elixir/clean_html', 'elixir/entries', 'title'
  21. options[:container] = ->(filter) {
  22. filter.current_url.path.start_with?('/getting-started') ? '#main' : '#content'
  23. }
  24. options[:title] = false
  25. options[:root_title] = 'Elixir'
  26. options[:attribution] = <<-HTML
  27. &copy; 2012&ndash;2016 Plataformatec<br>
  28. Licensed under the Apache License, Version 2.0.
  29. HTML
  30. def initial_urls
  31. super.tap { |urls| urls.last << 'introduction.html' }
  32. end
  33. end
  34. end