Unified · Split
| @@ -1,9 +0,0 @@ | ||
| 1 | −#= require views/pages/base | |
| 2 | − | |
| 3 | −class app.views.GithubPage extends app.views.BasePage | |
| 4 | − LANGUAGE_RGX = /highlight-source-(\w+)/ | |
| 5 | − | |
| 6 | − prepare: -> | |
| 7 | − for el in @findAll('pre.highlight') | |
| 8 | − @highlightCode(el, el.className.match(LANGUAGE_RGX)[1]) | |
| 9 | − return | |
| @@ -28,6 +28,7 @@ app.views.EmberPage = · 27 unmodified lines | ||
| 28 | 28 | app.views.ErlangPage = |
| 29 | 29 | app.views.ExpressPage = |
| 30 | 30 | app.views.FlowPage = |
| 31 | +app.views.GithubPage = | |
| 31 | 32 | app.views.GoPage = |
| 32 | 33 | app.views.ImmutablePage = |
| 33 | 34 | app.views.InfluxdataPage = |
| @@ -8,11 +8,15 @@ module Docs · 7 unmodified lines | ||
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | css('.highlight > pre').each do |node| |
| 11 | − node['class'] = node.parent['class'] | |
| 11 | + node['data-language'] = node.parent['class'][/highlight-source-(\w+)/, 1] | |
| 12 | 12 | node.content = node.content.strip_heredoc.gsub(' ', ' ') |
| 13 | 13 | node.parent.replace(node) |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | + css('pre > code').each do |node| | |
| 17 | + node.before(node.children).remove | |
| 18 | + end | |
| 19 | + | |
| 16 | 20 | doc |
| 17 | 21 | end |
| 18 | 22 | end |
| @@ -8,6 +8,10 @@ module Docs · 7 unmodified lines | ||
| 8 | 8 | node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | + css('a > img').each do |node| | |
| 12 | + node.parent.before(node.parent.children).remove | |
| 13 | + end | |
| 14 | + | |
| 11 | 15 | doc |
| 12 | 16 | end |
| 13 | 17 | end |