1
0

tensorflow.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module Docs
  2. class Tensorflow < UrlScraper
  3. self.name = 'TensorFlow'
  4. self.type = 'tensorflow'
  5. self.root_path = 'index.html'
  6. self.force_gzip = true
  7. self.links = {
  8. home: 'https://www.tensorflow.org/',
  9. code: 'https://github.com/tensorflow/tensorflow'
  10. }
  11. html_filters.push 'tensorflow/entries', 'tensorflow/clean_html'
  12. options[:container] = '#content'
  13. options[:fix_urls] = ->(url) do
  14. url.sub! %r{\Ahttps://www.tensorflow.org/versions(.+)/([^\.\#]+)(#.*)?\z}, 'https://www.tensorflow.org/versions\1/\2.html\3'
  15. url
  16. end
  17. options[:attribution] = <<-HTML
  18. &copy; 2015 The TensorFlow Authors. All rights reserved.<br>
  19. Licensed under the Apache 2.0 License.
  20. HTML
  21. version 'Python' do
  22. self.base_url = 'https://www.tensorflow.org/versions/r0.11/api_docs/python/'
  23. self.release = '0.11'
  24. end
  25. version 'C++' do
  26. self.base_url = 'https://www.tensorflow.org/versions/r0.11/api_docs/cc/'
  27. self.release = '0.11'
  28. end
  29. version 'Guide' do
  30. self.base_url = 'https://www.tensorflow.org/versions/r0.11/'
  31. self.release = '0.11'
  32. self.root_path = 'tutorials/index.html'
  33. self.initial_paths = %w(how_tos/index.html)
  34. options[:only_patterns] = [/\Atutorials/, /\Ahow_tos/]
  35. end
  36. end
  37. end