This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
forked from mislav/hanna
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erik Hollensbe
committed
Jul 8, 2010
1 parent
5950155
commit 4cad931
Showing
3 changed files
with
114 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,83 +1,83 @@ | |||
- for section in values[:sections] | - section = values[:section] | ||
#section | #section | ||
- if section[:sectitle] | - if section[:sectitle] | ||
%h2= link_to section[:sectitle], section[:secsequence] | %h2= link_to section[:sectitle], section[:secsequence] | ||
- if section[:seccomment] | - if section[:seccomment] | ||
.section-comment= section[:seccomment] | .section-comment= section[:seccomment] | ||
|
|
||
- if section[:classlist] | - if section[:classlist] =~ /<li>/ | ||
#class-list | #class-list | ||
%h2 Classes and Modules | %h2 Classes and Modules | ||
= section[:classlist] | = section[:classlist] | ||
|
|
||
- if section[:constants] | - unless section[:constants].empty? | ||
#constants-list | #constants-list | ||
%h2 Constants | %h2 Constants | ||
.name-list | .name-list | ||
%table{ :summary => "Constants" } | %table{ :summary => "Constants" } | ||
- for const in section[:constants] | - section[:constants].each do |const| | ||
%tr.top-aligned-row.context-row | |||
%td.context-item-name= const.name | |||
%td = | |||
%td.context-item-value= const.value | |||
- if const.description then | |||
%td | |||
%td.context-item-desc= const.description | |||
|
|||
- unless section[:aliases].empty? | |||
#aliases-list | |||
%h2 External Aliases | |||
.name-list | |||
%table{ :summary => "External aliases" } | |||
- section[:aliases].each do |alia| | |||
%tr.top-aligned-row.context-row | |||
%td.context-item-name= alia.old_name | |||
%td -> | |||
%td.context-item-value= alia.new_name | |||
- if alia[:desc] then | |||
%tr.top-aligned-row.context-row | %tr.top-aligned-row.context-row | ||
%td.context-item-name= const[:name] | %td | ||
%td = | %td.context-item-desc{ :colspan => "2" } | ||
%td.context-item-value= const[:value] | = alia.description | ||
- if const[:desc] then |
|
||
%td | - unless section[:attributes].empty? | ||
%td.context-item-desc= const[:desc] | #attribute-list | ||
|
%h2.section-bar Attributes | ||
- if section[:aliases] | .name-list | ||
#aliases-list | %table | ||
%h2 External Aliases | - section[:attributes].each do |attrib| | ||
.name-list | %tr.top-aligned-row.context-row | ||
%table{ :summary => "External aliases" } | %td.context-item-name= attrib.name | ||
- for alia in section[:aliases] | %td.context-item-value= attrib.rw ? "[#{attrib.rw}]" : ' ' | ||
%tr.top-aligned-row.context-row | %td.context-item-desc~ sanitize_code_blocks(attrib.description) | ||
%td.context-item-name= alia[:old_name] |
|
||
%td -> | - unless section[:method_list].empty? | ||
%td.context-item-value= alia[:new_name] | #methods | ||
- if alia[:desc] then | - section[:method_list].group_by { |x| [x.visibility, x.type].map(&:to_s).map(&:capitalize).join(" ") }.each do |type, list| | ||
%tr.top-aligned-row.context-row | - unless list.empty? | ||
%td | %h2== #{type} methods | ||
%td.context-item-desc{ :colspan => "2" } |
|
||
= alia[:desc] | - list.each do |method| | ||
|
.method{ :id => "method-#{method.aref}", :class => "#{type.gsub(/\s+/, '-')}".downcase } | ||
- if section[:attributes] | %a{ :name => method.aref } | ||
#attribute-list | .synopsis | ||
%h2.section-bar Attributes | - method_html = capture_haml do | ||
.name-list | - if method.call_seq | ||
%table | %span.name= method.call_seq | ||
- for attr in section[:attributes] | |||
%tr.top-aligned-row.context-row | |||
%td.context-item-name= attr[:name] | |||
%td.context-item-value= attr[:rw] ? "[#{attr[:rw]}]" : ' ' | |||
%td.context-item-desc~ sanitize_code_blocks(attr[:a_desc]) | |||
|
|||
- if section[:method_list] | |||
#methods | |||
- for list in section[:method_list] | |||
- if list[:methods] then | |||
%h2== #{list[:type]} #{list[:category].downcase} methods | |||
|
|||
- for method in list[:methods] | |||
.method{ :id => "method-#{method[:aref]}", :class => "#{list[:type]}-#{list[:category]}".downcase } | |||
%a{ :name => method[:aref] } | |||
.synopsis | |||
- method_html = capture_haml do | |||
- if method[:callseq] | |||
%span.name= method[:callseq] | |||
- else | |||
%span.name= method[:name] | |||
%span.arguments= method[:params] | |||
- if method[:codeurl] | |||
%a.method-signature{ :href => method[:codeurl], :onclick => "popupCode(this.href); return false", :target => "Code" } | |||
= method_html | |||
- else | - else | ||
= method_html | %span.name= method.name | ||
- if method[:m_desc] | %span.arguments= method.params | ||
.description | -#- if method[:codeurl] | ||
~ sanitize_code_blocks method[:m_desc] | -#%a.method-signature{ :href => method[:codeurl], :onclick => "popupCode(this.href); return false", :target => "Code" } | ||
- if method[:sourcecode] | -#= method_html | ||
.source | -#- else | ||
- name = "#{method[:aref]}-source" | = method_html | ||
%a.source-toggle{ :href => "#", :onclick => "toggleCode('#{name}'); return false" } | - if method.description | ||
[show source] | .description | ||
~ "<pre id='#{name}'>#{method[:sourcecode]}</pre>" | ~ sanitize_code_blocks method.description | ||
- if method.markup_code | |||
.source | |||
- name = "#{method.aref}-source" | |||
%a.source-toggle{ :href => "#", :onclick => "toggleCode('#{name}'); return false" } | |||
[show source] | |||
~ "<pre id='#{name}'>#{method.markup_code}</pre>" |