Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | |||
| 1 | [ | 1 | [ |
| 2 | [ | 2 | [ |
| 3 | "2016-02-14", | ||
| 4 | "New documentation: <a href=\"/cakephp/\">CakePHP</a>" | ||
| 5 | ], [ | ||
| 3 | "2016-01-31", | 6 | "2016-01-31", |
| 4 | "New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>" | 7 | "New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>" |
| 5 | ], [ | 8 | ], [ |
| @@ -99,6 +99,11 @@ credits = [ · 98 unmodified lines | |||
| 99 | 'cppreference.com', | 99 | 'cppreference.com', |
| 100 | 'CC BY-SA', | 100 | 'CC BY-SA', |
| 101 | 'http://en.cppreference.com/w/Cppreference:Copyright/CC-BY-SA' | 101 | 'http://en.cppreference.com/w/Cppreference:Copyright/CC-BY-SA' |
| 102 | ], [ | ||
| 103 | 'CakePHP', | ||
| 104 | '2005-2016 The Cake Software Foundation, Inc.', | ||
| 105 | 'MIT', | ||
| 106 | 'https://raw.githubusercontent.com/cakephp/cakephp/master/LICENSE.txt' | ||
| 102 | ], [ | 107 | ], [ |
| 103 | 'Chai', | 108 | 'Chai', |
| 104 | '2011-2015 Jake Luer', | 109 | '2011-2015 Jake Luer', |
| @@ -70,6 +70,11 @@ · 69 unmodified lines | |||
| 70 | @extend %label; | 70 | @extend %label; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | %label-yellow { | ||
| 74 | background: $noteBackground; | ||
| 75 | border-color: $noteBorder; | ||
| 76 | } | ||
| 77 | |||
| 73 | %note-green, %label-green { | 78 | %note-green, %label-green { |
| 74 | background: $noteGreenBackground; | 79 | background: $noteGreenBackground; |
| 75 | border-color: $noteGreenBorder; | 80 | border-color: $noteGreenBorder; |
| @@ -94,7 +94,7 @@ · 93 unmodified lines | |||
| 94 | %icon-check-white { background-position: -9rem -6rem; } | 94 | %icon-check-white { background-position: -9rem -6rem; } |
| 95 | %icon-light { background-position: 0 -7rem; } | 95 | %icon-light { background-position: 0 -7rem; } |
| 96 | %icon-light-white { background-position: -1rem -7rem; } | 96 | %icon-light-white { background-position: -1rem -7rem; } |
| 97 | ._icon-iojs:before { background-position: -2rem -7rem; @extend %darkIconFix !optional; } | 97 | ._icon-cakephp:before { background-position: -2rem -7rem; } |
| 98 | ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; } | 98 | ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; } |
| 99 | ._icon-clojure:before { background-position: -4rem -7rem; } | 99 | ._icon-clojure:before { background-position: -4rem -7rem; } |
| 100 | ._icon-symfony:before { background-position: -5rem -7rem; } | 100 | ._icon-symfony:before { background-position: -5rem -7rem; } |
| @@ -1,16 +1,17 @@ | |||
| 1 | ._cakephp { | 1 | ._cakephp { |
| 2 | h2 { @extend %block-heading; } | 2 | @extend %simple; |
| 3 | 3 | ||
| 4 | h3 { @extend %block-label, %label-blue; } | 4 | h3 > .source { float: right; } |
| 5 | h3 > a, span.label, span.php-keyword1 { font-weight: normal; } | ||
| 5 | 6 | ||
| 6 | h3 > a { float: right; } | 7 | h4 { |
| 7 | 8 | margin: 1.5em 0; | |
| 8 | h3 > a, | 9 | @extend %block-label; |
| 9 | span.label, | ||
| 10 | span.php-keyword1 { | ||
| 11 | font-weight: normal; | ||
| 12 | } | 10 | } |
| 13 | 11 | ||
| 14 | .tree > dd { margin-left: 0px; } | 12 | dl { margin: 1em 0; } |
| 15 | .list { margin-left: 20px; } | 13 | |
| 14 | .info { @extend %note; } | ||
| 15 | code { @extend %label; } | ||
| 16 | p > .label, dt > .label { @extend %label, %label-yellow; } | ||
| 16 | } | 17 | } |
| @@ -8,6 +8,7 @@ module Docs · 7 unmodified lines | |||
| 8 | def inherited(subclass) | 8 | def inherited(subclass) |
| 9 | super | 9 | super |
| 10 | subclass.base_url = base_url | 10 | subclass.base_url = base_url |
| 11 | subclass.dir = dir | ||
| 11 | end | 12 | end |
| 12 | end | 13 | end |
| 13 | 14 | ||
| @@ -2,44 +2,50 @@ module Docs · 1 unmodified line | |||
| 2 | class Cakephp | 2 | class Cakephp |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | if root_page? | 5 | css('.breadcrumbs', 'a.permalink', 'a.anchor').remove |
| 6 | css('.section').remove | ||
| 7 | end | ||
| 8 | 6 | ||
| 9 | css('.breadcrumbs', '.info', 'a.permalink').remove | 7 | css('.section', '#content', '.description', '.list').each do |node| |
| 8 | node.before(node.children).remove | ||
| 9 | end | ||
| 10 | 10 | ||
| 11 | css('h1').drop(1).each do |node| | 11 | css('h1').drop(1).each do |node| |
| 12 | node.name = 'h2' | 12 | node.name = 'h2' |
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | css('> h6').each do |node| | ||
| 16 | node.name = 'h2' | ||
| 17 | end | ||
| 18 | |||
| 19 | css('h6').each do |node| | ||
| 20 | node.name = 'h4' | ||
| 21 | end | ||
| 22 | |||
| 15 | css('.property-name').each do |node| | 23 | css('.property-name').each do |node| |
| 16 | node.name = 'h3' | 24 | node.name = 'h3' |
| 17 | end | 25 | end |
| 18 | 26 | ||
| 27 | css('var').each do |node| | ||
| 28 | node.name = 'code' | ||
| 29 | end | ||
| 30 | |||
| 19 | # Move dummy anchor to method and property name | 31 | # Move dummy anchor to method and property name |
| 32 | |||
| 20 | css('.method-detail').each do |node| | 33 | css('.method-detail').each do |node| |
| 21 | node.at_css('.method-name')['id'] = node.at_css('a')['id'] | 34 | node.at_css('.method-name')['id'] = node.at_css('a')['id'] |
| 22 | end | 35 | end |
| 36 | |||
| 23 | css('.property-detail').each do |node| | 37 | css('.property-detail').each do |node| |
| 24 | node.at_css('.property-name')['id'] = node['id'] | 38 | node.at_css('.property-name')['id'] = node['id'] |
| 25 | node.remove_attribute('id') | 39 | node.remove_attribute('id') |
| 26 | end | 40 | end |
| 27 | 41 | ||
| 28 | # Break out source link to separate element | 42 | # Break out source link to separate element |
| 43 | |||
| 29 | css('.method-name', '.property-name').each do |node| | 44 | css('.method-name', '.property-name').each do |node| |
| 30 | source = node.at_css('a') | 45 | source = node.at_css('a') |
| 31 | source.add_previous_sibling("<span class=\"name\">#{source.content}</span>") | 46 | source.before(%(<span class="name">#{source.content}</span>)) |
| 32 | source.content = 'source' | 47 | source.content = 'source' |
| 33 | end | 48 | source['class'] = 'source' |
| 34 | |||
| 35 | # These are missing in upstream documentation. Not sure why. | ||
| 36 | css('.section > h2').each do |node| | ||
| 37 | if node.content == "Method Detail" | ||
| 38 | node['id'] = 'methods' | ||
| 39 | end | ||
| 40 | if node.content == 'Properties summary' | ||
| 41 | node['id'] = 'properties' | ||
| 42 | end | ||
| 43 | end | 49 | end |
| 44 | 50 | ||
| 45 | css('.method-signature').each do |node| | 51 | css('.method-signature').each do |node| |
| @@ -51,8 +57,15 @@ module Docs · 5 unmodified lines | |||
| 51 | node.content = node.content.strip | 57 | node.content = node.content.strip |
| 52 | end | 58 | end |
| 53 | 59 | ||
| 54 | # Pages don't share a nice common base css tag. | 60 | css('code code').each do |node| |
| 55 | doc.children | 61 | node.before(node.children).remove |
| 62 | end | ||
| 63 | |||
| 64 | css('code').each do |node| | ||
| 65 | node.inner_html = node.inner_html.squish | ||
| 66 | end | ||
| 67 | |||
| 68 | doc | ||
| 56 | end | 69 | end |
| 57 | end | 70 | end |
| 58 | end | 71 | end |
| @@ -1,55 +1,63 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Cakephp | 2 | class Cakephp |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | INCLUDE_PAGE_TYPES = { | 4 | def page_type |
| 5 | 'class' => true, | 5 | @page_type ||= slug.split('-').first |
| 6 | 'function' => true, | ||
| 7 | 'namespace' => false, | ||
| 8 | } | ||
| 9 | |||
| 10 | def get_page_type | ||
| 11 | page_type = slug.split('-')[0] | ||
| 12 | end | 6 | end |
| 13 | 7 | ||
| 14 | def include_default_entry? | 8 | def slug_without_page_type |
| 15 | INCLUDE_PAGE_TYPES[get_page_type] | 9 | @slug_without_page_type ||= slug.split('-').last |
| 16 | end | 10 | end |
| 17 | 11 | ||
| 18 | def get_name | 12 | def get_name |
| 19 | case get_page_type | 13 | case page_type |
| 20 | when 'class' | 14 | when 'class' |
| 21 | slug.split('.').last | 15 | slug_without_page_type.split('.').last.concat(' (class)') |
| 22 | when 'function' | 16 | when 'function' |
| 23 | at_css('h1').content.split(' ')[1] | 17 | at_css('h1').content.remove('Function ') |
| 18 | when 'namespace', 'package' | ||
| 19 | slug_without_page_type.split('.').tap do |path| | ||
| 20 | path.shift if path.length > 1 | ||
| 21 | end.join('\\').concat(" (#{page_type})") | ||
| 24 | end | 22 | end |
| 25 | end | 23 | end |
| 26 | 24 | ||
| 27 | def get_type | 25 | def get_type |
| 28 | case get_page_type | 26 | return 'Global' if slug == 'namespace-None' |
| 29 | when 'class' | 27 | case page_type |
| 30 | slug.split('.')[1..-2].join('\\') | 28 | when 'class', 'namespace', 'package' |
| 31 | when 'function' | 29 | if (node = at_css('.info')) && node.content =~ /Located at\s+((?:\w+\/?)+)/ # for 2.x docs |
| 32 | 'Global Functions' | 30 | path = $1.split('/') |
| 31 | else | ||
| 32 | path = slug_without_page_type.split('.') | ||
| 33 | end | ||
| 34 | path.shift if path.length > 1 && path[0] == 'Cake' | ||
| 35 | path.pop if path.length > 1 | ||
| 36 | path.pop if path.last == 'Exception' | ||
| 37 | path.join('\\') | ||
| 38 | when 'function' | ||
| 39 | 'Global' | ||
| 33 | end | 40 | end |
| 34 | end | 41 | end |
| 35 | 42 | ||
| 36 | def additional_entries | 43 | def additional_entries |
| 44 | return [] unless page_type == 'class' | ||
| 45 | class_name = name.remove(' (class)') | ||
| 46 | return [] if class_name.end_with?('Exception') | ||
| 37 | entries = [] | 47 | entries = [] |
| 38 | if get_page_type == 'class' | 48 | |
| 39 | css('.method-name').each do |node| | 49 | css('.method-name').each do |node| |
| 40 | name = get_name + '::' + node.at_css('.name').content.strip + '()' | 50 | break if node.parent.previous_element.content =~ /\AMethods.*from/ |
| 41 | id = node['id'] | 51 | entries << ["#{class_name}::#{node.at_css('.name').content.strip}()", node['id']] |
| 42 | entries << [name, id, get_type] | ||
| 43 | end | ||
| 44 | css('.property-name').each do |node| | ||
| 45 | name = get_name + '::' + node.at_css('.name').content.strip | ||
| 46 | id = node['id'] | ||
| 47 | entries << [name, id, get_type] | ||
| 48 | end | ||
| 49 | end | 52 | end |
| 53 | |||
| 54 | css('.property-name').each do |node| | ||
| 55 | break if node.parent.parent['class'].include?('used') | ||
| 56 | entries << ["#{class_name}::#{node.at_css('.name').content.strip}", node['id']] | ||
| 57 | end | ||
| 58 | |||
| 50 | entries | 59 | entries |
| 51 | end | 60 | end |
| 52 | |||
| 53 | end | 61 | end |
| 54 | end | 62 | end |
| 55 | end | 63 | end |
| @@ -2,9 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Cakephp < FileScraper | 2 | class Cakephp < FileScraper |
| 3 | self.name = 'CakePHP' | 3 | self.name = 'CakePHP' |
| 4 | self.type = 'cakephp' | 4 | self.type = 'cakephp' |
| 5 | self.version = '3.1' | 5 | self.dir = '/Users/Thibaut/DevDocs/Docs/CakePHP' |
| 6 | self.dir = '' | ||
| 7 | self.base_url = "http://api.cakephp.org/#{version}/" | ||
| 8 | self.root_path = 'index.html' | 6 | self.root_path = 'index.html' |
| 9 | self.links = { | 7 | self.links = { |
| 10 | home: 'http://cakephp.org/', | 8 | home: 'http://cakephp.org/', |
| @@ -15,12 +13,33 @@ module Docs · 4 unmodified lines | |||
| 15 | 13 | ||
| 16 | options[:container] = '#right.columns.nine' | 14 | options[:container] = '#right.columns.nine' |
| 17 | 15 | ||
| 18 | # CakePHP docs include full source code. Ignore it. | ||
| 19 | options[:skip_patterns] = [/\Asource-/] | 16 | options[:skip_patterns] = [/\Asource-/] |
| 20 | 17 | ||
| 21 | options[:attribution] = <<-HTML | 18 | options[:attribution] = <<-HTML |
| 22 | © 2005–2015 The Cake Software Foundation, Inc.<br> | 19 | © 2005–2016 The Cake Software Foundation, Inc.<br> |
| 23 | Licensed under the MIT License. | 20 | Licensed under the MIT License.<br> |
| 21 | CakePHP is a registered trademark of Cake Software Foundation, Inc.<br> | ||
| 22 | We are not endorsed by or affiliated with CakePHP. | ||
| 24 | HTML | 23 | HTML |
| 24 | |||
| 25 | version '3.2' do # http://api.cakephp.org/3.2/cakephp-api-documentation.zip | ||
| 26 | self.release = '3.2.2' | ||
| 27 | self.base_url = 'http://api.cakephp.org/3.2/' | ||
| 28 | end | ||
| 29 | |||
| 30 | version '3.1' do # http://api.cakephp.org/3.1/cakephp-api-documentation.zip | ||
| 31 | self.release = '3.1.10' | ||
| 32 | self.base_url = 'http://api.cakephp.org/3.1/' | ||
| 33 | end | ||
| 34 | |||
| 35 | version '2.8' do # http://api.cakephp.org/2.8/cakephp-api-documentation.zip | ||
| 36 | self.release = '2.8.0' | ||
| 37 | self.base_url = 'http://api.cakephp.org/2.8/' | ||
| 38 | end | ||
| 39 | |||
| 40 | version '2.7' do # http://api.cakephp.org/2.7/cakephp-api-documentation.zip | ||
| 41 | self.release = '2.7.10' | ||
| 42 | self.base_url = 'http://api.cakephp.org/2.7/' | ||
| 43 | end | ||
| 25 | end | 44 | end |
| 26 | end | 45 | end |
Binary file not shown.
Binary file not shown.