dart.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. module Docs
  2. class Dart < FileScraper
  3. self.type = 'dart'
  4. self.root_path = 'index.html'
  5. self.links = {
  6. home: 'https://www.dartlang.org/',
  7. code: 'https://github.com/dart-lang/sdk'
  8. }
  9. html_filters.push 'dart/entries', 'dart/clean_html'
  10. options[:fix_urls] = ->(url) do
  11. # localhost/dart-web_audio/..dart-io/dart-io-library.html > localhost/dart-io/dart-io-library.html
  12. url.remove!(/[^\/]+\/\.\./)
  13. url
  14. end
  15. options[:attribution] = <<-HTML
  16. &copy; 2012 the Dart project authors<br>
  17. Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
  18. HTML
  19. # Download the documentation from https://www.dartlang.org/tools/sdk/archive
  20. version '2' do
  21. self.release = '2.0.0'
  22. self.dir = '/Users/Thibaut/DevDocs/Docs/Dart2'
  23. self.base_url = "https://api.dartlang.org/stable/#{release}/"
  24. end
  25. version '1' do
  26. self.release = '1.24.3'
  27. self.dir = '/Users/Thibaut/DevDocs/Docs/Dart1'
  28. self.base_url = "https://api.dartlang.org/stable/#{release}/"
  29. end
  30. end
  31. end