Skip to content

Commit 5de8c37

Browse files
committed
Add Phoenix documentation
1 parent 9e6420b commit 5de8c37

File tree

10 files changed

+65
-3
lines changed

10 files changed

+65
-3
lines changed

assets/images/icons.png

360 Bytes
Loading

assets/images/icons@2x.png

994 Bytes
Loading

assets/javascripts/news.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
[
33
"2015-11-22",
4-
"New documentations: <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</a> and <a href=\"/flow/\">Flow</a>"
4+
"New documentations: <a href=\"/phoenix/\">Phoenix</a>, <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</a> and <a href=\"/flow/\">Flow</a>"
55
], [
66
"2015-11-08",
77
"New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>"

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ credits = [
299299
'2015 Richard Davey, Photon Storm Ltd.',
300300
'MIT',
301301
'https://raw.githubusercontent.com/photonstorm/phaser/master/license.txt'
302+
], [
303+
'Phoenix',
304+
'2014 Chris McCord',
305+
'MIT',
306+
'https://raw.githubusercontent.com/phoenixframework/phoenix/master/LICENSE.md'
302307
], [
303308
'PHP',
304309
'1997-2015 The PHP Documentation Group',

assets/stylesheets/global/_icons.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@
121121
._icon-dojo:before { background-position: -6rem -9rem; }
122122
._icon-flow:before { background-position: -7rem -9rem; }
123123
._icon-relay:before { background-position: -8rem -9rem; }
124+
._icon-phoenix:before { background-position: -9rem -9rem; }

lib/docs/filters/elixir/entries.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ def get_type
1212
when 'protocol'
1313
'Protocols'
1414
else
15-
name.split('.').first
15+
if name.start_with?('Phoenix')
16+
name.split('.')[0..2].join('.')
17+
else
18+
name.split('.').first
19+
end
1620
end
1721
end
1822

@@ -29,12 +33,17 @@ def additional_entries
2933

3034
unless node.parent['class'].end_with?('macro') || self.name.start_with?('Kernel')
3135
name.prepend "#{self.name}."
32-
name << " (#{id.split('/').last})"
3336
end
3437

38+
name << " (#{id.split('/').last})" if id =~ /\/\d+\z/
39+
3540
[name, id]
3641
end
3742
end
43+
44+
def include_default_entry?
45+
!slug.end_with?('extra-api-reference')
46+
end
3847
end
3948
end
4049
end

lib/docs/scrapers/phoenix.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module Docs
2+
class Phoenix < Elixir
3+
self.type = 'elixir'
4+
self.version = '1.0.3'
5+
self.base_url = 'http://hexdocs.pm/'
6+
self.root_path = 'phoenix/Phoenix.html'
7+
self.initial_paths = %w(
8+
phoenix/extra-api-reference.html
9+
ecto/extra-api-reference.html
10+
phoenix_html/extra-api-reference.html
11+
plug/extra-api-reference.html)
12+
self.links = {
13+
home: 'http://www.phoenixframework.org',
14+
code: 'https://github.com/phoenixframework/phoenix'
15+
}
16+
17+
options[:root_title] = false
18+
19+
options[:skip_patterns] = [/extra-api-reference/]
20+
options[:only_patterns] = [
21+
/\Aphoenix\//,
22+
/\Aecto\//,
23+
/\Aphoenix_html\//,
24+
/\Aplug\//
25+
]
26+
27+
options[:attribution] = -> (filter) {
28+
if filter.slug.start_with?('ecto')
29+
<<-HTML
30+
&copy; 2012 Plataformatec<br>
31+
Licensed under the Apache License, Version 2.0.
32+
HTML
33+
elsif filter.slug.start_with?('plug')
34+
<<-HTML
35+
&copy; 2013 Plataformatec<br>
36+
Licensed under the Apache License, Version 2.0.
37+
HTML
38+
else
39+
<<-HTML
40+
&copy; 2014 Chris McCord<br>
41+
Licensed under the MIT License.
42+
HTML
43+
end
44+
}
45+
end
46+
end

public/icons/docs/phoenix/16.png

426 Bytes
Loading
956 Bytes
Loading

public/icons/docs/phoenix/SOURCE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/phoenixframework/phoenix/blob/master/logo.png

0 commit comments

Comments
 (0)