tensorflow.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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] = '.devsite-main-content'
  13. options[:fix_urls] = ->(url) do
  14. url.sub! 'how_tos/../tutorials', 'tutorials'
  15. url
  16. end
  17. options[:attribution] = <<-HTML
  18. &copy; 2015 The TensorFlow Authors. All rights reserved.<br>
  19. Licensed under the Creative Commons Attribution License 3.0.<br>
  20. Code samples licensed under the Apache 2.0 License.
  21. HTML
  22. version 'Python' do
  23. self.base_url = 'https://www.tensorflow.org/api_docs/python/'
  24. self.release = '0.12'
  25. end
  26. version 'C++' do
  27. self.base_url = 'https://www.tensorflow.org/api_docs/cc/'
  28. self.release = '0.12'
  29. end
  30. version 'Guide' do
  31. self.base_url = 'https://www.tensorflow.org/'
  32. self.release = '0.12'
  33. self.root_path = 'tutorials/'
  34. self.initial_paths = %w(how_tos/)
  35. options[:only_patterns] = [/\Atutorials/, /\Ahow_tos/]
  36. end
  37. end
  38. end