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 | 6 | "2016-01-31", |
| 4 | 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 | 99 | 'cppreference.com', |
| 100 | 100 | 'CC BY-SA', |
| 101 | 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 | 108 | 'Chai', |
| 104 | 109 | '2011-2015 Jake Luer', |
| @@ -70,6 +70,11 @@ · 69 unmodified lines | ||
| 70 | 70 | @extend %label; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | +%label-yellow { | |
| 74 | + background: $noteBackground; | |
| 75 | + border-color: $noteBorder; | |
| 76 | +} | |
| 77 | + | |
| 73 | 78 | %note-green, %label-green { |
| 74 | 79 | background: $noteGreenBackground; |
| 75 | 80 | border-color: $noteGreenBorder; |
| @@ -94,7 +94,7 @@ · 93 unmodified lines | ||
| 94 | 94 | %icon-check-white { background-position: -9rem -6rem; } |
| 95 | 95 | %icon-light { background-position: 0 -7rem; } |
| 96 | 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 | 98 | ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; } |
| 99 | 99 | ._icon-clojure:before { background-position: -4rem -7rem; } |
| 100 | 100 | ._icon-symfony:before { background-position: -5rem -7rem; } |
| @@ -1,16 +1,17 @@ | ||
| 1 | 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 | − | |
| 8 | − h3 > a, | |
| 9 | − span.label, | |
| 10 | − span.php-keyword1 { | |
| 11 | − font-weight: normal; | |
| 7 | + h4 { | |
| 8 | + margin: 1.5em 0; | |
| 9 | + @extend %block-label; | |
| 12 | 10 | } |
| 13 | 11 | |
| 14 | − .tree > dd { margin-left: 0px; } | |
| 15 | − .list { margin-left: 20px; } | |
| 12 | + dl { margin: 1em 0; } | |
| 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 | 8 | def inherited(subclass) |
| 9 | 9 | super |
| 10 | 10 | subclass.base_url = base_url |
| 11 | + subclass.dir = dir | |
| 11 | 12 | end |
| 12 | 13 | end |
| 13 | 14 | |
| @@ -2,44 +2,50 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Cakephp |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − if root_page? | |
| 6 | − css('.section').remove | |
| 7 | − end | |
| 5 | + css('.breadcrumbs', 'a.permalink', 'a.anchor').remove | |
| 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 | 11 | css('h1').drop(1).each do |node| |
| 12 | 12 | node.name = 'h2' |
| 13 | 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 | 23 | css('.property-name').each do |node| |
| 16 | 24 | node.name = 'h3' |
| 17 | 25 | end |
| 18 | 26 | |
| 27 | + css('var').each do |node| | |
| 28 | + node.name = 'code' | |
| 29 | + end | |
| 30 | + | |
| 19 | 31 | # Move dummy anchor to method and property name |
| 32 | + | |
| 20 | 33 | css('.method-detail').each do |node| |
| 21 | 34 | node.at_css('.method-name')['id'] = node.at_css('a')['id'] |
| 22 | 35 | end |
| 36 | + | |
| 23 | 37 | css('.property-detail').each do |node| |
| 24 | 38 | node.at_css('.property-name')['id'] = node['id'] |
| 25 | 39 | node.remove_attribute('id') |
| 26 | 40 | end |
| 27 | 41 | |
| 28 | 42 | # Break out source link to separate element |
| 43 | + | |
| 29 | 44 | css('.method-name', '.property-name').each do |node| |
| 30 | 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 | 47 | source.content = 'source' |
| 33 | − end | |
| 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 | |
| 48 | + source['class'] = 'source' | |
| 43 | 49 | end |
| 44 | 50 | |
| 45 | 51 | css('.method-signature').each do |node| |
| @@ -51,8 +57,15 @@ module Docs · 5 unmodified lines | ||
| 51 | 57 | node.content = node.content.strip |
| 52 | 58 | end |
| 53 | 59 | |
| 54 | − # Pages don't share a nice common base css tag. | |
| 55 | − doc.children | |
| 60 | + css('code code').each do |node| | |
| 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 | 69 | end |
| 57 | 70 | end |
| 58 | 71 | end |
| @@ -1,55 +1,63 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Cakephp |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | − INCLUDE_PAGE_TYPES = { | |
| 5 | − 'class' => true, | |
| 6 | − 'function' => true, | |
| 7 | − 'namespace' => false, | |
| 8 | − } | |
| 9 | − | |
| 10 | − def get_page_type | |
| 11 | − page_type = slug.split('-')[0] | |
| 4 | + def page_type | |
| 5 | + @page_type ||= slug.split('-').first | |
| 12 | 6 | end |
| 13 | 7 | |
| 14 | − def include_default_entry? | |
| 15 | − INCLUDE_PAGE_TYPES[get_page_type] | |
| 8 | + def slug_without_page_type | |
| 9 | + @slug_without_page_type ||= slug.split('-').last | |
| 16 | 10 | end |
| 17 | 11 | |
| 18 | 12 | def get_name |
| 19 | − case get_page_type | |
| 20 | − when 'class' | |
| 21 | − slug.split('.').last | |
| 22 | − when 'function' | |
| 23 | − at_css('h1').content.split(' ')[1] | |
| 13 | + case page_type | |
| 14 | + when 'class' | |
| 15 | + slug_without_page_type.split('.').last.concat(' (class)') | |
| 16 | + when 'function' | |
| 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 | 22 | end |
| 25 | 23 | end |
| 26 | 24 | |
| 27 | 25 | def get_type |
| 28 | − case get_page_type | |
| 29 | − when 'class' | |
| 30 | − slug.split('.')[1..-2].join('\\') | |
| 31 | − when 'function' | |
| 32 | − 'Global Functions' | |
| 26 | + return 'Global' if slug == 'namespace-None' | |
| 27 | + case page_type | |
| 28 | + when 'class', 'namespace', 'package' | |
| 29 | + if (node = at_css('.info')) && node.content =~ /Located at\s+((?:\w+\/?)+)/ # for 2.x docs | |
| 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 | 40 | end |
| 34 | 41 | end |
| 35 | 42 | |
| 36 | 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 | 47 | entries = [] |
| 38 | − if get_page_type == 'class' | |
| 39 | − css('.method-name').each do |node| | |
| 40 | − name = get_name + '::' + node.at_css('.name').content.strip + '()' | |
| 41 | − id = 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 | |
| 48 | + | |
| 49 | + css('.method-name').each do |node| | |
| 50 | + break if node.parent.previous_element.content =~ /\AMethods.*from/ | |
| 51 | + entries << ["#{class_name}::#{node.at_css('.name').content.strip}()", node['id']] | |
| 49 | 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 | 59 | entries |
| 51 | 60 | end |
| 52 | − | |
| 53 | 61 | end |
| 54 | 62 | end |
| 55 | 63 | end |
| @@ -2,9 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Cakephp < FileScraper |
| 3 | 3 | self.name = 'CakePHP' |
| 4 | 4 | self.type = 'cakephp' |
| 5 | − self.version = '3.1' | |
| 6 | − self.dir = '' | |
| 7 | − self.base_url = "http://api.cakephp.org/#{version}/" | |
| 5 | + self.dir = '/Users/Thibaut/DevDocs/Docs/CakePHP' | |
| 8 | 6 | self.root_path = 'index.html' |
| 9 | 7 | self.links = { |
| 10 | 8 | home: 'http://cakephp.org/', |
| @@ -15,12 +13,33 @@ module Docs · 4 unmodified lines | ||
| 15 | 13 | |
| 16 | 14 | options[:container] = '#right.columns.nine' |
| 17 | 15 | |
| 18 | − # CakePHP docs include full source code. Ignore it. | |
| 19 | 16 | options[:skip_patterns] = [/\Asource-/] |
| 20 | 17 | |
| 21 | 18 | options[:attribution] = <<-HTML |
| 22 | − © 2005–2015 The Cake Software Foundation, Inc.<br> | |
| 23 | − Licensed under the MIT License. | |
| 19 | + © 2005–2016 The Cake Software Foundation, Inc.<br> | |
| 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 | 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 | 44 | end |
| 26 | 45 | end |
Binary file not shown.
Binary file not shown.