typescript.rb 810 B

1234567891011121314151617181920212223242526272829
  1. module Docs
  2. class Typescript < UrlScraper
  3. self.name = 'TypeScript'
  4. self.type = 'typescript'
  5. self.release = '2.1.5'
  6. self.base_url = 'https://www.typescriptlang.org/docs/'
  7. self.root_path = 'tutorial.html'
  8. self.links = {
  9. home: 'https://www.typescriptlang.org',
  10. code: 'https://github.com/Microsoft/TypeScript'
  11. }
  12. html_filters.push 'typescript/entries', 'typescript/clean_html'
  13. options[:container] = '#content'
  14. options[:skip_link] = ->(node) { node.parent.parent['class'] == 'dropdown-menu' }
  15. options[:fix_urls] = ->(url) {
  16. url.sub!(/(\w+)\.md/) { "#{$1.downcase}.html" }
  17. url
  18. }
  19. options[:attribution] = <<-HTML
  20. &copy; Microsoft and other contributors<br>
  21. Licensed under the Apache License, Version 2.0.
  22. HTML
  23. end
  24. end