From 467bc9ebd7ecb6609f563e9e375beca20537594f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 3 Feb 2010 08:02:27 -0800 Subject: [PATCH 1/4] List all the reference content in the sidebar. --- .../compass/utilities/general/tag_cloud.haml | 2 +- .../compass/utilities/links/hover_link.haml | 4 ++-- .../compass/utilities/links/link_colors.haml | 4 ++-- .../utilities/links/unstyled_link.haml | 4 ++-- .../utilities/lists/horizontal_list.haml | 4 ++-- .../compass/utilities/lists/inline_list.haml | 4 ++-- .../compass/utilities/sprites/sprite_img.haml | 4 ++-- .../tables/alternating_rows_and_columns.haml | 4 ++-- doc-src/content/stylesheets/main.sass | 6 +++--- doc-src/layouts/default.haml | 6 +----- doc-src/layouts/partials/sidebar.haml | 5 +++++ doc-src/lib/default.rb | 19 +++++++++++++++++++ doc-src/lib/stylesheets.rb | 15 +++++++++------ 13 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 doc-src/layouts/partials/sidebar.haml diff --git a/doc-src/content/reference/compass/utilities/general/tag_cloud.haml b/doc-src/content/reference/compass/utilities/general/tag_cloud.haml index 62c39a43..41c3cb11 100644 --- a/doc-src/content/reference/compass/utilities/general/tag_cloud.haml +++ b/doc-src/content/reference/compass/utilities/general/tag_cloud.haml @@ -1,6 +1,6 @@ --- title: Compass Tag_cloud -crumb: Tag_cloud +crumb: Tag Cloud framework: compass stylesheet: compass/utilities/general/_tag_cloud.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/links/hover_link.haml b/doc-src/content/reference/compass/utilities/links/hover_link.haml index 1c79136f..36a3c24b 100644 --- a/doc-src/content/reference/compass/utilities/links/hover_link.haml +++ b/doc-src/content/reference/compass/utilities/links/hover_link.haml @@ -1,6 +1,6 @@ --- -title: Compass Hover_link -crumb: Hover_link +title: Compass Hover Link +crumb: Hover Link framework: compass stylesheet: compass/utilities/links/_hover_link.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/links/link_colors.haml b/doc-src/content/reference/compass/utilities/links/link_colors.haml index 9491a2b4..37a2cb2d 100644 --- a/doc-src/content/reference/compass/utilities/links/link_colors.haml +++ b/doc-src/content/reference/compass/utilities/links/link_colors.haml @@ -1,6 +1,6 @@ --- -title: Compass Link_colors -crumb: Link_colors +title: Compass Link Colors +crumb: Link Colors framework: compass stylesheet: compass/utilities/links/_link_colors.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/links/unstyled_link.haml b/doc-src/content/reference/compass/utilities/links/unstyled_link.haml index a014b13d..408c067d 100644 --- a/doc-src/content/reference/compass/utilities/links/unstyled_link.haml +++ b/doc-src/content/reference/compass/utilities/links/unstyled_link.haml @@ -1,6 +1,6 @@ --- -title: Compass Unstyled_link -crumb: Unstyled_link +title: Compass Unstyled Link +crumb: Unstyled Link framework: compass stylesheet: compass/utilities/links/_unstyled_link.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/lists/horizontal_list.haml b/doc-src/content/reference/compass/utilities/lists/horizontal_list.haml index e444a4bf..633669ec 100644 --- a/doc-src/content/reference/compass/utilities/lists/horizontal_list.haml +++ b/doc-src/content/reference/compass/utilities/lists/horizontal_list.haml @@ -1,6 +1,6 @@ --- -title: Compass Horizontal_list -crumb: Horizontal_list +title: Compass Horizontal List +crumb: Horizontal List framework: compass stylesheet: compass/utilities/lists/_horizontal_list.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/lists/inline_list.haml b/doc-src/content/reference/compass/utilities/lists/inline_list.haml index 9720d586..e3ce84df 100644 --- a/doc-src/content/reference/compass/utilities/lists/inline_list.haml +++ b/doc-src/content/reference/compass/utilities/lists/inline_list.haml @@ -1,6 +1,6 @@ --- -title: Compass Inline_list -crumb: Inline_list +title: Compass Inline List +crumb: Inline List framework: compass stylesheet: compass/utilities/lists/_inline_list.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/sprites/sprite_img.haml b/doc-src/content/reference/compass/utilities/sprites/sprite_img.haml index afd52f9c..81d82f02 100644 --- a/doc-src/content/reference/compass/utilities/sprites/sprite_img.haml +++ b/doc-src/content/reference/compass/utilities/sprites/sprite_img.haml @@ -1,6 +1,6 @@ --- -title: Compass Sprite_img -crumb: Sprite_img +title: Compass Sprite Image +crumb: Sprite Image framework: compass stylesheet: compass/utilities/sprites/_sprite_img.sass classnames: diff --git a/doc-src/content/reference/compass/utilities/tables/alternating_rows_and_columns.haml b/doc-src/content/reference/compass/utilities/tables/alternating_rows_and_columns.haml index c92ef9b0..80827a4a 100644 --- a/doc-src/content/reference/compass/utilities/tables/alternating_rows_and_columns.haml +++ b/doc-src/content/reference/compass/utilities/tables/alternating_rows_and_columns.haml @@ -1,6 +1,6 @@ --- -title: Compass Alternating_rows_and_columns -crumb: Alternating_rows_and_columns +title: Compass Alternating Rows and Columns +crumb: Alternating Rows And Columns framework: compass stylesheet: compass/utilities/tables/_alternating_rows_and_columns.sass classnames: diff --git a/doc-src/content/stylesheets/main.sass b/doc-src/content/stylesheets/main.sass index 5e0b43b2..c49cc085 100644 --- a/doc-src/content/stylesheets/main.sass +++ b/doc-src/content/stylesheets/main.sass @@ -12,11 +12,11 @@ body +container #main - +column(18, true) - +prepend(6) + +column(16, true) + +prepend(8) #sidebar - +column(6) + +column(8) +pull(24, true) body.reference diff --git a/doc-src/layouts/default.haml b/doc-src/layouts/default.haml index acfc32a1..3b29e3e6 100644 --- a/doc-src/layouts/default.haml +++ b/doc-src/layouts/default.haml @@ -14,11 +14,7 @@ #main = yield #sidebar - %h2 - Compass Documentation - %ul - %li= link_to "Blueprint Reference", reference_path(:stylesheet => "_blueprint.sass") - %li= link_to "Compass Reference", reference_path(:stylesheet => "_compass.sass") + = render "partials/sidebar" #footer= @item[:content_for_footer] :javascript $(function(){ diff --git a/doc-src/layouts/partials/sidebar.haml b/doc-src/layouts/partials/sidebar.haml new file mode 100644 index 00000000..cb290885 --- /dev/null +++ b/doc-src/layouts/partials/sidebar.haml @@ -0,0 +1,5 @@ +%h2 + Compass Documentation +%ul + = item_tree(reference_item(:stylesheet => "_blueprint.sass")) + = item_tree(reference_item(:stylesheet => "_compass.sass")) diff --git a/doc-src/lib/default.rb b/doc-src/lib/default.rb index 9bb9198f..56953ade 100644 --- a/doc-src/lib/default.rb +++ b/doc-src/lib/default.rb @@ -46,3 +46,22 @@ end def cycle(*args) yield Recycler.new *args end + +def default_path(item) + item.reps.find{|r| r.name == :default}.path +end + +def item_tree(item) + crumb = item[:crumb] || item[:title] + child_html = "" + if item.children.any? + child_html << "
    " + item.children.each do |child| + child_html << item_tree(child) + end + child_html << "
" + end + %Q{
  • #{crumb}#{child_html}
  • } +end + + diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 4e48f3f2..a36754e1 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -28,18 +28,21 @@ def imports(item) imports end -def reference_path(options) +def reference_item(options) stylesheet = options[:stylesheet] path = stylesheet_path(stylesheet) if path - item = @items.detect do |i| + @items.detect do |i| i[:stylesheet] == path && i.identifier =~ /^\/reference/ end - if item - rep = item.reps.find { |r| r.name == :default } - rep.path - end + end +end + +def reference_path(options) + if item = reference_item(options) + rep = item.reps.find { |r| r.name == :default } + rep.path end end From 1df482670fa9d137e01c93d90ae0fb3625b644dc Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 3 Feb 2010 08:15:33 -0800 Subject: [PATCH 2/4] silence a compilation warning --- doc-src/content/examples/compass/css3/columns/stylesheet.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/content/examples/compass/css3/columns/stylesheet.sass b/doc-src/content/examples/compass/css3/columns/stylesheet.sass index eff8f0e6..9fc6b4ee 100644 --- a/doc-src/content/examples/compass/css3/columns/stylesheet.sass +++ b/doc-src/content/examples/compass/css3/columns/stylesheet.sass @@ -12,6 +12,6 @@ #fourColumnWithRule +column-count(4) - +column-rule(1px, solid, red) + +column-rule(1px, "solid", red) :width 300px :margin-bottom 20px From 754533022d4ecda0cfe25df4171059f9b4a3f892 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 3 Feb 2010 08:16:12 -0800 Subject: [PATCH 3/4] Cleanup some more titles. --- doc-src/content/reference/blueprint/fancy_type.haml | 4 ++-- doc-src/content/reference/blueprint/link_icons.haml | 4 ++-- doc-src/content/reference/compass.haml | 4 ++-- doc-src/content/reference/compass/css3/background_clip.haml | 4 ++-- doc-src/content/reference/compass/css3/background_origin.haml | 4 ++-- doc-src/content/reference/compass/css3/background_size.haml | 4 ++-- doc-src/content/reference/compass/css3/border_radius.haml | 4 ++-- doc-src/content/reference/compass/css3/box_shadow.haml | 4 ++-- doc-src/content/reference/compass/css3/box_sizing.haml | 4 ++-- doc-src/content/reference/compass/css3/font_face.haml | 4 ++-- doc-src/content/reference/compass/css3/inline_block.haml | 4 ++-- doc-src/content/reference/compass/css3/text_shadow.haml | 4 ++-- doc-src/content/reference/compass/layout/sticky_footer.haml | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/doc-src/content/reference/blueprint/fancy_type.haml b/doc-src/content/reference/blueprint/fancy_type.haml index ab71dbe0..a48241ed 100644 --- a/doc-src/content/reference/blueprint/fancy_type.haml +++ b/doc-src/content/reference/blueprint/fancy_type.haml @@ -1,6 +1,6 @@ --- -title: Blueprint Fancy_type -crumb: Fancy_type +title: Blueprint Fancy Type +crumb: Fancy Type framework: blueprint stylesheet: blueprint/_fancy_type.sass classnames: diff --git a/doc-src/content/reference/blueprint/link_icons.haml b/doc-src/content/reference/blueprint/link_icons.haml index 155a4ab6..8ea26af6 100644 --- a/doc-src/content/reference/blueprint/link_icons.haml +++ b/doc-src/content/reference/blueprint/link_icons.haml @@ -1,6 +1,6 @@ --- -title: Blueprint Link_icons -crumb: Link_icons +title: Blueprint Link Icons +crumb: Link Icons framework: blueprint stylesheet: blueprint/_link_icons.sass classnames: diff --git a/doc-src/content/reference/compass.haml b/doc-src/content/reference/compass.haml index 1b7ccba1..97e51a52 100644 --- a/doc-src/content/reference/compass.haml +++ b/doc-src/content/reference/compass.haml @@ -1,6 +1,6 @@ --- -title: Compass Compass -crumb: Compass +title: Compass Core Framework +crumb: Compass Core framework: compass stylesheet: _compass.sass classnames: diff --git a/doc-src/content/reference/compass/css3/background_clip.haml b/doc-src/content/reference/compass/css3/background_clip.haml index 86e8096c..03367e81 100644 --- a/doc-src/content/reference/compass/css3/background_clip.haml +++ b/doc-src/content/reference/compass/css3/background_clip.haml @@ -1,6 +1,6 @@ --- -title: Compass Background_clip -crumb: Background_clip +title: Compass Background Clip +crumb: Background Clip framework: compass stylesheet: compass/css3/_background_clip.sass classnames: diff --git a/doc-src/content/reference/compass/css3/background_origin.haml b/doc-src/content/reference/compass/css3/background_origin.haml index 79a898b9..c7683ac8 100644 --- a/doc-src/content/reference/compass/css3/background_origin.haml +++ b/doc-src/content/reference/compass/css3/background_origin.haml @@ -1,6 +1,6 @@ --- -title: Compass Background_origin -crumb: Background_origin +title: Compass Background Origin +crumb: Background Origin framework: compass stylesheet: compass/css3/_background_origin.sass classnames: diff --git a/doc-src/content/reference/compass/css3/background_size.haml b/doc-src/content/reference/compass/css3/background_size.haml index e6a3ea57..141b93a6 100644 --- a/doc-src/content/reference/compass/css3/background_size.haml +++ b/doc-src/content/reference/compass/css3/background_size.haml @@ -1,6 +1,6 @@ --- -title: Compass Background_size -crumb: Background_size +title: Compass Background Size +crumb: Background Size framework: compass stylesheet: compass/css3/_background_size.sass classnames: diff --git a/doc-src/content/reference/compass/css3/border_radius.haml b/doc-src/content/reference/compass/css3/border_radius.haml index 2af30688..1ee48caa 100644 --- a/doc-src/content/reference/compass/css3/border_radius.haml +++ b/doc-src/content/reference/compass/css3/border_radius.haml @@ -1,6 +1,6 @@ --- -title: Compass Border_radius -crumb: Border_radius +title: Compass Border Radius +crumb: Border Radius framework: compass stylesheet: compass/css3/_border_radius.sass classnames: diff --git a/doc-src/content/reference/compass/css3/box_shadow.haml b/doc-src/content/reference/compass/css3/box_shadow.haml index cd8b4bfd..dd2b1d62 100644 --- a/doc-src/content/reference/compass/css3/box_shadow.haml +++ b/doc-src/content/reference/compass/css3/box_shadow.haml @@ -1,6 +1,6 @@ --- -title: Compass Box_shadow -crumb: Box_shadow +title: Compass Box Shadow +crumb: Box Shadow framework: compass stylesheet: compass/css3/_box_shadow.sass classnames: diff --git a/doc-src/content/reference/compass/css3/box_sizing.haml b/doc-src/content/reference/compass/css3/box_sizing.haml index ee61f0d4..14be6f6d 100644 --- a/doc-src/content/reference/compass/css3/box_sizing.haml +++ b/doc-src/content/reference/compass/css3/box_sizing.haml @@ -1,6 +1,6 @@ --- -title: Compass Box_sizing -crumb: Box_sizing +title: Compass Box Sizing +crumb: Box Sizing framework: compass stylesheet: compass/css3/_box_sizing.sass classnames: diff --git a/doc-src/content/reference/compass/css3/font_face.haml b/doc-src/content/reference/compass/css3/font_face.haml index 68428736..9f8fcf51 100644 --- a/doc-src/content/reference/compass/css3/font_face.haml +++ b/doc-src/content/reference/compass/css3/font_face.haml @@ -1,6 +1,6 @@ --- -title: Compass Font_face -crumb: Font_face +title: Compass Font Face +crumb: Font Face framework: compass stylesheet: compass/css3/_font_face.sass classnames: diff --git a/doc-src/content/reference/compass/css3/inline_block.haml b/doc-src/content/reference/compass/css3/inline_block.haml index 02d16aee..85c02757 100644 --- a/doc-src/content/reference/compass/css3/inline_block.haml +++ b/doc-src/content/reference/compass/css3/inline_block.haml @@ -1,6 +1,6 @@ --- -title: Compass Inline_block -crumb: Inline_block +title: Compass Inline Block +crumb: Inline Block framework: compass stylesheet: compass/css3/_inline_block.sass classnames: diff --git a/doc-src/content/reference/compass/css3/text_shadow.haml b/doc-src/content/reference/compass/css3/text_shadow.haml index 2e966dce..acc50255 100644 --- a/doc-src/content/reference/compass/css3/text_shadow.haml +++ b/doc-src/content/reference/compass/css3/text_shadow.haml @@ -1,6 +1,6 @@ --- -title: Compass Text_shadow -crumb: Text_shadow +title: Compass Text Shadow +crumb: Text Shadow framework: compass stylesheet: compass/css3/_text_shadow.sass classnames: diff --git a/doc-src/content/reference/compass/layout/sticky_footer.haml b/doc-src/content/reference/compass/layout/sticky_footer.haml index fb8f9e82..f72b589f 100644 --- a/doc-src/content/reference/compass/layout/sticky_footer.haml +++ b/doc-src/content/reference/compass/layout/sticky_footer.haml @@ -1,6 +1,6 @@ --- -title: Compass Sticky_footer -crumb: Sticky_footer +title: Compass Sticky Footer +crumb: Sticky Footer framework: compass stylesheet: compass/layout/_sticky_footer.sass classnames: From 575d1cfb0ff08c6ef2095ee4bc61abb930213a63 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 3 Feb 2010 08:21:30 -0800 Subject: [PATCH 4/4] cleanup some display of mixin definitions. --- doc-src/lib/stylesheets/sass_extensions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/lib/stylesheets/sass_extensions.rb b/doc-src/lib/stylesheets/sass_extensions.rb index b97e26d4..907155b7 100644 --- a/doc-src/lib/stylesheets/sass_extensions.rb +++ b/doc-src/lib/stylesheets/sass_extensions.rb @@ -141,7 +141,7 @@ module Sass sass_str = "#{name.inspect}" if default_value sass_str << " = " - sass_str << default_value.inspect + sass_str << default_value.to_sass end sass_str end