Explorar el Código

Update Phaser documentation (2.4.6)

Fixes #283.
Thibaut Courouble hace 9 años
padre
commit
5d8549be3a

+ 0 - 3
lib/docs/filters/phaser/clean_html.rb

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

+ 6 - 3
lib/docs/filters/phaser/entries.rb

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

+ 2 - 1
lib/docs/scrapers/phaser.rb

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