diff --git a/assets/images/icons.png b/assets/images/icons.png
index 7bca5a0b..939c9c0e 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 2dce0637..ee8cc1aa 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 83840abb..0e5724ad 100644
--- a/assets/javascripts/news.json
+++ b/assets/javascripts/news.json
@@ -1,5 +1,8 @@
[
[
+ "2015-09-13",
+ "New documentation: Phalcon"
+ ], [
"2015-08-09",
"New documentation: React Native"
], [
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index de0d9a24..76a2debd 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -279,6 +279,11 @@ credits = [
'2010-2015 The OpenTSDB Authors',
'LGPLv2.1',
'https://raw.githubusercontent.com/OpenTSDB/opentsdb.net/gh-pages/COPYING.LESSER'
+ ], [
+ 'Phalcon',
+ '2011-2015 Phalcon Framework Team',
+ 'CC BY',
+ 'https://docs.phalconphp.com/en/latest/reference/license.html'
], [
'Phaser',
'2015 Richard Davey, Photon Storm Ltd.',
diff --git a/assets/javascripts/views/pages/phalcon.coffee b/assets/javascripts/views/pages/phalcon.coffee
new file mode 100644
index 00000000..fb17d54d
--- /dev/null
+++ b/assets/javascripts/views/pages/phalcon.coffee
@@ -0,0 +1,7 @@
+#= require views/pages/base
+
+class app.views.PhalconPage extends app.views.BasePage
+ afterRender: ->
+ @highlightCode @findAll('pre[class*="php"]'), 'php'
+ @highlightCode @findAll('pre.highlight-html'), 'markup'
+ return
diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss
index 20c2fc1e..66cd7c72 100644
--- a/assets/stylesheets/application-dark.css.scss
+++ b/assets/stylesheets/application-dark.css.scss
@@ -55,6 +55,7 @@
'pages/node',
'pages/npm',
'pages/opentsdb',
+ 'pages/phalcon',
'pages/phaser',
'pages/php',
'pages/phpunit',
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index dcb6b623..09580553 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -55,6 +55,7 @@
'pages/node',
'pages/npm',
'pages/opentsdb',
+ 'pages/phalcon',
'pages/phaser',
'pages/php',
'pages/phpunit',
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index f1cf5289..77fb1c93 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -112,3 +112,4 @@
%icon-expand-white { background-position: -8rem -8rem; }
%icon-contract-white { background-position: -9rem -8rem; }
._icon-react_native:before { background-position: 0 -9rem; }
+._icon-phalcon:before { background-position: -1rem -9rem; }
diff --git a/assets/stylesheets/pages/_phalcon.scss b/assets/stylesheets/pages/_phalcon.scss
new file mode 100644
index 00000000..646cf07c
--- /dev/null
+++ b/assets/stylesheets/pages/_phalcon.scss
@@ -0,0 +1,8 @@
+._phalcon {
+ @extend %simple;
+
+ h3 > small {
+ float: right;
+ color: $textColorLight;
+ }
+}
diff --git a/lib/docs/filters/phalcon/clean_html.rb b/lib/docs/filters/phalcon/clean_html.rb
index f3ea4d6d..4585c3a8 100644
--- a/lib/docs/filters/phalcon/clean_html.rb
+++ b/lib/docs/filters/phalcon/clean_html.rb
@@ -4,12 +4,38 @@ module Docs
def call
@doc = at_css('.body')
- # Remove unnecessary things
- css('.headerlink', '#what-is-phalcon', '#other-formats', '#welcome h1', '#welcome p', '#table-of-contents h2').remove
+ if root_page?
+ at_css('h1').content = 'Phalcon'
+ end
+
+ css('#what-is-phalcon', '#other-formats').remove
+
+ css('#methods > p > strong, #constants > p > strong').each do |node|
+ node.parent.name = 'h3'
+ node.parent['id'] = node.content.parameterize
+ node.parent['class'] = 'method-signature'
+ node.parent.inner_html = node.parent.inner_html.sub(/inherited from .*/, '\0')
+ end
+
+ css('.headerlink').each do |node|
+ id = node['href'][1..-1]
+ node.parent['id'] ||= id
+ node.remove
+ end
+
+ css('div[class^="highlight-"]').each do |node|
+ code = node.at_css('pre').content
+ code.remove! %r{\A\s*<\?php\s*} unless code.include?(' ?>')
+ node.content = code
+ node.name = 'pre'
+ end
+
+ css('.section').each do |node|
+ node.before(node.children).remove
+ end
- # Add id for constants and methods
- css('#constants strong', '#methods strong').each do |node|
- node.parent['id'] = node.content.strip
+ css('table[border]').each do |node|
+ node.remove_attribute('border')
end
doc
diff --git a/lib/docs/filters/phalcon/entries.rb b/lib/docs/filters/phalcon/entries.rb
index 3eab0f61..288b63c7 100644
--- a/lib/docs/filters/phalcon/entries.rb
+++ b/lib/docs/filters/phalcon/entries.rb
@@ -1,31 +1,28 @@
module Docs
class Phalcon
class EntriesFilter < Docs::EntriesFilter
-
def get_name
- node = css('h1').first
- name = node.content.strip
- node.remove
- name
+ (at_css('h1 > strong') || at_css('h1')).content.strip.remove('Phalcon\\')
end
def get_type
- if slug.start_with? 'reference'
+ if slug.start_with?('reference')
'Guides'
else
- 'Classes'
+ path = name.split('\\')
+ path[1] == 'Mvc' ? path[1..2].join('\\') : path[1]
end
end
def additional_entries
entries = []
- css('#constants strong').each do |node|
- entries << [node.content.strip, node.parent['id'], 'Constants']
- end
-
- css('#methods strong').each do |node|
- entries << [node.content.strip, node.parent['id'], 'Methods']
+ css('.method-signature').each do |node|
+ next if node.content.include?('inherited from') || node.content.include?('protected ') || node.content.include?('private ')
+ name = node.at_css('strong').content.strip
+ next if name == '__construct' || name == '__toString'
+ name.prepend "#{self.name}::"
+ entries << [name, node['id']]
end
entries
diff --git a/lib/docs/scrapers/phalcon.rb b/lib/docs/scrapers/phalcon.rb
index abb29205..1eb992e7 100644
--- a/lib/docs/scrapers/phalcon.rb
+++ b/lib/docs/scrapers/phalcon.rb
@@ -1,8 +1,7 @@
module Docs
class Phalcon < UrlScraper
- self.name = 'Phalcon'
- self.slug = 'phalcon'
self.type = 'phalcon'
+ self.version = '2.0.6'
self.base_url = 'https://docs.phalconphp.com/en/latest/'
self.root_path = 'index.html'
self.links = {
@@ -10,14 +9,16 @@ module Docs
code: 'https://github.com/phalcon/cphalcon/'
}
- html_filters.push 'phalcon/clean_html', 'phalcon/entries', 'title'
+ html_filters.push 'phalcon/clean_html', 'phalcon/entries'
options[:root_title] = 'Phalcon'
options[:only_patterns] = [/reference\//, /api\//]
- options[:skip_patterns] = [/api\/index/]
+ options[:skip] = %w(
+ api/index.html
+ reference/license.html)
options[:attribution] = <<-HTML
- © 2012–2015 the Phalcon Team
+ © 2011–2015 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
HTML
end
diff --git a/public/icons/docs/phalcon/16.png b/public/icons/docs/phalcon/16.png
index ef92e6ba..3a13007d 100644
Binary files a/public/icons/docs/phalcon/16.png and b/public/icons/docs/phalcon/16.png differ
diff --git a/public/icons/docs/phalcon/16@2x.png b/public/icons/docs/phalcon/16@2x.png
index 6356d3ad..d04e2973 100644
Binary files a/public/icons/docs/phalcon/16@2x.png and b/public/icons/docs/phalcon/16@2x.png differ