Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -590,10 +590,10 @@ credits = [ · 589 unmodified lines | ||
| 590 | 590 | 'MIT', |
| 591 | 591 | 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' |
| 592 | 592 | ], [ |
| 593 | − 'Webpack', | |
| 593 | + 'webpack', | |
| 594 | 594 | '2012-2016 Tobias Koppers', |
| 595 | − 'MIT', | |
| 596 | − 'https://raw.githubusercontent.com/webpack/webpack/master/LICENSE' | |
| 595 | + 'CC BY', | |
| 596 | + 'https://creativecommons.org/licenses/by/4.0/' | |
| 597 | 597 | ], [ |
| 598 | 598 | 'Yarn', |
| 599 | 599 | '2016-2017 Yarn Contributors', |
| @@ -92,5 +92,6 @@ · 91 unmodified lines | ||
| 92 | 92 | 'pages/underscore', |
| 93 | 93 | 'pages/vagrant', |
| 94 | 94 | 'pages/vue', |
| 95 | + 'pages/webpack', | |
| 95 | 96 | 'pages/yard', |
| 96 | 97 | 'pages/yii'; |
| @@ -92,5 +92,6 @@ · 91 unmodified lines | ||
| 92 | 92 | 'pages/underscore', |
| 93 | 93 | 'pages/vagrant', |
| 94 | 94 | 'pages/vue', |
| 95 | + 'pages/webpack', | |
| 95 | 96 | 'pages/yard', |
| 96 | 97 | 'pages/yii'; |
| @@ -139,7 +139,7 @@ · 138 unmodified lines | ||
| 139 | 139 | ._icon-npm:before { background-position: -8rem -7rem; } |
| 140 | 140 | ._icon-apache_http_server:before { background-position: -9rem -7rem; } |
| 141 | 141 | ._icon-drupal:before { background-position: 0 -8rem; } |
| 142 | −._icon-webpack:before { background-position: -1rem -8rem; @extend %darkIconFix !optional; } | |
| 142 | +._icon-webpack:before { background-position: -1rem -8rem; } | |
| 143 | 143 | ._icon-phaser:before { background-position: -2rem -8rem; } |
| 144 | 144 | ._icon-vue:before { background-position: -3rem -8rem; } |
| 145 | 145 | ._icon-opentsdb:before { background-position: -4rem -8rem; } |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | h1, h2, h3 { margin-left: 0; } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | − p > code, li > code, td > code { @extend %label; } | |
| 15 | + p > code, li > code, td > code, blockquote > code { @extend %label; } | |
| 16 | 16 | blockquote { @extend %note; } |
| 17 | 17 | blockquote > h4, blockquote > h5 { margin-top: .25rem; } |
| 18 | 18 | } |
| @@ -37,7 +37,6 @@ · 18 unmodified lines | ||
| 37 | 37 | ._redux, |
| 38 | 38 | ._sinon, |
| 39 | 39 | ._typescript, |
| 40 | −._webpack, | |
| 41 | 40 | ._yarn { |
| 42 | 41 | @extend %simple; |
| 43 | 42 | } |
| @@ -0,0 +1,5 @@ | ||
| 1 | +._webpack { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | + blockquote.tip { @extend %note-blue; } | |
| 5 | +} | |
| @@ -2,37 +2,39 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Webpack |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − root_page? ? root : other | |
| 6 | − doc | |
| 7 | − end | |
| 5 | + @doc = at_css('.page__content') | |
| 8 | 6 | |
| 9 | − def root | |
| 10 | − @doc = at_css(".container > .row > .col-md-9") | |
| 7 | + at_css('h1').content = 'webpack' if root_page? | |
| 11 | 8 | |
| 12 | − # Remove all introdcution before the hr, | |
| 13 | − # The introduction about the documentation site which isn't relevant | |
| 14 | − # in devdocs. | |
| 15 | − hr_index = doc.children.find_index { |node| node.name == "hr" } | |
| 16 | − doc.children[0..hr_index].each(&:remove) | |
| 17 | − end | |
| 9 | + css('h3').each do |node| | |
| 10 | + node.name = 'h2' | |
| 11 | + end unless at_css('h2') | |
| 18 | 12 | |
| 19 | − | |
| 20 | − def other | |
| 21 | − css('h1, h2, h3, h4').each do |node| | |
| 22 | − node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } | |
| 13 | + css('.anchor[id]').each do |node| | |
| 14 | + node.parent['id'] = node['id'] | |
| 15 | + node.remove | |
| 23 | 16 | end |
| 24 | 17 | |
| 25 | − # Re-create the header element | |
| 26 | − at_css("#wiki").child.before("<h1>#{at_css("#wikititle").content.titleize}</h1>") | |
| 18 | + css('hr', '.page__edit', 'hr + h3:contains("Contributors")', 'hr + h2:contains("Contributors")', | |
| 19 | + '.contributors', '.icon-link', '#maintainers.header', '#maintainers.header + table', | |
| 20 | + '#maintainer.header', '#maintainer.header + table').remove | |
| 27 | 21 | |
| 28 | − @doc = at_css("#wiki") | |
| 22 | + css('> div', '.tip-content', '.header span').each do |node| | |
| 23 | + node.before(node.children).remove | |
| 24 | + end | |
| 29 | 25 | |
| 30 | − css('.contents', 'a.anchor', 'hr').remove | |
| 26 | + css('> h1:first-child + h1').remove | |
| 31 | 27 | |
| 32 | − css('pre').each do |node| | |
| 33 | − node.content = node.content | |
| 34 | − node['data-language'] = 'javascript' | |
| 28 | + css('.code-details-summary-span').each do |node| | |
| 29 | + node.content = node.content.remove(' (click to show)') | |
| 35 | 30 | end |
| 31 | + | |
| 32 | + css('pre > code').each do |node| | |
| 33 | + node.parent['data-language'] = node['class'][/lang-(\w+)/, 1].sub('jsx', 'js') if node['class'] | |
| 34 | + node.parent.content = node.parent.content | |
| 35 | + end | |
| 36 | + | |
| 37 | + doc | |
| 36 | 38 | end |
| 37 | 39 | end |
| 38 | 40 | end |
| @@ -0,0 +1,39 @@ | ||
| 1 | +module Docs | |
| 2 | + class Webpack | |
| 3 | + class CleanHtmlOldFilter < Filter | |
| 4 | + def call | |
| 5 | + root_page? ? root : other | |
| 6 | + doc | |
| 7 | + end | |
| 8 | + | |
| 9 | + def root | |
| 10 | + @doc = at_css(".container > .row > .col-md-9") | |
| 11 | + | |
| 12 | + # Remove all introdcution before the hr, | |
| 13 | + # The introduction about the documentation site which isn't relevant | |
| 14 | + # in devdocs. | |
| 15 | + hr_index = doc.children.find_index { |node| node.name == "hr" } | |
| 16 | + doc.children[0..hr_index].each(&:remove) | |
| 17 | + end | |
| 18 | + | |
| 19 | + | |
| 20 | + def other | |
| 21 | + css('h1, h2, h3, h4').each do |node| | |
| 22 | + node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } | |
| 23 | + end | |
| 24 | + | |
| 25 | + # Re-create the header element | |
| 26 | + at_css("#wiki").child.before("<h1>#{at_css("#wikititle").content.titleize}</h1>") | |
| 27 | + | |
| 28 | + @doc = at_css("#wiki") | |
| 29 | + | |
| 30 | + css('.contents', 'a.anchor', 'hr').remove | |
| 31 | + | |
| 32 | + css('pre').each do |node| | |
| 33 | + node.content = node.content | |
| 34 | + node['data-language'] = 'javascript' | |
| 35 | + end | |
| 36 | + end | |
| 37 | + end | |
| 38 | + end | |
| 39 | +end | |
| @@ -2,28 +2,38 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Webpack |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | − entry_link.content | |
| 5 | + name = at_css('h1').content | |
| 6 | + name.sub! ' - ', ': ' | |
| 7 | + name | |
| 6 | 8 | end |
| 7 | 9 | |
| 8 | − def get_type | |
| 9 | − link_li = entry_link.parent | |
| 10 | − type_links_list = link_li.parent | |
| 11 | − current_type = type_links_list.parent | |
| 10 | + TYPE_BY_DIRECTORY = { | |
| 11 | + 'get-started' => 'Getting Started', | |
| 12 | + 'concepts' => 'Concepts', | |
| 13 | + 'guides' => 'Guides', | |
| 14 | + 'api' => 'API', | |
| 15 | + 'configuration' => 'Configuration', | |
| 16 | + 'loaders' => 'Loaders', | |
| 17 | + 'plugins' => 'Plugins' | |
| 18 | + } | |
| 12 | 19 | |
| 13 | − # current type is a | |
| 14 | − # <li> | |
| 15 | − # TYPE | |
| 16 | − # <li> <ul> .. links .. </ul> </li> | |
| 17 | − # </li> | |
| 18 | − # | |
| 19 | − # Grab the first children (which is the text nodes whose contains the type) | |
| 20 | − current_type.children.first.content.strip.titleize | |
| 20 | + def get_type | |
| 21 | + TYPE_BY_DIRECTORY[slug.split('/').first] | |
| 21 | 22 | end |
| 22 | 23 | |
| 23 | − private | |
| 24 | − | |
| 25 | − def entry_link | |
| 26 | − at_css("a[href='#{self.path}']") | |
| 24 | + def additional_entries | |
| 25 | + if slug.start_with?('configuration') | |
| 26 | + css('h2[id] code').map do |node| | |
| 27 | + [node.content, node.parent['id']] | |
| 28 | + end | |
| 29 | + elsif slug.start_with?('api') | |
| 30 | + css('.header[id] code').each_with_object [] do |node, entries| | |
| 31 | + next if node.previous.try(:content).present? | |
| 32 | + entries << ["#{self.name}: #{node.content.sub(/\(.*\)/, '()')}", node.parent['id']] | |
| 33 | + end | |
| 34 | + else | |
| 35 | + [] | |
| 36 | + end | |
| 27 | 37 | end |
| 28 | 38 | end |
| 29 | 39 | end |
| @@ -0,0 +1,31 @@ | ||
| 1 | +module Docs | |
| 2 | + class Webpack | |
| 3 | + class EntriesOldFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + entry_link.content | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + link_li = entry_link.parent | |
| 10 | + type_links_list = link_li.parent | |
| 11 | + current_type = type_links_list.parent | |
| 12 | + | |
| 13 | + # current type is a | |
| 14 | + # <li> | |
| 15 | + # TYPE | |
| 16 | + # <li> <ul> .. links .. </ul> </li> | |
| 17 | + # </li> | |
| 18 | + # | |
| 19 | + # Grab the first children (which is the text nodes whose contains the type) | |
| 20 | + current_type.children.first.content.strip.titleize | |
| 21 | + end | |
| 22 | + | |
| 23 | + private | |
| 24 | + | |
| 25 | + def entry_link | |
| 26 | + at_css("a[href='#{self.path}']") | |
| 27 | + end | |
| 28 | + end | |
| 29 | + end | |
| 30 | +end | |
| 31 | + | |
| @@ -2,23 +2,72 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Webpack < UrlScraper |
| 3 | 3 | self.name = 'webpack' |
| 4 | 4 | self.type = 'webpack' |
| 5 | − self.release = '1.13.2' | |
| 6 | − self.base_url = 'https://webpack.github.io/docs/' | |
| 7 | − self.links = { | |
| 8 | − home: 'https://webpack.github.io/', | |
| 9 | − code: 'https://github.com/webpack/webpack' | |
| 10 | − } | |
| 11 | 5 | |
| 12 | − html_filters.push 'webpack/entries', 'webpack/clean_html', 'title' | |
| 6 | + version '2' do | |
| 7 | + self.release = '2.2.0' | |
| 8 | + self.base_url = 'https://webpack.js.org/' | |
| 9 | + self.root_path = 'get-started/' | |
| 10 | + self.initial_paths = %w( | |
| 11 | + concepts/ | |
| 12 | + guides/ | |
| 13 | + api/ | |
| 14 | + configuration/ | |
| 15 | + loaders/ | |
| 16 | + plugins/ | |
| 17 | + ) | |
| 18 | + self.links = { | |
| 19 | + home: 'https://webpack.js.org/', | |
| 20 | + code: 'https://github.com/webpack/webpack' | |
| 21 | + } | |
| 13 | 22 | |
| 14 | − options[:title] = false | |
| 15 | − options[:root_title] = 'webpack' | |
| 23 | + html_filters.push 'webpack/clean_html', 'webpack/entries' | |
| 16 | 24 | |
| 17 | − options[:skip] = %w(list-of-tutorials.html examples.html changelog.html ideas.html roadmap.html) | |
| 25 | + options[:container] = '.page' | |
| 26 | + options[:trailing_slash] = true | |
| 27 | + options[:only_patterns] = [ | |
| 28 | + /\Aget-started\//, | |
| 29 | + /\Aconcepts\//, | |
| 30 | + /\Aguides\//, | |
| 31 | + /\Aapi\//, | |
| 32 | + /\Aconfiguration\//, | |
| 33 | + /\Aloaders\//, | |
| 34 | + /\Aplugins\// | |
| 35 | + ] | |
| 18 | 36 | |
| 19 | − options[:attribution] = <<-HTML | |
| 20 | − © 2012–2016 Tobias Koppers<br> | |
| 21 | − Licensed under the MIT License. | |
| 22 | − HTML | |
| 37 | + options[:attribution] = <<-HTML | |
| 38 | + © 2012–2016 Tobias Koppers<br> | |
| 39 | + Licensed under the Creative Commons Attribution License 4.0. | |
| 40 | + HTML | |
| 41 | + | |
| 42 | + ([self.root_path] + self.initial_paths).each do |path| | |
| 43 | + stub(path) do | |
| 44 | + capybara = load_capybara_selenium | |
| 45 | + capybara.app_host = self.base_url.origin | |
| 46 | + capybara.visit("#{self.base_url}#{path}") | |
| 47 | + capybara.execute_script('return document.body.innerHTML') | |
| 48 | + end | |
| 49 | + end | |
| 50 | + end | |
| 51 | + | |
| 52 | + version '1' do | |
| 53 | + self.release = '1.13.2' | |
| 54 | + self.base_url = 'https://webpack.github.io/docs/' | |
| 55 | + self.links = { | |
| 56 | + home: 'https://webpack.github.io/', | |
| 57 | + code: 'https://github.com/webpack/webpack' | |
| 58 | + } | |
| 59 | + | |
| 60 | + html_filters.push 'webpack/entries_old', 'webpack/clean_html_old', 'title' | |
| 61 | + | |
| 62 | + options[:title] = false | |
| 63 | + options[:root_title] = 'webpack' | |
| 64 | + | |
| 65 | + options[:skip] = %w(list-of-tutorials.html examples.html changelog.html ideas.html roadmap.html) | |
| 66 | + | |
| 67 | + options[:attribution] = <<-HTML | |
| 68 | + © 2012–2016 Tobias Koppers<br> | |
| 69 | + Licensed under the MIT License. | |
| 70 | + HTML | |
| 71 | + end | |
| 23 | 72 | end |
| 24 | 73 | end |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/webpack/media | |