diff --git a/assets/javascripts/views/pages/simple.coffee b/assets/javascripts/views/pages/simple.coffee index 7715b737..adbc993c 100644 --- a/assets/javascripts/views/pages/simple.coffee +++ b/assets/javascripts/views/pages/simple.coffee @@ -12,6 +12,7 @@ app.views.MeteorPage = app.views.RamdaPage = app.views.ReactPage = app.views.RethinkdbPage = +app.views.TensorflowPage = app.views.TypescriptPage = app.views.UnderscorePage = app.views.SimplePage diff --git a/assets/javascripts/views/pages/tensorflow.coffee b/assets/javascripts/views/pages/tensorflow.coffee deleted file mode 100644 index 7321592f..00000000 --- a/assets/javascripts/views/pages/tensorflow.coffee +++ /dev/null @@ -1,7 +0,0 @@ -#= require views/pages/base - -class app.views.TensorflowPage extends app.views.BasePage - prepare: -> - @highlightCode @findAll('pre[class*="lang-c++"]'), 'cpp' - @highlightCode @findAll('pre.lang-python'), 'python' - return diff --git a/lib/docs/filters/tensorflow/clean_html.rb b/lib/docs/filters/tensorflow/clean_html.rb index 18a8e5a4..976843cb 100644 --- a/lib/docs/filters/tensorflow/clean_html.rb +++ b/lib/docs/filters/tensorflow/clean_html.rb @@ -9,6 +9,16 @@ module Docs node.parent.content = node.content end + css('pre').each do |node| + node.inner_html = node.inner_html.strip_heredoc + + if node['class'].include?('lang-c++') + node['data-language'] = 'cpp' + elsif node['class'].include?('lang-python') + node['data-language'] = 'python' + end + end + css('b').each do |node| node.before(node.children).remove end