mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
53 lines
1.5 KiB
![]()
9 years ago
|
module Docs
|
||
|
class Tensorflow < UrlScraper
|
||
|
self.name = 'TensorFlow'
|
||
|
self.type = 'tensorflow'
|
||
![]()
8 years ago
|
self.root_path = 'index.html'
|
||
![]()
9 years ago
|
self.links = {
|
||
|
home: 'https://www.tensorflow.org/',
|
||
|
code: 'https://github.com/tensorflow/tensorflow'
|
||
|
}
|
||
![]()
9 years ago
|
|
||
![]()
9 years ago
|
html_filters.push 'tensorflow/entries', 'tensorflow/clean_html'
|
||
![]()
9 years ago
|
|
||
![]()
8 years ago
|
options[:max_image_size] = 300_000
|
||
![]()
8 years ago
|
options[:container] = '.devsite-main-content'
|
||
![]()
9 years ago
|
|
||
|
options[:attribution] = <<-HTML
|
||
![]()
5 years ago
|
© 2019 The TensorFlow Authors. All rights reserved.<br>
|
||
![]()
8 years ago
|
Licensed under the Creative Commons Attribution License 3.0.<br>
|
||
|
Code samples licensed under the Apache 2.0 License.
|
||
![]()
9 years ago
|
HTML
|
||
![]()
9 years ago
|
|
||
![]()
5 years ago
|
version '2.1' do
|
||
|
self.release = '2.1.0'
|
||
|
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
|
||
![]()
9 years ago
|
end
|
||
|
|
||
![]()
5 years ago
|
version '2.0' do
|
||
|
self.release = '2.0.0'
|
||
|
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
|
||
![]()
8 years ago
|
end
|
||
|
|
||
![]()
5 years ago
|
version '1.15' do
|
||
|
self.release = '1.15.0'
|
||
|
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
|
||
![]()
8 years ago
|
end
|
||
|
|
||
![]()
6 years ago
|
def get_latest_version(opts)
|
||
![]()
6 years ago
|
get_latest_github_release('tensorflow', 'tensorflow', opts)
|
||
![]()
6 years ago
|
end
|
||
|
|
||
![]()
8 years ago
|
private
|
||
|
|
||
|
def parse(response)
|
||
![]()
5 years ago
|
unless response.url == root_url
|
||
![]()
8 years ago
|
response.body.sub!(/<nav class="devsite-nav-responsive-sidebar.+?<\/nav>/m, '')
|
||
|
response.body.gsub!(/<li class="devsite-nav-item">.+?<\/li>/m, '')
|
||
|
end
|
||
![]()
8 years ago
|
|
||
![]()
8 years ago
|
super
|
||
![]()
9 years ago
|
end
|
||
![]()
9 years ago
|
end
|
||
|
end
|