Don't use a table for constants -- too hard to read.
This commit is contained in:
parent
6a1c1c8c3d
commit
41f1f30e0f
@ -52,19 +52,31 @@ table.datagrid
|
||||
// Reference
|
||||
|
||||
body.reference
|
||||
h3.mixin
|
||||
background-color: #eee
|
||||
border: 1px solid #aaa
|
||||
padding: 0.75em
|
||||
margin-bottom: 0
|
||||
a.permalink
|
||||
+hover-link
|
||||
+link-colors("inherit", "inherit")
|
||||
h3
|
||||
&.mixin, &.constant
|
||||
font-family: Monaco, courier
|
||||
font-weight: 200
|
||||
+text-shadow
|
||||
background-color: #eee
|
||||
border: 1px solid #aaa
|
||||
padding: 0.75em
|
||||
margin-bottom: 0
|
||||
a.permalink
|
||||
+hover-link
|
||||
+link-colors("inherit", "inherit")
|
||||
.source-documentation
|
||||
background-color: #eee
|
||||
border: 1px solid #aaa
|
||||
border-top-width: 0
|
||||
padding: 0.75em
|
||||
dl.source-documentation
|
||||
margin-top: 0
|
||||
dt
|
||||
font-weight: bold
|
||||
float: left
|
||||
margin-right: 15px
|
||||
dt:not(:first-child)
|
||||
margin-top: 1em
|
||||
a.view-source
|
||||
float: right
|
||||
margin: 1.25em
|
||||
|
10
doc-src/layouts/partials/reference/const_table.haml
Normal file
10
doc-src/layouts/partials/reference/const_table.haml
Normal file
@ -0,0 +1,10 @@
|
||||
- constants.each do |constant_def|
|
||||
- const_id = constant_def.name.gsub(/_/,'-')
|
||||
%h3.constant{:id=>"const-#{const_id}"}
|
||||
%a.permalink{:href => "#const-#{const_id}"}= "!"+constant_def.name
|
||||
%dl.constant-details.source-documentation
|
||||
%dt Value
|
||||
%dd= constant_def.expr.to_sass(:html)
|
||||
- if constant_def.comment
|
||||
%dt Description
|
||||
%dd= format_doc constant_def.comment
|
@ -1,29 +1,12 @@
|
||||
- if (constant_defs = constants(@item)).any?
|
||||
%h2 Constants
|
||||
- show_description = constant_defs.detect{|d| d.comment } && true
|
||||
- cycle 'even', 'odd' do |row_classes|
|
||||
- cycle 'even', 'odd' do |col_classes|
|
||||
%table.constants{:cellspacing => "0", :cellpadding=>"0", :border => "0"}
|
||||
%thead
|
||||
%tr{:class => row_classes.next}
|
||||
%th{:class => col_classes.next} Constant
|
||||
%th{:class => col_classes.next} Value
|
||||
- if show_description
|
||||
%th{:class => col_classes.next} Description
|
||||
%th{:class => col_classes.next} Configurable?
|
||||
- col_classes.reset!
|
||||
- constant_defs.each do |constant_def|
|
||||
%tr{:class => row_classes.next}
|
||||
%td{:class => col_classes.next}
|
||||
%code= "!"+constant_def.name
|
||||
%td{:class => col_classes.next}
|
||||
%code= constant_def.expr.to_sass(:html)
|
||||
- if show_description
|
||||
%td{:class => col_classes.next}
|
||||
- if constant_def.comment
|
||||
= format_doc constant_def.comment
|
||||
- else
|
||||
|
||||
%td{:class => col_classes.next}
|
||||
%code= constant_def.guarded ? "Y" : "N"
|
||||
- col_classes.reset!
|
||||
- variables = constant_defs.select{|d| d.guarded }
|
||||
- constants = constant_defs.reject{|d| d.guarded }
|
||||
- if variables.any?
|
||||
%h2
|
||||
Configurable Variables
|
||||
%a(href="/docs/tutorials/configurable-variables/" class="help") help
|
||||
= render "partials/reference/const_table", :constants => variables
|
||||
|
||||
- if constants.any?
|
||||
%h2 Constants
|
||||
= render "partials/reference/const_table", :constants => constants
|
Loading…
Reference in New Issue
Block a user