Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 138 KiB |
@ -0,0 +1,5 @@
|
||||
._webpack {
|
||||
@extend %simple;
|
||||
|
||||
blockquote.tip { @extend %note-blue; }
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
module Docs
|
||||
class Webpack
|
||||
class CleanHtmlOldFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
doc
|
||||
end
|
||||
|
||||
def root
|
||||
@doc = at_css(".container > .row > .col-md-9")
|
||||
|
||||
# Remove all introdcution before the hr,
|
||||
# The introduction about the documentation site which isn't relevant
|
||||
# in devdocs.
|
||||
hr_index = doc.children.find_index { |node| node.name == "hr" }
|
||||
doc.children[0..hr_index].each(&:remove)
|
||||
end
|
||||
|
||||
|
||||
def other
|
||||
css('h1, h2, h3, h4').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }
|
||||
end
|
||||
|
||||
# Re-create the header element
|
||||
at_css("#wiki").child.before("<h1>#{at_css("#wikititle").content.titleize}</h1>")
|
||||
|
||||
@doc = at_css("#wiki")
|
||||
|
||||
css('.contents', 'a.anchor', 'hr').remove
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
node['data-language'] = 'javascript'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
module Docs
|
||||
class Webpack
|
||||
class EntriesOldFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
entry_link.content
|
||||
end
|
||||
|
||||
def get_type
|
||||
link_li = entry_link.parent
|
||||
type_links_list = link_li.parent
|
||||
current_type = type_links_list.parent
|
||||
|
||||
# current type is a
|
||||
# <li>
|
||||
# TYPE
|
||||
# <li> <ul> .. links .. </ul> </li>
|
||||
# </li>
|
||||
#
|
||||
# Grab the first children (which is the text nodes whose contains the type)
|
||||
current_type.children.first.content.strip.titleize
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def entry_link
|
||||
at_css("a[href='#{self.path}']")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/webpack/media
|