diff --git a/assets/images/icons.png b/assets/images/icons.png
index af98d017..98dc7672 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 1e6de1eb..bc6f67db 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 747eb845..ffeab822 100644
--- a/assets/javascripts/news.json
+++ b/assets/javascripts/news.json
@@ -1,7 +1,7 @@
[
[
"2015-07-05",
- "New documentations: Drupal and webpack"
+ "New documentations: Drupal, Phaser and webpack"
], [
"2015-05-24",
"New Rust documentation"
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index 944cd60f..8f386e5e 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -275,6 +275,11 @@ credits = [
'npm, Inc. and Contributors
npm is a trademark of npm, Inc.',
'npm',
'https://raw.githubusercontent.com/npm/npm/master/LICENSE'
+ ], [
+ 'Phaser',
+ '2015 Richard Davey, Photon Storm Ltd.',
+ 'MIT',
+ 'https://raw.githubusercontent.com/photonstorm/phaser/master/license.txt'
], [
'PHP',
'1997-2015 The PHP Documentation Group',
diff --git a/assets/javascripts/views/pages/javascript.coffee b/assets/javascripts/views/pages/javascript.coffee
index 955f14e8..7e7eaeb0 100644
--- a/assets/javascripts/views/pages/javascript.coffee
+++ b/assets/javascripts/views/pages/javascript.coffee
@@ -25,6 +25,7 @@ app.views.ModernizrPage =
app.views.MomentPage =
app.views.MongoosePage =
app.views.NodePage =
+app.views.PhaserPage =
app.views.RethinkdbPage =
app.views.SinonPage =
app.views.UnderscorePage =
diff --git a/assets/javascripts/views/pages/phaser.coffee b/assets/javascripts/views/pages/phaser.coffee
deleted file mode 100644
index d9949116..00000000
--- a/assets/javascripts/views/pages/phaser.coffee
+++ /dev/null
@@ -1,6 +0,0 @@
-#= require views/pages/base
-
-class app.views.PhaserPage extends app.views.BasePage
- afterRender: ->
- @highlightCode @findAll('pre.source'), 'javascript'
- return
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index 87c04242..d545a9a9 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -103,3 +103,4 @@
._icon-apache_http_server:before { background-position: -9rem -7rem; }
._icon-drupal:before { background-position: 0 -8rem; }
._icon-webpack:before { background-position: -1rem -8rem; @extend %darkIconFix !optional; }
+._icon-phaser:before { background-position: -2rem -8rem; }
diff --git a/assets/stylesheets/pages/_phaser.scss b/assets/stylesheets/pages/_phaser.scss
index a5314793..2effc2ae 100644
--- a/assets/stylesheets/pages/_phaser.scss
+++ b/assets/stylesheets/pages/_phaser.scss
@@ -1,23 +1,10 @@
._phaser {
- h2 { @extend %block-heading; }
- h4 { @extend %block-label, %label-blue; }
+ @extend %simple;
- p > code, li > code, td > code { @extend %label; }
-
- dt.tag-source {
+ .type-signature, dt.tag-source {
color: #666;
font-weight: normal;
}
- .deprecated-notice {
- @extend %note;
- }
-
- #docs-index > h3 { @extend %block-label, %label-blue; }
- #docs > h3 { @extend %block-heading; }
- #docs > h4 { @extend %block-label, %label-blue; }
-
- #docs header {
- display: none;
- }
+ .deprecated-notice { @extend %note; }
}
diff --git a/lib/docs/filters/phaser/clean_html.rb b/lib/docs/filters/phaser/clean_html.rb
index 6a384cae..c69a89db 100644
--- a/lib/docs/filters/phaser/clean_html.rb
+++ b/lib/docs/filters/phaser/clean_html.rb
@@ -2,22 +2,47 @@ module Docs
class Phaser
class CleanHtmlFilter < Filter
def call
-
title = at_css('h1')
if root_page?
- doc.children = at_css('#docs-index')
+ @doc = at_css('#docs-index')
# Remove first paragraph (old doc details)
- doc.at_css('p').remove()
+ at_css('p').remove
+
+ title.content = 'Phaser'
else
- doc.children = at_css('#docs')
+ @doc = at_css('#docs')
+
+ # Remove useless markup
+ css('section > article').each do |node|
+ node.parent.replace(node.children)
+ end
+
+ css('dt > h4').each do |node|
+ dt = node.parent
+ dd = dt.next_element
+ dt.before(node).remove
+ dd.before(dd.children).remove
+ end
+
+ css('> div', '> section').each do |node|
+ node.before(node.children).remove
+ end
+
+ css('h3.subsection-title').each do |node|
+ node.name = 'h2'
+ end
+
+ css('h4.name').each do |node|
+ node.name = 'h3'
+ end
# Remove "Jump to" block
- doc.at_css('table').remove()
+ at_css('table').remove
end
- doc.child.before title
+ doc.child.before(title)
# Clean code blocks
css('pre > code').each do |node|
diff --git a/lib/docs/filters/phaser/entries.rb b/lib/docs/filters/phaser/entries.rb
index f6b720ba..00d9221c 100644
--- a/lib/docs/filters/phaser/entries.rb
+++ b/lib/docs/filters/phaser/entries.rb
@@ -1,7 +1,6 @@
module Docs
class Phaser
class EntriesFilter < Docs::EntriesFilter
-
REPLACE_TYPES = {
'gameobjects' => 'Game Objects',
'geom' => 'Geometry',
@@ -17,8 +16,8 @@ module Docs
def get_name
name = at_css('.title-frame h1').content
- name.sub! /Phaser\./, ''
- name.sub! /PIXI\./, ''
+ name.remove!('Phaser.')
+ name.remove!('PIXI.')
name
end
@@ -39,6 +38,22 @@ module Docs
'Global'
end
+
+ def additional_entries
+ entries = []
+
+ %w(members methods).each do |type|
+ css("##{type} h4.name").each do |node|
+ sig = node.at_css('.type-signature')
+ next if node.parent.parent.at_css('.inherited-from') || (sig && sig.content.include?('internal'))
+ sep = sig && sig.content.include?('static') ? '.' : '#'
+ name = "#{self.name}#{sep}#{node['id']}#{'()' if type == 'methods'}"
+ entries << [name, node['id']]
+ end
+ end
+
+ entries
+ end
end
end
end
diff --git a/lib/docs/scrapers/phaser.rb b/lib/docs/scrapers/phaser.rb
index 2da584f0..fa8a5a02 100644
--- a/lib/docs/scrapers/phaser.rb
+++ b/lib/docs/scrapers/phaser.rb
@@ -1,7 +1,5 @@
module Docs
class Phaser < UrlScraper
- self.name = 'Phaser'
- self.slug = 'phaser'
self.type = 'phaser'
self.version = '2.3.0'
self.base_url = "https://phaser.io/docs/#{version}"
diff --git a/public/icons/docs/phaser/16.png b/public/icons/docs/phaser/16.png
index 250d2388..f97cfdbf 100644
Binary files a/public/icons/docs/phaser/16.png and b/public/icons/docs/phaser/16.png differ
diff --git a/public/icons/docs/phaser/16@2x.png b/public/icons/docs/phaser/16@2x.png
index 8af261f3..80b24ec6 100644
Binary files a/public/icons/docs/phaser/16@2x.png and b/public/icons/docs/phaser/16@2x.png differ