mirror of https://github.com/freeCodeCamp/devdocs
parent
9c9b2aca0d
commit
cd55b861ca
@ -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
|
||||
© The TensorFlow Authors. All rights reserved.<br>
|
||||
Licensed under the Apache 2.0 License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 647 B |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1 @@
|
||||
https://www.tensorflow.org/images/favicon.png
|
Loading…
Reference in new issue