dart.rb 969 B

12345678910111213141516171819202122232425262728293031323334
  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.sub(/(([^\/]+)\/\.\.)/, '')
  13. end
  14. options[:attribution] = <<-HTML
  15. &copy; 2012, the Dart project authors<br>
  16. Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
  17. HTML
  18. # Download the documentation from https://www.dartlang.org/tools/sdk/archive
  19. version '1' do
  20. self.release = '1.24.3'
  21. self.dir = '/home/jasper/Documents/dart-docs-1.24.3'
  22. end
  23. version '2' do
  24. self.release = '2.0.0-dev.68.0'
  25. self.dir = '/home/jasper/Documents/dart-docs-2.0.0-dev.68.0'
  26. end
  27. end
  28. end