Update Phaser documentation (2.4.6)

Fixes #283.
pull/359/merge
Thibaut Courouble 9 years ago
parent d1f51aeff8
commit 5d8549be3a

@ -37,9 +37,6 @@ module Docs
css('h4.name').each do |node| css('h4.name').each do |node|
node.name = 'h3' node.name = 'h3'
end end
# Remove "Jump to" block
at_css('table').remove
end end
doc.child.before(title) doc.child.before(title)

@ -16,8 +16,9 @@ module Docs
def get_name def get_name
name = at_css('.title-frame h1').content name = at_css('.title-frame h1').content
name.remove!('Phaser.') name.remove! %r{\A\w+: }
name.remove!('PIXI.') name.remove! 'Phaser.'
name.remove! 'PIXI.'
name name
end end
@ -40,6 +41,7 @@ module Docs
end end
def additional_entries def additional_entries
return [] if self.name == 'KeyCode'
entries = [] entries = []
%w(members methods).each do |type| %w(members methods).each do |type|
@ -47,7 +49,8 @@ module Docs
sig = node.at_css('.type-signature') sig = node.at_css('.type-signature')
next if node.parent.parent.at_css('.inherited-from') || (sig && sig.content.include?('internal')) next if node.parent.parent.at_css('.inherited-from') || (sig && sig.content.include?('internal'))
sep = sig && sig.content.include?('static') ? '.' : '#' sep = sig && sig.content.include?('static') ? '.' : '#'
name = "#{self.name}#{sep}#{node['id']}#{'()' if type == 'methods'}" function = node['id'].remove(/\A\./)
name = "#{self.name}#{sep}#{function}#{'()' if type == 'methods'}"
entries << [name, node['id']] entries << [name, node['id']]
end end
end end

@ -1,8 +1,9 @@
module Docs module Docs
class Phaser < UrlScraper class Phaser < UrlScraper
self.type = 'phaser' self.type = 'phaser'
self.release = '2.4.1' self.release = '2.4.6'
self.base_url = "http://phaser.io/docs/#{release}" self.base_url = "http://phaser.io/docs/#{release}"
self.root_path = '/index'
self.links = { self.links = {
home: 'http://phaser.io/', home: 'http://phaser.io/',
code: 'https://github.com/photonstorm/phaser' code: 'https://github.com/photonstorm/phaser'

Loading…
Cancel
Save