[devdocsgjs/main: 1169/1867] Split Tensorflow into separate Python, C++ and Guide docs
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1169/1867] Split Tensorflow into separate Python, C++ and Guide docs
- Date: Fri, 19 Nov 2021 23:47:47 +0000 (UTC)
commit c7a2a37280005873436e9acff9b25fc2dd005ed0
Author: Lukas Geiger <lukas geiger94 gmail com>
Date: Sat Jan 25 01:10:13 2020 +0000
Split Tensorflow into separate Python, C++ and Guide docs
lib/docs/filters/tensorflow/entries.rb | 4 ++--
lib/docs/scrapers/{ => tensorflow}/tensorflow.rb | 21 ++++++++++-----------
lib/docs/scrapers/tensorflow/tensorflow_cpp.rb | 21 +++++++++++++++++++++
lib/docs/scrapers/tensorflow/tensorflow_guide.rb | 9 +++++++++
public/icons/docs/tensorflow_cpp/16.png | Bin 0 -> 599 bytes
public/icons/docs/tensorflow_cpp/16 2x png | Bin 0 -> 404 bytes
public/icons/docs/tensorflow_cpp/SOURCE | 1 +
public/icons/docs/tensorflow_guide/16.png | Bin 0 -> 599 bytes
public/icons/docs/tensorflow_guide/16 2x png | Bin 0 -> 404 bytes
public/icons/docs/tensorflow_guide/SOURCE | 1 +
10 files changed, 44 insertions(+), 13 deletions(-)
---
diff --git a/lib/docs/filters/tensorflow/entries.rb b/lib/docs/filters/tensorflow/entries.rb
index f71c6b7f..411510f2 100644
--- a/lib/docs/filters/tensorflow/entries.rb
+++ b/lib/docs/filters/tensorflow/entries.rb
@@ -15,9 +15,9 @@ module Docs
end
def get_type
- if version == 'Guide' and base_url.path.start_with?('/guide')
+ if base_url.path.start_with?('/guide')
'Guides'
- elsif version == 'Guide' and base_url.path.start_with?('/tutorials')
+ elsif base_url.path.start_with?('/tutorials')
'Tutorials'
elsif slug.start_with?('tf/audio')
'tf.audio'
diff --git a/lib/docs/scrapers/tensorflow.rb b/lib/docs/scrapers/tensorflow/tensorflow.rb
similarity index 69%
rename from lib/docs/scrapers/tensorflow.rb
rename to lib/docs/scrapers/tensorflow/tensorflow.rb
index 008afc54..cc4789a9 100644
--- a/lib/docs/scrapers/tensorflow.rb
+++ b/lib/docs/scrapers/tensorflow/tensorflow.rb
@@ -1,10 +1,7 @@
-# frozen_string_literal: true
-
module Docs
class Tensorflow < UrlScraper
self.name = 'TensorFlow'
self.type = 'tensorflow'
- self.release = '2.1'
self.root_path = 'index.html'
self.links = {
home: 'https://www.tensorflow.org/',
@@ -22,17 +19,19 @@ module Docs
Code samples licensed under the Apache 2.0 License.
HTML
- version 'Python' do
- self.base_url = 'https://www.tensorflow.org/api_docs/python/'
+ version '2.1' do
+ self.release = '2.1.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
end
- version 'C++' do
- self.base_url = 'https://www.tensorflow.org/api_docs/cc/'
+ version '2.0' do
+ self.release = '2.0.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
end
- version 'Guide' do
- include MultipleBaseUrls
- self.base_urls = ['https://www.tensorflow.org/guide/', 'https://www.tensorflow.org/tutorials/']
+ version '1.15' do
+ self.release = '1.15.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
end
def get_latest_version(opts)
@@ -42,7 +41,7 @@ module Docs
private
def parse(response)
- unless response.url == root_url || self.class.version == 'Guide'
+ unless response.url == root_url
response.body.sub!(/<nav class="devsite-nav-responsive-sidebar.+?<\/nav>/m, '')
response.body.gsub!(/<li class="devsite-nav-item">.+?<\/li>/m, '')
end
diff --git a/lib/docs/scrapers/tensorflow/tensorflow_cpp.rb b/lib/docs/scrapers/tensorflow/tensorflow_cpp.rb
new file mode 100644
index 00000000..73c16f41
--- /dev/null
+++ b/lib/docs/scrapers/tensorflow/tensorflow_cpp.rb
@@ -0,0 +1,21 @@
+module Docs
+ class TensorflowCpp < Tensorflow
+ self.name = 'TensorFlow C++'
+ self.slug = 'tensorflow_cpp'
+
+ version '2.1' do
+ self.release = '2.1.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
+ end
+
+ version '2.0' do
+ self.release = '2.0.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
+ end
+
+ version '1.15' do
+ self.release = '1.15.0'
+ self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
+ end
+ end
+end
diff --git a/lib/docs/scrapers/tensorflow/tensorflow_guide.rb
b/lib/docs/scrapers/tensorflow/tensorflow_guide.rb
new file mode 100644
index 00000000..736c2dec
--- /dev/null
+++ b/lib/docs/scrapers/tensorflow/tensorflow_guide.rb
@@ -0,0 +1,9 @@
+module Docs
+ class TensorflowGuide < Tensorflow
+ include MultipleBaseUrls
+
+ self.name = 'TensorFlow Guides'
+ self.slug = 'tensorflow_guide'
+ self.base_urls = ['https://www.tensorflow.org/guide/', 'https://www.tensorflow.org/tutorials/']
+ end
+end
diff --git a/public/icons/docs/tensorflow_cpp/16.png b/public/icons/docs/tensorflow_cpp/16.png
new file mode 100644
index 00000000..8463d569
Binary files /dev/null and b/public/icons/docs/tensorflow_cpp/16.png differ
diff --git a/public/icons/docs/tensorflow_cpp/16 2x png b/public/icons/docs/tensorflow_cpp/16 2x png
new file mode 100644
index 00000000..00a8af6d
Binary files /dev/null and b/public/icons/docs/tensorflow_cpp/16 2x png differ
diff --git a/public/icons/docs/tensorflow_cpp/SOURCE b/public/icons/docs/tensorflow_cpp/SOURCE
new file mode 100644
index 00000000..3d2bb927
--- /dev/null
+++ b/public/icons/docs/tensorflow_cpp/SOURCE
@@ -0,0 +1 @@
+https://www.tensorflow.org/images/favicon.png
\ No newline at end of file
diff --git a/public/icons/docs/tensorflow_guide/16.png b/public/icons/docs/tensorflow_guide/16.png
new file mode 100644
index 00000000..8463d569
Binary files /dev/null and b/public/icons/docs/tensorflow_guide/16.png differ
diff --git a/public/icons/docs/tensorflow_guide/16 2x png b/public/icons/docs/tensorflow_guide/16 2x png
new file mode 100644
index 00000000..00a8af6d
Binary files /dev/null and b/public/icons/docs/tensorflow_guide/16 2x png differ
diff --git a/public/icons/docs/tensorflow_guide/SOURCE b/public/icons/docs/tensorflow_guide/SOURCE
new file mode 100644
index 00000000..3d2bb927
--- /dev/null
+++ b/public/icons/docs/tensorflow_guide/SOURCE
@@ -0,0 +1 @@
+https://www.tensorflow.org/images/favicon.png
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]