mirror of https://github.com/freeCodeCamp/devdocs
parent
850366459b
commit
89badcc9ed
@ -1,5 +0,0 @@
|
||||
._moment_timezone {
|
||||
> h2 { @extend %block-heading; }
|
||||
> h3 { @extend %block-label, %label-blue; }
|
||||
code { @extend %label; }
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
module Docs
|
||||
class MomentTimezone
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
# Set id attributes on headings
|
||||
css('a.docs-section-target', 'a.docs-method-target').each do |node|
|
||||
node.next_element['id'] = node['id']
|
||||
node.remove
|
||||
end
|
||||
|
||||
css('> article', '.docs-method-prose', '.docs-method-signature', 'h2 > a', 'h3 > a', 'pre > code').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('.docs-method-edit', 'hr').remove
|
||||
|
||||
css('pre').each do |node|
|
||||
if node.content =~ /\A</
|
||||
node['data-language'] = 'html'
|
||||
elsif node.content !~ /\A\d/
|
||||
node['data-language'] = 'javascript'
|
||||
end
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue