Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 97 KiB |
@ -1,16 +1,17 @@
|
|||||||
._cakephp {
|
._cakephp {
|
||||||
h2 { @extend %block-heading; }
|
@extend %simple;
|
||||||
|
|
||||||
h3 { @extend %block-label, %label-blue; }
|
h3 > .source { float: right; }
|
||||||
|
h3 > a, span.label, span.php-keyword1 { font-weight: normal; }
|
||||||
|
|
||||||
h3 > a { float: right; }
|
h4 {
|
||||||
|
margin: 1.5em 0;
|
||||||
h3 > a,
|
@extend %block-label;
|
||||||
span.label,
|
|
||||||
span.php-keyword1 {
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree > dd { margin-left: 0px; }
|
dl { margin: 1em 0; }
|
||||||
.list { margin-left: 20px; }
|
|
||||||
|
.info { @extend %note; }
|
||||||
|
code { @extend %label; }
|
||||||
|
p > .label, dt > .label { @extend %label, %label-yellow; }
|
||||||
}
|
}
|
||||||
|
@ -1,55 +1,63 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Cakephp
|
class Cakephp
|
||||||
class EntriesFilter < Docs::EntriesFilter
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
INCLUDE_PAGE_TYPES = {
|
def page_type
|
||||||
'class' => true,
|
@page_type ||= slug.split('-').first
|
||||||
'function' => true,
|
|
||||||
'namespace' => false,
|
|
||||||
}
|
|
||||||
|
|
||||||
def get_page_type
|
|
||||||
page_type = slug.split('-')[0]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_default_entry?
|
def slug_without_page_type
|
||||||
INCLUDE_PAGE_TYPES[get_page_type]
|
@slug_without_page_type ||= slug.split('-').last
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_name
|
def get_name
|
||||||
case get_page_type
|
case page_type
|
||||||
when 'class'
|
when 'class'
|
||||||
slug.split('.').last
|
slug_without_page_type.split('.').last.concat(' (class)')
|
||||||
when 'function'
|
when 'function'
|
||||||
at_css('h1').content.split(' ')[1]
|
at_css('h1').content.remove('Function ')
|
||||||
|
when 'namespace', 'package'
|
||||||
|
slug_without_page_type.split('.').tap do |path|
|
||||||
|
path.shift if path.length > 1
|
||||||
|
end.join('\\').concat(" (#{page_type})")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_type
|
def get_type
|
||||||
case get_page_type
|
return 'Global' if slug == 'namespace-None'
|
||||||
when 'class'
|
case page_type
|
||||||
slug.split('.')[1..-2].join('\\')
|
when 'class', 'namespace', 'package'
|
||||||
when 'function'
|
if (node = at_css('.info')) && node.content =~ /Located at\s+((?:\w+\/?)+)/ # for 2.x docs
|
||||||
'Global Functions'
|
path = $1.split('/')
|
||||||
|
else
|
||||||
|
path = slug_without_page_type.split('.')
|
||||||
|
end
|
||||||
|
path.shift if path.length > 1 && path[0] == 'Cake'
|
||||||
|
path.pop if path.length > 1
|
||||||
|
path.pop if path.last == 'Exception'
|
||||||
|
path.join('\\')
|
||||||
|
when 'function'
|
||||||
|
'Global'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def additional_entries
|
def additional_entries
|
||||||
|
return [] unless page_type == 'class'
|
||||||
|
class_name = name.remove(' (class)')
|
||||||
|
return [] if class_name.end_with?('Exception')
|
||||||
entries = []
|
entries = []
|
||||||
if get_page_type == 'class'
|
|
||||||
css('.method-name').each do |node|
|
css('.method-name').each do |node|
|
||||||
name = get_name + '::' + node.at_css('.name').content.strip + '()'
|
break if node.parent.previous_element.content =~ /\AMethods.*from/
|
||||||
id = node['id']
|
entries << ["#{class_name}::#{node.at_css('.name').content.strip}()", node['id']]
|
||||||
entries << [name, id, get_type]
|
|
||||||
end
|
|
||||||
css('.property-name').each do |node|
|
|
||||||
name = get_name + '::' + node.at_css('.name').content.strip
|
|
||||||
id = node['id']
|
|
||||||
entries << [name, id, get_type]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
css('.property-name').each do |node|
|
||||||
|
break if node.parent.parent['class'].include?('used')
|
||||||
|
entries << ["#{class_name}::#{node.at_css('.name').content.strip}", node['id']]
|
||||||
|
end
|
||||||
|
|
||||||
entries
|
entries
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 760 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.0 KiB |