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 | app.views.ErlangPage = | 28 | app.views.ErlangPage = |
| 29 | app.views.ExpressPage = | 29 | app.views.ExpressPage = |
| 30 | app.views.FlowPage = | 30 | app.views.FlowPage = |
| 31 | app.views.GithubPage = | ||
| 31 | app.views.GoPage = | 32 | app.views.GoPage = |
| 32 | app.views.ImmutablePage = | 33 | app.views.ImmutablePage = |
| 33 | app.views.InfluxdataPage = | 34 | app.views.InfluxdataPage = |
| @@ -8,11 +8,15 @@ module Docs · 7 unmodified lines | |||
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | css('.highlight > pre').each do |node| | 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 | node.content = node.content.strip_heredoc.gsub(' ', ' ') | 12 | node.content = node.content.strip_heredoc.gsub(' ', ' ') |
| 13 | node.parent.replace(node) | 13 | node.parent.replace(node) |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | css('pre > code').each do |node| | ||
| 17 | node.before(node.children).remove | ||
| 18 | end | ||
| 19 | |||
| 16 | doc | 20 | doc |
| 17 | end | 21 | end |
| 18 | end | 22 | end |
| @@ -8,6 +8,10 @@ module Docs · 7 unmodified lines | |||
| 8 | node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } | 8 | node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | css('a > img').each do |node| | ||
| 12 | node.parent.before(node.parent.children).remove | ||
| 13 | end | ||
| 14 | |||
| 11 | doc | 15 | doc |
| 12 | end | 16 | end |
| 13 | end | 17 | end |