kotlin.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module Docs
  2. class Kotlin < UrlScraper
  3. self.type = 'kotlin'
  4. self.release = '1.2.41'
  5. self.base_url = 'https://kotlinlang.org/'
  6. self.root_path = 'api/latest/jvm/stdlib/index.html'
  7. self.links = {
  8. home: 'https://kotlinlang.org/',
  9. code: 'https://github.com/JetBrains/kotlin'
  10. }
  11. html_filters.push 'kotlin/entries', 'kotlin/clean_html'
  12. options[:container] = '.global-content'
  13. options[:only_patterns] = [/\Adocs\/tutorials\//, /\Adocs\/reference\//, /\Aapi\/latest\/jvm\/stdlib\//]
  14. options[:skip_patterns] = [/stdlib\/org\./]
  15. options[:skip] = %w(
  16. api/latest/jvm/stdlib/alltypes/index.html
  17. docs/
  18. docs/videos.html
  19. docs/events.html
  20. docs/resources.html
  21. docs/reference/grammar.html)
  22. options[:replace_paths] = { 'api/latest/jvm/stdlib/' => 'api/latest/jvm/stdlib/index.html' }
  23. options[:attribution] = <<-HTML
  24. &copy; 2010&ndash;2018 JetBrains s.r.o.<br>
  25. Licensed under the Apache License, Version 2.0.
  26. HTML
  27. def get_latest_version(opts)
  28. get_latest_github_release('JetBrains', 'kotlin', opts)['tag_name'][1..-1]
  29. end
  30. end
  31. end