Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -7,7 +7,7 @@ class app.collections.Types extends app.Collection · 6 unmodified lines | |||
| 7 | (result[@_groupFor(type)] ||= []).push(type) | 7 | (result[@_groupFor(type)] ||= []).push(type) |
| 8 | result.filter (e) -> e.length > 0 | 8 | result.filter (e) -> e.length > 0 |
| 9 | 9 | ||
| 10 | GUIDES_RGX = /(^|[\s\(])(guides?|tutorials?|reference|book|getting\ started|manual)($|[\s\):])/i | 10 | GUIDES_RGX = /(^|\()(guides?|tutorials?|reference|book|getting\ started|manual)($|[\):])/i |
| 11 | 11 | ||
| 12 | _groupFor: (type) -> | 12 | _groupFor: (type) -> |
| 13 | if GUIDES_RGX.test(type.name) | 13 | if GUIDES_RGX.test(type.name) |
| @@ -1,5 +1,8 @@ | |||
| 1 | [ | 1 | [ |
| 2 | [ | 2 | [ |
| 3 | "2016-08-07", | ||
| 4 | "New documentation: <a href=\"/docker/\">Docker</a>" | ||
| 5 | ], [ | ||
| 3 | "2016-07-31", | 6 | "2016-07-31", |
| 4 | "New documentations: <a href=\"/bootstrap~3/\">Bootstrap 3</a> and <a href=\"/bootstrap~4/\">Bootstrap 4</a>" | 7 | "New documentations: <a href=\"/bootstrap~3/\">Bootstrap 3</a> and <a href=\"/bootstrap~4/\">Bootstrap 4</a>" |
| 5 | ], [ | 8 | ], [ |
| @@ -179,6 +179,11 @@ credits = [ · 178 unmodified lines | |||
| 179 | 'Django Software Foundation and individual contributors', | 179 | 'Django Software Foundation and individual contributors', |
| 180 | 'BSD', | 180 | 'BSD', |
| 181 | 'https://raw.githubusercontent.com/django/django/master/LICENSE' | 181 | 'https://raw.githubusercontent.com/django/django/master/LICENSE' |
| 182 | ], [ | ||
| 183 | 'Docker', | ||
| 184 | '2013-2016 Docker, Inc.<br>Docker and the Docker logo are trademarks of Docker, Inc.', | ||
| 185 | 'Apache', | ||
| 186 | 'https://raw.githubusercontent.com/docker/docker/master/LICENSE' | ||
| 182 | ], [ | 187 | ], [ |
| 183 | 'Dojo', | 188 | 'Dojo', |
| 184 | '2005-2015 The Dojo Foundation', | 189 | '2005-2015 The Dojo Foundation', |
| @@ -116,6 +116,7 @@ · 115 unmodified lines | |||
| 116 | ._icon-socketio:before { background-position: -2rem -6rem; } | 116 | ._icon-socketio:before { background-position: -2rem -6rem; } |
| 117 | ._icon-modernizr:before { background-position: -3rem -6rem; } | 117 | ._icon-modernizr:before { background-position: -3rem -6rem; } |
| 118 | ._icon-bower:before { background-position: -4rem -6rem; } | 118 | ._icon-bower:before { background-position: -4rem -6rem; } |
| 119 | ._icon-docker:before { background-position: -1rem -7rem; } | ||
| 119 | ._icon-cakephp:before { background-position: -2rem -7rem; } | 120 | ._icon-cakephp:before { background-position: -2rem -7rem; } |
| 120 | ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; } | 121 | ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; } |
| 121 | ._icon-clojure:before { background-position: -4rem -7rem; } | 122 | ._icon-clojure:before { background-position: -4rem -7rem; } |
| @@ -3,14 +3,13 @@ module Docs · 2 unmodified lines | |||
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | if root_page? | 5 | if root_page? |
| 6 | @doc = at_css('.tabs-content') | 6 | doc.inner_html = "<h1>Docker Documentation</h1>" |
| 7 | else | 7 | return doc |
| 8 | @doc = at_css('#content') | ||
| 9 | end | 8 | end |
| 10 | 9 | ||
| 11 | if not at_css('h1') | 10 | @doc = at_css('#content') |
| 12 | at_css('h2').name = 'h1' | 11 | |
| 13 | end | 12 | at_css('h2').name = 'h1' unless at_css('h1') |
| 14 | 13 | ||
| 15 | css('pre').each do |node| | 14 | css('pre').each do |node| |
| 16 | node.content = node.content | 15 | node.content = node.content |
| @@ -2,20 +2,56 @@ module Docs · 1 unmodified line | |||
| 2 | class Docker | 2 | class Docker |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | title = at_css('h1').content | 5 | name = nav_link ? nav_link.content.strip : at_css('#content h1').content.strip |
| 6 | name.capitalize! if name == 'exoscale' | ||
| 6 | 7 | ||
| 7 | title = title.split(' — ').first | 8 | if name =~ /\A[a-z\-\s]+\z/ |
| 8 | title = title.split(' - ').first | 9 | name.prepend 'docker ' if subpath =~ /engine\/reference\/commandline\/./ |
| 10 | name.prepend 'docker-compose ' if subpath =~ /compose\/reference\/./ | ||
| 11 | name.prepend 'docker-machine ' if subpath =~ /machine\/reference\/./ | ||
| 12 | name.prepend 'swarm ' if subpath =~ /swarm\/reference\/./ && name != 'swarm' | ||
| 13 | else | ||
| 14 | name << " (#{product})" if name !~ /#{product}/i | ||
| 15 | end | ||
| 9 | 16 | ||
| 10 | title | 17 | name |
| 11 | end | 18 | end |
| 12 | 19 | ||
| 13 | def get_type | 20 | def get_type |
| 14 | if slug.count('/') == 1 or slug.count('/') == 2 | 21 | unless nav_link |
| 15 | slug.split('/').first.capitalize | 22 | return 'Engine: User guide' if subpath.start_with?('engine/userguide') |
| 16 | else | 23 | return 'Engine: Secure' if subpath.start_with?('engine/security') |
| 17 | slug.split('/')[0...-1].map(&:capitalize).join('/').gsub(/\-|\_/, ' ') | 24 | return 'Engine' if subpath == 'engine/' |
| 25 | end | ||
| 26 | |||
| 27 | type = nav_link.ancestors('article').to_a.reverse.to_a[0..1].map do |node| | ||
| 28 | node.at_css('> button').content.strip | ||
| 29 | end.join(': ') | ||
| 30 | |||
| 31 | type.remove! %r{\ADocker } | ||
| 32 | type.remove! %r{ Engine} | ||
| 33 | type.sub! %r{Command[\-\s]line reference}i, 'CLI' | ||
| 34 | type = 'Engine: Reference' if type == 'Engine: reference' | ||
| 35 | type | ||
| 36 | end | ||
| 37 | |||
| 38 | def nav_link | ||
| 39 | return @nav_link if defined?(@nav_link) | ||
| 40 | @nav_link = at_css('#multiple .active') | ||
| 41 | |||
| 42 | unless @nav_link | ||
| 43 | link = at_css('#content li a') | ||
| 44 | return unless link | ||
| 45 | link = at_css("#multiple a[href='#{link['href']}']") | ||
| 46 | return unless link | ||
| 47 | @nav_link = link.ancestors('article').first.at_css('button') | ||
| 18 | end | 48 | end |
| 49 | |||
| 50 | @nav_link | ||
| 51 | end | ||
| 52 | |||
| 53 | def product | ||
| 54 | @product ||= subpath.split('/').first.capitalize | ||
| 19 | end | 55 | end |
| 20 | end | 56 | end |
| 21 | end | 57 | end |
| @@ -1,16 +1,14 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Docker < UrlScraper | 2 | class Docker < UrlScraper |
| 3 | self.name = 'Docker' | ||
| 4 | self.slug = 'docker' | ||
| 5 | self.type = 'docker' | 3 | self.type = 'docker' |
| 6 | |||
| 7 | self.links = { | 4 | self.links = { |
| 8 | home: 'https://docker.com/', | 5 | home: 'https://docker.com/', |
| 9 | code: 'https://github.com/docker/docker' | 6 | code: 'https://github.com/docker/docker' |
| 10 | } | 7 | } |
| 11 | 8 | ||
| 12 | html_filters.push 'docker/clean_html', 'docker/entries' | 9 | html_filters.push 'docker/entries', 'docker/clean_html' |
| 13 | 10 | ||
| 11 | options[:container] = '#docs' | ||
| 14 | options[:trailing_slash] = true | 12 | options[:trailing_slash] = true |
| 15 | 13 | ||
| 16 | options[:only_patterns] = [ | 14 | options[:only_patterns] = [ |
| @@ -19,14 +17,16 @@ module Docs · 2 unmodified lines | |||
| 19 | /\Amachine\//, | 17 | /\Amachine\//, |
| 20 | /\Aswarm\// | 18 | /\Aswarm\// |
| 21 | ] | 19 | ] |
| 22 | 20 | options[:skip] = %w(swarm/scheduler/) | |
| 23 | options[:skip] = [ | 21 | options[:replace_paths] = { |
| 24 | "engine/installation/ubuntulinux/" # invalid document | 22 | 'engine/installation/ubuntulinux/' => 'engine/installation/linux/ubuntulinux/' |
| 25 | ] | 23 | } |
| 26 | 24 | ||
| 27 | options[:attribution] = <<-HTML | 25 | options[:attribution] = <<-HTML |
| 28 | © 2016 Docker Inc.<br> | 26 | © 2013–2016 Docker, Inc.<br> |
| 29 | Licensed under the Apache 2 License. | 27 | Licensed under the Apache License, Version 2.0.<br> |
| 28 | Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br> | ||
| 29 | Docker, Inc. and other parties may also have trademark rights in other terms used herein. | ||
| 30 | HTML | 30 | HTML |
| 31 | 31 | ||
| 32 | version '1.11' do | 32 | version '1.11' do |
Binary file not shown.
Binary file not shown.