display a mixin source in a modal dialog.
This commit is contained in:
parent
5964d8d4ec
commit
559aebf9ab
@ -15,6 +15,16 @@
|
|||||||
%h2 Mixins
|
%h2 Mixins
|
||||||
|
|
||||||
- mixins(@item).each do |mixin|
|
- mixins(@item).each do |mixin|
|
||||||
%h3.mixin= mixin_signature mixin
|
%a.view-source{:href=>"#", :onclick => "$('#mixin-source-#{mixin.name}').dialog('open'); return false;"} View Source
|
||||||
|
%h3.mixin{:id=>"mixin-#{mixin.name}"}
|
||||||
|
%a.permalink{:href => "#mixin-#{mixin.name}"}= mixin_signature mixin
|
||||||
|
|
||||||
.source-documentation= format_doc(mixin.comment)
|
.source-documentation= format_doc(mixin.comment)
|
||||||
|
- render 'dialog', :title => "Source for +#{mixin.name}", :id => "mixin-source-#{mixin.name}" do
|
||||||
|
%pre.source-code.sass= mixin.to_sass
|
||||||
|
|
||||||
|
- content_for :footer do
|
||||||
|
:javascript
|
||||||
|
$(function(){
|
||||||
|
$('.ui-dialog').dialog({hide: true, modal: true, autoOpen: false, width: 400});
|
||||||
|
});
|
@ -1,4 +1,5 @@
|
|||||||
@import blueprint/reset
|
@import blueprint/reset
|
||||||
|
@import compass/utilities
|
||||||
|
|
||||||
@import blueprint
|
@import blueprint
|
||||||
|
|
||||||
@ -23,9 +24,15 @@ body.reference
|
|||||||
border: 3px solid #aaa
|
border: 3px solid #aaa
|
||||||
padding: 0.75em
|
padding: 0.75em
|
||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
|
a.permalink
|
||||||
|
+hover-link
|
||||||
|
+link-colors("inherit", "inherit")
|
||||||
.source-documentation
|
.source-documentation
|
||||||
background-color: #eee
|
background-color: #eee
|
||||||
border: 3px solid #aaa
|
border: 3px solid #aaa
|
||||||
border-top-width: 0
|
border-top-width: 0
|
||||||
padding: 0.75em
|
padding: 0.75em
|
||||||
|
a.view-source
|
||||||
|
float: right
|
||||||
|
margin: 1.25em
|
||||||
|
|
@ -21,4 +21,5 @@
|
|||||||
Reference
|
Reference
|
||||||
%li
|
%li
|
||||||
%a{ :href => "http://nanoc.stoneship.org/manual/" }
|
%a{ :href => "http://nanoc.stoneship.org/manual/" }
|
||||||
Tutorial
|
Tutorial
|
||||||
|
#footer= @item[:content_for_footer]
|
1
doc-src/layouts/dialog.haml
Normal file
1
doc-src/layouts/dialog.haml
Normal file
@ -0,0 +1 @@
|
|||||||
|
.ui-dialog{:style => "display: none;", :id => @id, :title => @title}= yield
|
1
doc-src/layouts/dialog.yaml
Normal file
1
doc-src/layouts/dialog.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
--- {}
|
@ -2,6 +2,8 @@
|
|||||||
# before nanoc starts compiling.
|
# before nanoc starts compiling.
|
||||||
|
|
||||||
include Nanoc3::Helpers::LinkTo
|
include Nanoc3::Helpers::LinkTo
|
||||||
|
include Nanoc3::Helpers::Capturing
|
||||||
|
include Nanoc3::Helpers::Rendering
|
||||||
|
|
||||||
def body_class(item)
|
def body_class(item)
|
||||||
(item[:classnames] || []).join(" ")
|
(item[:classnames] || []).join(" ")
|
||||||
|
Loading…
Reference in New Issue
Block a user