diff --git a/doc-src/content/reference/blueprint.haml b/doc-src/content/reference/blueprint.haml index 555128be..c8e7815e 100644 --- a/doc-src/content/reference/blueprint.haml +++ b/doc-src/content/reference/blueprint.haml @@ -15,6 +15,16 @@ %h2 Mixins - 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) + - 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}); + }); \ No newline at end of file diff --git a/doc-src/content/stylesheets/main.sass b/doc-src/content/stylesheets/main.sass index cece3643..77e1d0ae 100644 --- a/doc-src/content/stylesheets/main.sass +++ b/doc-src/content/stylesheets/main.sass @@ -1,4 +1,5 @@ @import blueprint/reset +@import compass/utilities @import blueprint @@ -23,9 +24,15 @@ body.reference border: 3px solid #aaa padding: 0.75em margin-bottom: 0 + a.permalink + +hover-link + +link-colors("inherit", "inherit") .source-documentation background-color: #eee border: 3px solid #aaa border-top-width: 0 padding: 0.75em + a.view-source + float: right + margin: 1.25em \ No newline at end of file diff --git a/doc-src/layouts/default.haml b/doc-src/layouts/default.haml index e717763e..c8ffed84 100644 --- a/doc-src/layouts/default.haml +++ b/doc-src/layouts/default.haml @@ -21,4 +21,5 @@ Reference %li %a{ :href => "http://nanoc.stoneship.org/manual/" } - Tutorial \ No newline at end of file + Tutorial + #footer= @item[:content_for_footer] \ No newline at end of file diff --git a/doc-src/layouts/dialog.haml b/doc-src/layouts/dialog.haml new file mode 100644 index 00000000..fdb2f8b1 --- /dev/null +++ b/doc-src/layouts/dialog.haml @@ -0,0 +1 @@ +.ui-dialog{:style => "display: none;", :id => @id, :title => @title}= yield diff --git a/doc-src/layouts/dialog.yaml b/doc-src/layouts/dialog.yaml new file mode 100644 index 00000000..2fbf0ffd --- /dev/null +++ b/doc-src/layouts/dialog.yaml @@ -0,0 +1 @@ +--- {} diff --git a/doc-src/lib/default.rb b/doc-src/lib/default.rb index 53f41de1..f57ca67c 100644 --- a/doc-src/lib/default.rb +++ b/doc-src/lib/default.rb @@ -2,6 +2,8 @@ # before nanoc starts compiling. include Nanoc3::Helpers::LinkTo +include Nanoc3::Helpers::Capturing +include Nanoc3::Helpers::Rendering def body_class(item) (item[:classnames] || []).join(" ")