From e07dcf83dff68b102c66b71b9b2931a9eb1d5b2c Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Fri, 20 Mar 2009 05:49:47 -0500 Subject: [PATCH] Changes to PDoc template. --- templates/html/assets/images/alias.png | Bin 671 -> 733 bytes templates/html/assets/images/class_method.png | Bin 0 -> 857 bytes .../html/assets/images/class_property.png | Bin 0 -> 599 bytes .../html/assets/images/instance_method.png | Bin 0 -> 853 bytes .../html/assets/images/instance_property.png | Bin 0 -> 613 bytes templates/html/assets/images/subclass.png | Bin 0 -> 764 bytes templates/html/assets/images/superclass.png | Bin 0 -> 764 bytes .../html/assets/javascripts/application.js | 117 ++++++++++++++++-- templates/html/assets/stylesheets/api.css | 90 +++++++++++--- templates/html/assets/stylesheets/core.css | 21 ++-- templates/html/helpers.rb | 13 +- templates/html/layout.erb | 9 +- templates/html/namespace.erb | 16 ++- templates/html/partials/short_description.erb | 10 +- templates/html/section.erb | 2 +- 15 files changed, 234 insertions(+), 44 deletions(-) create mode 100644 templates/html/assets/images/class_method.png create mode 100755 templates/html/assets/images/class_property.png create mode 100644 templates/html/assets/images/instance_method.png create mode 100755 templates/html/assets/images/instance_property.png create mode 100755 templates/html/assets/images/subclass.png create mode 100755 templates/html/assets/images/superclass.png diff --git a/templates/html/assets/images/alias.png b/templates/html/assets/images/alias.png index f135248f82e3d0b87d29d1628057f62dc51ec6c6..6332fefea4be19eeadf211b0b202b272e8564898 100755 GIT binary patch delta 656 zcmV;B0&o4F1>FUZS$}UyL_t(I%cYa+OOs(3hy7c&F9n07hFK`6DJ57aZ`o{$icZ^> zb8Cvu_HHhny3GSEof8igwV~T+q&qkd!vkjG)Y3)j>rkSNA_!{3ufN_EO-IX!9{7EE z;JTjYzPaxt07?Io-!631b<7Trglu(*sOAYlSpK3q-0-}Dl7CvuNYQ99^F)DeT1vD} zN(xAl0q)`4zcD-3=e`utjSZ??dF zUwTSkb?%#=9?@^oxDy-O@tyN{L@by(WWvQ3%CyEu8x{+#Jb4 z-h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html/assets/images/class_property.png b/templates/html/assets/images/class_property.png new file mode 100755 index 0000000000000000000000000000000000000000..ebaf0e8743fc33cf152cb7694b865e8d8adbfa90 GIT binary patch literal 599 zcmV-d0;v6oP)GWQRM3$+Tx>2G~D3qqtDdzLJ$P+M| z%_5OV?1V_vbzR8Cf4JqIVHo)K^%pXcv3TotyGW%{h{xkw5Q#dkEiV=ekof!9z?%~d z=g(E7!z)Oq(;*j#L?RmyiObN>-n-ERY$OQs{fC-WE z`TR3JBO8xbMN0KSbiO^m!^f-pEr_bBgH6ZV(+;jrKl87%5H3QY5S&iu(~XVt z`Q%tE#s-6d3Aucs;QCb?w-;^voEneC7ITEh5sgOWa5&8962;=`54d^#1;35CDRwv< z7ITTajw2Wh%6`9}(Iu`wF^PG8L%bJ2;q&>deAA2$Oi`4b;)4JRkH=$mxm=9IcDvoO l^OXPhyYjA9E`GA_{V$1@FaBct0}KEF002ovPDHLkV1kGx8r%Q? literal 0 HcmV?d00001 diff --git a/templates/html/assets/images/instance_method.png b/templates/html/assets/images/instance_method.png new file mode 100644 index 0000000000000000000000000000000000000000..f6464ab43e4411fcfbd199a618d36300802f2ce2 GIT binary patch literal 853 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2v2c#=-!f5Z412HlDn;=k$&JJ5Q}Rd}-^p6H9iVS-ti6;vJ`! zuiQ6f{oy%>E^hw!@87<2>-L;obMM);vo{ZJI5KzY`sxKcIW&aun)POdpPWBbWvcb;B3bMwHG-F<5h&Rn{u|HI*x5b=SFDhoTEzpTB*0;KHU0ca9#pylvUGsr%2b zU%hqV{pZ&s^PMNIDcgU1+m_>t!cyHr)7-jOub7zNn_zwP^7d&*w3rf;m@vTI#*p68;Kvx^(j z!gHKTCqx6a$IC6g28^NVk|4ieAa{TO!{oy&UICr)+0(@_q~cc63MOXdR5yQ)ZpMzK zO2NH{e}q>yeC+;b8?3}I4xMCr0w0YTAaCk7sL9M0fC`YOQhPh zW>>H_Zx&LP?)LKv6|LvdUap%g(;Pf4z(#ueEY`R>FVdQ&MBb@0OS$#WdHyG literal 0 HcmV?d00001 diff --git a/templates/html/assets/images/instance_property.png b/templates/html/assets/images/instance_property.png new file mode 100755 index 0000000000000000000000000000000000000000..83ec984bd73364134da0f98d27a800c5d3264180 GIT binary patch literal 613 zcmV-r0-F7aP)^5T)AZ%#@G{_P{NCN^P z(J0zvSn~SSm(Ur);-M~8^*;61*VRI`T1BN&LAhK;sZ>I-SVW;vfUfJv=ko^ugnc0x zhJodBxe>iyk3%w<%wC8holUJ4(iv>tL{`DQt zPOsyUbO_Cmc&*iHkqbm3ku`|GcC^OhF>jj9W*GkH;^g!iUVpib_h*=@udp4h(P+e*zL_~ZmJjh(y^BxULwq>9zXoYE8sq{#pN~U0C6!8vY)5N2 z9P*}mw}7X$O^qTtJef1ACWvJT9^wt-)Zh0r~j#0bT`f;-zv6 z^Tmw22!%rMcs!TaUX<-8s;X-B`+Xbo+_uWuFa z1yIPc?DTrQ7KvRhmt*TG|L=EYQ=LqFX;=Lp`4}jx6BE-@00000NkvXXu0mjf=s_29 literal 0 HcmV?d00001 diff --git a/templates/html/assets/images/subclass.png b/templates/html/assets/images/subclass.png new file mode 100755 index 0000000000000000000000000000000000000000..9ebf013a23a56653655a736a7e149deb7365ea03 GIT binary patch literal 764 zcmV&SR3v>A``^efOSo-hEdApp;^Jd;9y!%1UfzX6Bh- z%-mbG|0Na{7Ruai_Y+DEb1s+b!*9k%Q!whMxjtZKA*?o;i1g&jy0@( zaU=-@d-h+o%gal6JRXEXA&L3`d2 z%jIxzZ~*p9O-;EJp_Ds0If38rM<5W8ic~K>FOK&2_p!CLg^i63OioVb6k$)zWHLx3 z5;!|M!}<9+#QSi1dRlbEcxPt^;cysUuU8@%3}RwpLRIGG<|IKnoyP6$Eh3SKw7a*r zSDXP=IYc&YZf;7@?fCe($^l9ORaJ3wbAx0uiC8QqRr$2t-Cfy8%XCI3B%pxJW>XdM zw~zPt_s}#A@pxQ5Ly)4szaMtH9lgE1SXx@b+S(fW`ub$fYPE8J7#bSNDzme*Ub07{ zQKV8SjEs!%0@v5ql8ggm!@$6Rbi^E8vBqpRM-}l+@5OSMrl+TWj*gC^qoV@>u{fQb zov5v?g~?>X@bEC&+uLPaQ&Ypn-y~^mZA}+f(&2EFH8eE%dU|@ENpN*_1-)L6_4Rc* zFuq@`IjX9vp1QiaK9ZojyZhnQURP99d=u;%37VRkpwsD4U0sd3x;hEQB&e^i|3QN0 z=H|Os1fRqaw!?#igLmS4HE!G3*ce(`TF}&SR3v>A``^efOSo-hEdApp;^Jd;9y!%1UfzX6Bh- z%-mbG|0Na{7Ruai_Y+DEb1s+b!*9k%Q!whMxjtZKA*?o;i1g&jy0@( zaU=-@d-h+o%gal6JRXEXA&L3`d2 z%jIxzZ~*p9O-;EJp_Ds0If38rM<5W8ic~K>FOK&2_p!CLg^i63OioVb6k$)zWHLx3 z5;!|M!}<9+#QSi1dRlbEcxPt^;cysUuU8@%3}RwpLRIGG<|IKnoyP6$Eh3SKw7a*r zSDXP=IYc&YZf;7@?fCe($^l9ORaJ3wbAx0uiC8QqRr$2t-Cfy8%XCI3B%pxJW>XdM zw~zPt_s}#A@pxQ5Ly)4szaMtH9lgE1SXx@b+S(fW`ub$fYPE8J7#bSNDzme*Ub07{ zQKV8SjEs!%0@v5ql8ggm!@$6Rbi^E8vBqpRM-}l+@5OSMrl+TWj*gC^qoV@>u{fQb zov5v?g~?>X@bEC&+uLPaQ&Ypn-y~^mZA}+f(&2EFH8eE%dU|@ENpN*_1-)L6_4Rc* zFuq@`IjX9vp1QiaK9ZojyZhnQURP99d=u;%37VRkpwsD4U0sd3x;hEQB&e^i|3QN0 z=H|Os1fRqaw!?#igLmS4HE!G3*ce(`TF}/, '').gsub(/<\/p>$/, '') + end + def javascript_include_tag(*names) names.map do |name| attributes = { @@ -115,7 +120,13 @@ module PDoc module CodeHelper def method_synopsis(object) - if (object.methodized?) + if (object.is_a?(Documentation::Property)) + return <<-EOS +
#{ object.signature }
+ EOS + end + + if (object.is_a?(Documentation::InstanceMethod) && object.methodized?) return <<-EOS
#{ object.signature } -> #{ auto_link(object.returns, false) }
 #{ object.generic_signature } -> #{ auto_link(object.returns, false) }
diff --git a/templates/html/layout.erb b/templates/html/layout.erb index fe0c045..5ee9e43 100644 --- a/templates/html/layout.erb +++ b/templates/html/layout.erb @@ -9,9 +9,8 @@ <%= javascript_include_tag "application", "code_highlighter" %> <%= javascript_include_tag "item_index" %> - - - <%= stylesheet_link_tag "grid", "highlighter", "core", "api" %> + + <%= stylesheet_link_tag "core", "api" %> @@ -20,7 +19,9 @@
-

Prototype JavaScript framework

+ +

Prototype JavaScript framework

+
diff --git a/templates/html/namespace.erb b/templates/html/namespace.erb index b3b04a0..d8af183 100644 --- a/templates/html/namespace.erb +++ b/templates/html/namespace.erb @@ -1,6 +1,6 @@ <% d = @doc_instance %> -<% @title = "#{d.full_name} (#{d.type})" %> +<% @title = "#{d.full_name} #{d.type}" %> <%= include "partials/breadcrumbs", :object => d %> @@ -118,6 +118,20 @@
<%= d.constructor.ebnf_expressions.join("\n").strip %>
+ <% unless d.constructor.arguments.empty? %> +
    + <% d.constructor.arguments.each do |arg| %> +
  • + <%= arg.name %> + <% unless arg.types.empty? %> + (<%= arg.types.map { |t| auto_link_code(t, false) }.join(' | ') %>) + <% end %> + <%= ' – ' + inline_htmlize(arg.description) unless arg.description.empty? %> +
  • + <% end %> +
+ <% end %> +

<%= htmlize(d.constructor.description) %>

diff --git a/templates/html/partials/short_description.erb b/templates/html/partials/short_description.erb index 9c402fe..23bba4b 100644 --- a/templates/html/partials/short_description.erb +++ b/templates/html/partials/short_description.erb @@ -1,8 +1,12 @@
  • -

    <%= object.name %>

    +

    <%= object.name %> + #

    + + <% if object.signature %> + <%= method_synopsis(object) %> + <% end %> <% if object.is_a?(Documentation::Method) %> - <%= method_synopsis(object) %> <% unless object.arguments.empty? %>
      <% object.arguments.each do |arg| %> @@ -11,7 +15,7 @@ <% unless arg.types.empty? %> (<%= arg.types.map { |t| auto_link_code(t, false) }.join(' | ') %>) <% end %> - <%= ' – ' + arg.description unless arg.description.empty? %> + <%= ' – ' + inline_htmlize(arg.description) unless arg.description.empty? %> <% end %>
    diff --git a/templates/html/section.erb b/templates/html/section.erb index c21039d..f433573 100644 --- a/templates/html/section.erb +++ b/templates/html/section.erb @@ -1,4 +1,4 @@ -<% @title = "#{@doc_instance.full_name} section" %> +<% @title = "#{@doc_instance.full_name}" %> <% section = @doc_instance %> <%= include "partials/breadcrumbs", :object => section %>