Thibaut 10 лет назад
Родитель
Сommit
5de8c37258

BIN
assets/images/icons.png


BIN
assets/images/icons@2x.png


+ 1 - 1
assets/javascripts/news.json

@@ -1,7 +1,7 @@
 [
   [
     "2015-11-22",
-    "New documentations: <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</a> and <a href=\"/flow/\">Flow</a>"
+    "New documentations: <a href=\"/phoenix/\">Phoenix</a>, <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</a> and <a href=\"/flow/\">Flow</a>"
   ], [
     "2015-11-08",
     "New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>"

+ 5 - 0
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -299,6 +299,11 @@ credits = [
     '2015 Richard Davey, Photon Storm Ltd.',
     'MIT',
     'https://raw.githubusercontent.com/photonstorm/phaser/master/license.txt'
+  ], [
+    'Phoenix',
+    '2014 Chris McCord',
+    'MIT',
+    'https://raw.githubusercontent.com/phoenixframework/phoenix/master/LICENSE.md'
   ], [
     'PHP',
     '1997-2015 The PHP Documentation Group',

+ 1 - 0
assets/stylesheets/global/_icons.scss

@@ -121,3 +121,4 @@
 ._icon-dojo:before          { background-position: -6rem -9rem; }
 ._icon-flow:before          { background-position: -7rem -9rem; }
 ._icon-relay:before         { background-position: -8rem -9rem; }
+._icon-phoenix:before       { background-position: -9rem -9rem; }

+ 11 - 2
lib/docs/filters/elixir/entries.rb

@@ -12,7 +12,11 @@ module Docs
         when 'protocol'
           'Protocols'
         else
-          name.split('.').first
+          if name.start_with?('Phoenix')
+            name.split('.')[0..2].join('.')
+          else
+            name.split('.').first
+          end
         end
       end
 
@@ -29,12 +33,17 @@ module Docs
 
           unless node.parent['class'].end_with?('macro') || self.name.start_with?('Kernel')
             name.prepend "#{self.name}."
-            name << " (#{id.split('/').last})"
           end
 
+          name << " (#{id.split('/').last})" if id =~ /\/\d+\z/
+
           [name, id]
         end
       end
+
+      def include_default_entry?
+        !slug.end_with?('extra-api-reference')
+      end
     end
   end
 end

+ 46 - 0
lib/docs/scrapers/phoenix.rb

@@ -0,0 +1,46 @@
+module Docs
+  class Phoenix < Elixir
+    self.type = 'elixir'
+    self.version = '1.0.3'
+    self.base_url = 'http://hexdocs.pm/'
+    self.root_path = 'phoenix/Phoenix.html'
+    self.initial_paths = %w(
+      phoenix/extra-api-reference.html
+      ecto/extra-api-reference.html
+      phoenix_html/extra-api-reference.html
+      plug/extra-api-reference.html)
+    self.links = {
+      home: 'http://www.phoenixframework.org',
+      code: 'https://github.com/phoenixframework/phoenix'
+    }
+
+    options[:root_title] = false
+
+    options[:skip_patterns] = [/extra-api-reference/]
+    options[:only_patterns] = [
+      /\Aphoenix\//,
+      /\Aecto\//,
+      /\Aphoenix_html\//,
+      /\Aplug\//
+    ]
+
+    options[:attribution] = -> (filter) {
+      if filter.slug.start_with?('ecto')
+        <<-HTML
+          &copy; 2012 Plataformatec<br>
+          Licensed under the Apache License, Version 2.0.
+        HTML
+      elsif filter.slug.start_with?('plug')
+        <<-HTML
+          &copy; 2013 Plataformatec<br>
+          Licensed under the Apache License, Version 2.0.
+        HTML
+      else
+        <<-HTML
+          &copy; 2014 Chris McCord<br>
+          Licensed under the MIT License.
+        HTML
+      end
+    }
+  end
+end

BIN
public/icons/docs/phoenix/16.png


BIN
public/icons/docs/phoenix/16@2x.png


+ 1 - 0
public/icons/docs/phoenix/SOURCE

@@ -0,0 +1 @@
+https://github.com/phoenixframework/phoenix/blob/master/logo.png