Add documentation for TensorFlow's python API

pull/382/head
Jonas Meinertz Hansen 9 years ago committed by Thibaut Courouble
parent 9c9b2aca0d
commit cd55b861ca

@ -76,6 +76,7 @@
'pages/sphinx',
'pages/sphinx_simple',
'pages/tcl_tk',
'pages/tensorflow',
'pages/underscore',
'pages/vagrant',
'pages/vue',

@ -76,6 +76,7 @@
'pages/sphinx',
'pages/sphinx_simple',
'pages/tcl_tk',
'pages/tensorflow',
'pages/underscore',
'pages/vagrant',
'pages/vue',

@ -0,0 +1,12 @@
._tensorflow {
h2, h3, h4 { @extend %block-heading, %label-blue; }
p > code, li > code { @extend %label; }
// These are used for lists of arguments and return values in the docs.
b > code {
@extend %label;
background-color: initial;
font-weight: 500;
font-size: 1.1em;
}
}

@ -0,0 +1,10 @@
module Docs
class Tensorflow
class CleanHtmlFilter < Filter
def call
css('hr').remove
doc
end
end
end
end

@ -0,0 +1,33 @@
module Docs
class Tensorflow
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content
end
def get_type
at_css('h1').content
end
def include_default_entry?
false
end
def additional_entries
entries = []
# Just get everything that is a code tag inside a header tag. I haven't
# checked if all of these are necessary.
ents = css('h5 code') + css('h4 code') + css('h3 code') + css('h2 code')
ents.each do |node|
name = node.content.sub(/\(.*\)/, '()')
id = node.parent['id']
entries << [name, id, get_name]
end
entries
end
end
end
end

@ -0,0 +1,18 @@
module Docs
class Tensorflow < UrlScraper
self.name = 'TensorFlow'
self.slug = 'tensorflow'
self.type = 'tensorflow'
self.release = '0.6.0-py'
self.base_url = 'https://www.tensorflow.org/versions/0.6.0/api_docs/python/'
options[:container] = '#content'
html_filters.push 'tensorflow/entries', 'tensorflow/clean_html', 'clean_html'
options[:attribution] = <<-HTML
&copy; The TensorFlow Authors. All rights reserved.<br>
Licensed under the Apache 2.0 License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1 @@
https://www.tensorflow.org/images/favicon.png
Loading…
Cancel
Save