erlang.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module Docs
  2. class Erlang < FileScraper
  3. self.version = '18.1'
  4. self.type = 'erlang'
  5. self.dir = File.expand_path('~/devdocs/erlang')
  6. self.base_url = 'http://www.erlang.org/doc/'
  7. self.root_path = 'doc/index.html'
  8. self.links = {
  9. home: 'http://erlang.org/'
  10. }
  11. html_filters.push 'erlang/entries', 'erlang/clean_html'
  12. # The folder structure of the offline documentation
  13. # differs from the online structure. We need
  14. # to replace the attribution filter to generate the
  15. # right attribution_link
  16. text_filters.replace 'attribution', 'erlang/attribution'
  17. # Do not scrape these unnecessary links
  18. options[:skip_patterns] = [
  19. /\.pdf$/,
  20. /users_guide\.html$/,
  21. /release_notes\.html$/,
  22. /\/html\/.*_app\.html$/,
  23. /\/html\/unicode_usage\.html$/,
  24. /\/html\/io_protocol\.html$/
  25. ]
  26. options[:title] = false
  27. # Scrape stdlib documentation only
  28. options[:only_patterns] = [/stdlib/]
  29. options[:attribution] = <<-HTML
  30. Copyright &copy; 1999-2015 Ericsson AB<br>
  31. Licensed under the Apache License, Version 2.0.
  32. HTML
  33. end
  34. end