diff --git a/assets/images/icons.png b/assets/images/icons.png index 9909f61b..af98d017 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index 9fc88fd8..1e6de1eb 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 3089d70a..747eb845 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2015-07-05", - "New documentation: Drupal" + "New documentations: Drupal and webpack" ], [ "2015-05-24", "New Rust documentation" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 9312c16f..944cd60f 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -355,6 +355,11 @@ credits = [ '2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', 'MIT', 'https://raw.github.com/jashkenas/underscore/master/LICENSE' + ], [ + 'Webpack', + '2012-2015 Tobias Koppers', + 'MIT', + 'https://raw.githubusercontent.com/webpack/webpack/master/LICENSE' ], [ 'Yii', '2008-2015 by Yii Software LLC', diff --git a/assets/javascripts/views/pages/javascript.coffee b/assets/javascripts/views/pages/javascript.coffee index 00fc0ba6..955f14e8 100644 --- a/assets/javascripts/views/pages/javascript.coffee +++ b/assets/javascripts/views/pages/javascript.coffee @@ -28,6 +28,7 @@ app.views.NodePage = app.views.RethinkdbPage = app.views.SinonPage = app.views.UnderscorePage = +app.views.WebpackPage = app.views.JavascriptPage app.views.RequirejsPage = diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index 403f5561..1968dceb 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -67,6 +67,5 @@ 'pages/socketio', 'pages/sphinx', 'pages/underscore', - 'pages/webpack', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index b11cfb52..4a8f307f 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -68,5 +68,4 @@ 'pages/sphinx', 'pages/underscore', 'pages/yard', - 'pages/webpack', 'pages/yii'; diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 59fefdb3..87c04242 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -102,3 +102,4 @@ ._icon-npm:before { background-position: -8rem -7rem; } ._icon-apache_http_server:before { background-position: -9rem -7rem; } ._icon-drupal:before { background-position: 0 -8rem; } +._icon-webpack:before { background-position: -1rem -8rem; @extend %darkIconFix !optional; } diff --git a/assets/stylesheets/pages/_base.scss b/assets/stylesheets/pages/_base.scss index 59bfaf48..f90e4dcb 100644 --- a/assets/stylesheets/pages/_base.scss +++ b/assets/stylesheets/pages/_base.scss @@ -24,7 +24,8 @@ ._markdown, ._mocha, ._mongoose, -._sinon { +._sinon, +._webpack { @extend %simple; } diff --git a/assets/stylesheets/pages/_webpack.scss b/assets/stylesheets/pages/_webpack.scss deleted file mode 100644 index 75dc49fe..00000000 --- a/assets/stylesheets/pages/_webpack.scss +++ /dev/null @@ -1,55 +0,0 @@ -._webpack { - > h2 { @extend %block-heading; } - > h3 { @extend %block-label, %label-blue; } - > h4 { font-size: 1em; } - - /* - Copied from the original webpack css - https://webpack.github.io/docs/css/doc.css - */ - code .comment { - color: #998; - font-style: italic - } - - code .keyword { - color: #333; - font-weight: 700 - } - - code .number { - color: #099 - } - - code .string { - color: #d14 - } - - code .tag { - color: navy; - font-weight: 400 - } - - code .attribute { - color: teal - } - - code .regexp { - color: #009926 - } - - code .preprocessor { - color: #999; - font-weight: 700 - } - - code .deletion { - background: #fdd; - display: block - } - - code .addition { - background: #dfd; - display: block - } -} diff --git a/lib/docs/filters/webpack/clean_html.rb b/lib/docs/filters/webpack/clean_html.rb index ebb43264..a9a6c6f7 100644 --- a/lib/docs/filters/webpack/clean_html.rb +++ b/lib/docs/filters/webpack/clean_html.rb @@ -1,5 +1,5 @@ module Docs - class Webpack + class Webpack class CleanHtmlFilter < Filter def call root_page? ? root : other @@ -14,32 +14,20 @@ module Docs # in devdocs. hr_index = doc.children.find_index { |node| node.name == "hr" } doc.children[0..hr_index].each(&:remove) - - # Add a page header :) - page_header_node = Nokogiri::XML::Node.new "h1", @doc - page_header_node.content = "Webpack" - @doc.children.first.add_previous_sibling page_header_node end def other # Re-create the header element - page_header = at_css("#wikititle").content.upcase - page_header_node = Nokogiri::XML::Node.new "h1", @doc - page_header_node.content = page_header + at_css("#wiki").child.before("

#{at_css("#wikititle").content}

") - # Change the scope of the page @doc = at_css("#wiki") - # Add the page header - @doc.children.first.add_previous_sibling page_header_node - - # Remove the sidebar links in each page - css(".contents").remove - - # Remove all anchors - css("a.anchor").remove + css('.contents', 'a.anchor', 'hr').remove + css('pre').each do |node| + node.content = node.content + end end end end diff --git a/lib/docs/filters/webpack/entries.rb b/lib/docs/filters/webpack/entries.rb index cdbf18ad..4d139dbe 100644 --- a/lib/docs/filters/webpack/entries.rb +++ b/lib/docs/filters/webpack/entries.rb @@ -2,7 +2,7 @@ module Docs class Webpack class EntriesFilter < Docs::EntriesFilter def get_name - entry_link.content.strip.titleize + entry_link.content end def get_type @@ -10,7 +10,7 @@ module Docs type_links_list = link_li.parent current_type = type_links_list.parent - # current type is a + # current type is a #
  • # TYPE #
  • @@ -20,16 +20,6 @@ module Docs current_type.children.first.content.strip.titleize end - - def additional_entries - return [] unless root_page? - - css('.sidebar a').each_with_object [] do |link, entries| - name = link.content.strip - entries << [name, link['href']] - end - end - private def entry_link diff --git a/lib/docs/scrapers/webpack.rb b/lib/docs/scrapers/webpack.rb index ada1717c..99f160e9 100644 --- a/lib/docs/scrapers/webpack.rb +++ b/lib/docs/scrapers/webpack.rb @@ -1,13 +1,20 @@ module Docs class Webpack < UrlScraper - self.name = 'Webpack' + self.name = 'webpack' self.type = 'webpack' - self.version = '1.9' + self.version = '1.10' self.base_url = 'https://webpack.github.io/docs/' - self.root_path = 'index.html' + self.links = { + home: 'https://webpack.github.io/', + code: 'https://github.com/webpack/webpack' + } - html_filters.push 'webpack/entries', 'webpack/clean_html' + html_filters.push 'webpack/entries', 'webpack/clean_html', 'title' + options[:title] = false + options[:root_title] = 'webpack' + + options[:skip] = %w(list-of-tutorials.html examples.html changelog.html ideas.html roadmap.html) options[:attribution] = <<-HTML © 2012–2015 Tobias Koppers
    diff --git a/public/icons/docs/webpack/16.png b/public/icons/docs/webpack/16.png index 9104d1e9..7bbd5a95 100644 Binary files a/public/icons/docs/webpack/16.png and b/public/icons/docs/webpack/16.png differ diff --git a/public/icons/docs/webpack/16@2x.png b/public/icons/docs/webpack/16@2x.png index 5339992e..c050a8c2 100644 Binary files a/public/icons/docs/webpack/16@2x.png and b/public/icons/docs/webpack/16@2x.png differ