Add Phaser documentation

pull/229/merge
Jérémie Ledentu 10 years ago committed by Thibaut
parent f0cb4b69cf
commit 5e4c30c86a

@ -0,0 +1,6 @@
#= require views/pages/base
class app.views.PhaserPage extends app.views.BasePage
afterRender: ->
@highlightCode @findAll('pre.source'), 'javascript'
return

@ -54,6 +54,7 @@
'pages/nginx',
'pages/node',
'pages/npm',
'pages/phaser',
'pages/php',
'pages/phpunit',
'pages/postgres',

@ -54,6 +54,7 @@
'pages/nginx',
'pages/node',
'pages/npm',
'pages/phaser',
'pages/php',
'pages/phpunit',
'pages/postgres',

@ -0,0 +1,23 @@
._phaser {
h2 { @extend %block-heading; }
h4 { @extend %block-label, %label-blue; }
p > code, li > code, td > code { @extend %label; }
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;
}
}

@ -0,0 +1,31 @@
module Docs
class Phaser
class CleanHtmlFilter < Filter
def call
title = at_css('h1')
if root_page?
doc.children = at_css('#docs-index')
# Remove first paragraph (old doc details)
doc.at_css('p').remove()
else
doc.children = at_css('#docs')
# Remove "Jump to" block
doc.at_css('table').remove()
end
doc.child.before title
# Clean code blocks
css('pre > code').each do |node|
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,44 @@
module Docs
class Phaser
class EntriesFilter < Docs::EntriesFilter
REPLACE_TYPES = {
'gameobjects' => 'Game Objects',
'geom' => 'Geometry',
'tilemap' => 'Tilemaps',
'net' => 'Network',
'tween' => 'Tweens',
'pixi' => 'PIXI'
}
TYPE_GROUPS = {
'Core' => ['loader']
}
def get_name
name = at_css('.title-frame h1').content
name.sub! /Phaser\./, ''
name.sub! /PIXI\./, ''
name
end
def get_type
src = at_css('.container-overview .details > .tag-source > a')
if src
src = src.content.split('/').first
TYPE_GROUPS.each_pair do |replacement, types|
types.each do |t|
return replacement if src == t
end
end
return REPLACE_TYPES[src] || src.capitalize
end
'Global'
end
end
end
end

@ -0,0 +1,30 @@
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}"
self.links = {
home: 'https://phaser.io/',
code: 'https://github.com/photonstorm/phaser'
}
html_filters.push 'phaser/entries', 'phaser/clean_html'
options[:skip] = %w(
/docs_pixi-jsdoc.js.html
/p2.Body.html
/Phaser.html
/PIXI.html
/PIXI.WebGLMaskManager.html
/PIXI.WebGLShaderManager.html
/PIXI.WebGLSpriteBatch.html
/PIXI.WebGLStencilManager.html)
options[:attribution] = <<-HTML
&copy; 2015 Richard Davey, Photon Storm Ltd.<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1 @@
https://phaser.io/
Loading…
Cancel
Save