Unified · Split
| @@ -0,0 +1,6 @@ | |||
| 1 | #= require views/pages/base | ||
| 2 | |||
| 3 | class app.views.PhaserPage extends app.views.BasePage | ||
| 4 | afterRender: -> | ||
| 5 | @highlightCode @findAll('pre.source'), 'javascript' | ||
| 6 | return | ||
| @@ -54,6 +54,7 @@ · 53 unmodified lines | |||
| 54 | 'pages/nginx', | 54 | 'pages/nginx', |
| 55 | 'pages/node', | 55 | 'pages/node', |
| 56 | 'pages/npm', | 56 | 'pages/npm', |
| 57 | 'pages/phaser', | ||
| 57 | 'pages/php', | 58 | 'pages/php', |
| 58 | 'pages/phpunit', | 59 | 'pages/phpunit', |
| 59 | 'pages/postgres', | 60 | 'pages/postgres', |
| @@ -54,6 +54,7 @@ · 53 unmodified lines | |||
| 54 | 'pages/nginx', | 54 | 'pages/nginx', |
| 55 | 'pages/node', | 55 | 'pages/node', |
| 56 | 'pages/npm', | 56 | 'pages/npm', |
| 57 | 'pages/phaser', | ||
| 57 | 'pages/php', | 58 | 'pages/php', |
| 58 | 'pages/phpunit', | 59 | 'pages/phpunit', |
| 59 | 'pages/postgres', | 60 | 'pages/postgres', |
| @@ -0,0 +1,23 @@ | |||
| 1 | ._phaser { | ||
| 2 | h2 { @extend %block-heading; } | ||
| 3 | h4 { @extend %block-label, %label-blue; } | ||
| 4 | |||
| 5 | p > code, li > code, td > code { @extend %label; } | ||
| 6 | |||
| 7 | dt.tag-source { | ||
| 8 | color: #666; | ||
| 9 | font-weight: normal; | ||
| 10 | } | ||
| 11 | |||
| 12 | .deprecated-notice { | ||
| 13 | @extend %note; | ||
| 14 | } | ||
| 15 | |||
| 16 | #docs-index > h3 { @extend %block-label, %label-blue; } | ||
| 17 | #docs > h3 { @extend %block-heading; } | ||
| 18 | #docs > h4 { @extend %block-label, %label-blue; } | ||
| 19 | |||
| 20 | #docs header { | ||
| 21 | display: none; | ||
| 22 | } | ||
| 23 | } | ||
| @@ -0,0 +1,31 @@ | |||
| 1 | module Docs | ||
| 2 | class Phaser | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | |||
| 6 | title = at_css('h1') | ||
| 7 | |||
| 8 | if root_page? | ||
| 9 | doc.children = at_css('#docs-index') | ||
| 10 | |||
| 11 | # Remove first paragraph (old doc details) | ||
| 12 | doc.at_css('p').remove() | ||
| 13 | else | ||
| 14 | doc.children = at_css('#docs') | ||
| 15 | |||
| 16 | # Remove "Jump to" block | ||
| 17 | doc.at_css('table').remove() | ||
| 18 | end | ||
| 19 | |||
| 20 | doc.child.before title | ||
| 21 | |||
| 22 | # Clean code blocks | ||
| 23 | css('pre > code').each do |node| | ||
| 24 | node.before(node.children).remove | ||
| 25 | end | ||
| 26 | |||
| 27 | doc | ||
| 28 | end | ||
| 29 | end | ||
| 30 | end | ||
| 31 | end | ||
| @@ -0,0 +1,44 @@ | |||
| 1 | module Docs | ||
| 2 | class Phaser | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | |||
| 5 | REPLACE_TYPES = { | ||
| 6 | 'gameobjects' => 'Game Objects', | ||
| 7 | 'geom' => 'Geometry', | ||
| 8 | 'tilemap' => 'Tilemaps', | ||
| 9 | 'net' => 'Network', | ||
| 10 | 'tween' => 'Tweens', | ||
| 11 | 'pixi' => 'PIXI' | ||
| 12 | } | ||
| 13 | |||
| 14 | TYPE_GROUPS = { | ||
| 15 | 'Core' => ['loader'] | ||
| 16 | } | ||
| 17 | |||
| 18 | def get_name | ||
| 19 | name = at_css('.title-frame h1').content | ||
| 20 | name.sub! /Phaser\./, '' | ||
| 21 | name.sub! /PIXI\./, '' | ||
| 22 | name | ||
| 23 | end | ||
| 24 | |||
| 25 | def get_type | ||
| 26 | src = at_css('.container-overview .details > .tag-source > a') | ||
| 27 | |||
| 28 | if src | ||
| 29 | src = src.content.split('/').first | ||
| 30 | |||
| 31 | TYPE_GROUPS.each_pair do |replacement, types| | ||
| 32 | types.each do |t| | ||
| 33 | return replacement if src == t | ||
| 34 | end | ||
| 35 | end | ||
| 36 | |||
| 37 | return REPLACE_TYPES[src] || src.capitalize | ||
| 38 | end | ||
| 39 | |||
| 40 | 'Global' | ||
| 41 | end | ||
| 42 | end | ||
| 43 | end | ||
| 44 | end | ||
| @@ -0,0 +1,30 @@ | |||
| 1 | module Docs | ||
| 2 | class Phaser < UrlScraper | ||
| 3 | self.name = 'Phaser' | ||
| 4 | self.slug = 'phaser' | ||
| 5 | self.type = 'phaser' | ||
| 6 | self.version = '2.3.0' | ||
| 7 | self.base_url = "https://phaser.io/docs/#{version}" | ||
| 8 | self.links = { | ||
| 9 | home: 'https://phaser.io/', | ||
| 10 | code: 'https://github.com/photonstorm/phaser' | ||
| 11 | } | ||
| 12 | |||
| 13 | html_filters.push 'phaser/entries', 'phaser/clean_html' | ||
| 14 | |||
| 15 | options[:skip] = %w( | ||
| 16 | /docs_pixi-jsdoc.js.html | ||
| 17 | /p2.Body.html | ||
| 18 | /Phaser.html | ||
| 19 | /PIXI.html | ||
| 20 | /PIXI.WebGLMaskManager.html | ||
| 21 | /PIXI.WebGLShaderManager.html | ||
| 22 | /PIXI.WebGLSpriteBatch.html | ||
| 23 | /PIXI.WebGLStencilManager.html) | ||
| 24 | |||
| 25 | options[:attribution] = <<-HTML | ||
| 26 | © 2015 Richard Davey, Photon Storm Ltd.<br> | ||
| 27 | Licensed under the MIT License. | ||
| 28 | HTML | ||
| 29 | end | ||
| 30 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://phaser.io/ | ||