Unified · Split
| @@ -12,6 +12,7 @@ app.views.MeteorPage = · 11 unmodified lines | ||
| 12 | 12 | app.views.RamdaPage = |
| 13 | 13 | app.views.ReactPage = |
| 14 | 14 | app.views.RethinkdbPage = |
| 15 | +app.views.TensorflowPage = | |
| 15 | 16 | app.views.TypescriptPage = |
| 16 | 17 | app.views.UnderscorePage = |
| 17 | 18 | app.views.SimplePage |
| @@ -1,7 +0,0 @@ | ||
| 1 | −#= require views/pages/base | |
| 2 | − | |
| 3 | −class app.views.TensorflowPage extends app.views.BasePage | |
| 4 | − prepare: -> | |
| 5 | − @highlightCode @findAll('pre[class*="lang-c++"]'), 'cpp' | |
| 6 | − @highlightCode @findAll('pre.lang-python'), 'python' | |
| 7 | − return | |
| @@ -9,6 +9,16 @@ module Docs · 8 unmodified lines | ||
| 9 | 9 | node.parent.content = node.content |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | + css('pre').each do |node| | |
| 13 | + node.inner_html = node.inner_html.strip_heredoc | |
| 14 | + | |
| 15 | + if node['class'].include?('lang-c++') | |
| 16 | + node['data-language'] = 'cpp' | |
| 17 | + elsif node['class'].include?('lang-python') | |
| 18 | + node['data-language'] = 'python' | |
| 19 | + end | |
| 20 | + end | |
| 21 | + | |
| 12 | 22 | css('b').each do |node| |
| 13 | 23 | node.before(node.children).remove |
| 14 | 24 | end |