Skip to content
Browse files

Colums same height script && styling documentation/why && other styles

  • Loading branch information...
1 parent 45a3013 commit 2e409b8ae5e03c4b620024fb999f93a6ce6a2eb3 @AllanD AllanD committed
View
10 content/_standard-head.txt
@@ -4,8 +4,16 @@ filter: erb
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="/javascripts/jquery-1.5.2.js"></script>
-<link rel="stylesheet" href="/stylesheets/main.css" type="text/css" media="screen" />
+<script type="text/javascript" src="/javascripts/scripts.js"></script>
+<script>
+$(document).ready(function() {
+ console.log('test1');
+ $(".equalHeights1").equalHeights(200,600);
+ $(".equalHeights2").equalHeights(200,600);
+});
+</script>
+<link rel="stylesheet" href="/stylesheets/main.css" type="text/css" media="screen" />
<!-- Syntax Highlighter -->
View
45 content/documentation.txt
@@ -6,19 +6,25 @@ filter:
- erb
- textile
---
-h1(title). <%= h(@page.title) %>
+h2(headerText lobsterFont). <%= h(@page.title) %>
-Welcome to MacRuby's documentation center. Here you will find the information you need to get up and running and building OS X applications with MacRuby in no time. If you have not read the "Introductory Tutorial":/documentation/tutorial.html, its a great way to get started.
+<p>
+ Welcome to MacRuby's documentation center. Here you will find the information you need to get up and running and building OS X applications with MacRuby in no time. If you have not read the "Introductory Tutorial":/documentation/tutorial.html, its a great way to get started.
+</p>
+<p>
+ If you are wondering why in the world MacRuby exists you can read that in the "Why MacRuby?":/documentation/why-macruby.html page. If you want documentation on HotCocoa you can "find it here":/hotcocoa.html. You can catch up on the latest news by following the "MacRuby Blog":/blog.
+</p>
+<p>
+ Below are a list of tutorials and recipes for MacRuby. Tutorials are the longest content and delve deep on a particular area. Recipes are short and specific examples of how to accomplish something with MacRuby.
+</p>
+<p>
+ In addition to the documentation available here, MacRuby team member, "Matt Aimonetti":http://merbist.com keeps a HTML version of the manuscript of his "O'Reilly book":http://ofps.oreilly.com/titles/9781449380373/ online and available for free at "this url":http://ofps.oreilly.com/titles/9781449380373/.
+</p>
-If you are wondering why in the world MacRuby exists you can read that in the "Why MacRuby?":/documentation/why-macruby.html page. If you want documentation on HotCocoa you can "find it here":/hotcocoa.html. You can catch up on the latest news by following the "MacRuby Blog":/blog.
+h3(headerText lobsterFont). Screencasts
-Below are a list of tutorials and recipes for MacRuby. Tutorials are the longest content and delve deep on a particular area. Recipes are short and specific examples of how to accomplish something with MacRuby.
-
-In addition to the documentation available here, MacRuby team member, "Matt Aimonetti":http://merbist.com keeps a HTML version of the manuscript of his "O'Reilly book":http://ofps.oreilly.com/titles/9781449380373/ online and available for free at "this url":http://ofps.oreilly.com/titles/9781449380373/.
-
-h2. Screencasts
-
-<ul class="screencast_list">
+<section class="block">
+<ul class="alternatingRows">
<% macruby_screencasts.each do |screencast| -%>
<li>
<span class="date"><%= screencast.date %></span>
@@ -27,10 +33,12 @@ h2. Screencasts
</li>
<% end -%>
</ul>
+</section>
-h2. Tutorials
+h3(headerText lobsterFont). Tutorials
-<ul class="tutorial_list">
+<section class="block">
+<ul class="alternatingRows">
<%
tutorials = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
:sort_by => "updated_at", :reverse => true, :tutorial => true)
@@ -40,10 +48,12 @@ h2. Tutorials
<li><span class="date"><%= page.updated_at.strftime('%Y-%m-%d') %></span><span class="name"><%= link_to_page(page) %></span><%= new_or_updated_indicator(page) %><span class="author">By <%= member_name(page.author) %></span>
<% end -%>
</ul>
+</section>
-h2. Recipes
+h3(headerText lobsterFont). Recipes
-<ul class="recipe_list">
+<section class="block">
+<ul class="alternatingRows">
<%
recipes = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
:sort_by => "created_at", :reverse => true, :recipe => true)
@@ -58,10 +68,12 @@ h2. Recipes
<% end -%>
<% end -%>
</ul>
+</section>
-h2. Talks
+h3(headerText lobsterFont). Talks
-<ul class="screencast_list">
+<section class="block">
+<ul class="alternatingRows">
<% macruby_talks.each do |talk| -%>
<li>
<span class="date"><%= talk.date %></span>
@@ -70,4 +82,5 @@ h2. Talks
</li>
<% end -%>
</ul>
+</section>
View
104 content/documentation/why-macruby.txt
@@ -5,41 +5,69 @@ filter:
- erb
- textile
---
-h1(title). <%= h(@page.title) %>
-
-"Mac OS X":http://en.wikipedia.org/wiki/Mac_OS_X 10.5 (Leopard) provides a build of "MRI":http://en.wikipedia.org/wiki/Ruby_MRI (Matz's Ruby Interpreter), version 1.8.6. This is the current de facto standard for Ruby interpreters; it is stable, well documented, tested, and understood, etc. If you need to run a legacy Ruby script, with a minimum of hassle, the default ruby(1) command is probably the right choice. Similarly, if you have a legacy "RubyCocoa":http://en.wikipedia.org/wiki/RubyCocoa application which you simply wish to run, RubyCocoa is certainly the right choice.
-
-However, if you have needs that aren't well met by these offerings, MacRuby is certainly worthy of your consideration. MacRuby began as an attempt to work around many problems inherent in RubyCocoa. In the course of solving these problems, MacRuby has also solved numerous problems in "Ruby":http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 1.8. Consequently, there are a number of reasons (e.g., convenience, efficiency, flexibility, performance) why one might wish to use MacRuby for new (and ongoing) Ruby applications:
-
-h3. Interpreter Performance
-
-MacRuby is based on Ruby 1.9, so it is powered by the "YARV":http://en.wikipedia.org/wiki/YARV bytecode interpreter. This greatly reduces the execution time of Ruby programs.
-
-h3. Thread Support
-
-The Ruby 1.8 threading model uses green (emulated) threads. Calling Cocoa from a Ruby thread might cause unexpected problems, because in many places in Cocoa uses per-native-thread data. In Leopard, both Ruby and RubyCocoa were modified to appropriately save and restore autorelease pools and exception handlers, which are the most important per-thread data in Cocoa. While this works in most cases, it is clearly a non-optimal solution.
-
-Because the Ruby 1.8 runtime is not thread safe, it is impossible to call back to it from a different POSIX thread. RubyCocoa was modified to route calls from other threads to the main one, but this approach doesn't scale very well and can even cause deadlocks. The threading model in Ruby 1.9 has been significantly improved, allowing multiple threads to call back to the runtime. Also, Ruby threads in 1.9 are now native "POSIX threads":http://en.wikipedia.org/wiki/POSIX_threads.
-
-h3. Garbage Collection
-
-The Ruby "garbage collector":http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29 performs slow collections while stopping the program flow; it also integrates poorly with the Objective-C garbage collector. MacRuby doesn't use the traditional Ruby garbage collector. Instead, it uses the Objective-C garbage collector, which is new in Leopard. The new Objective-C garbage collector engine, due to its generational nature, performs fast collections. It also doesn't stop the world while collecting memory, because collections are done in a separate thread.
-
-h3. Mac OS X Framework Access
-
-Traditional Ruby provides no built-in way to access Mac OS X Frameworks. RubyCocoa provides this access, but at a large cost in convenience and efficiency:
-
-The class and object model has to be maintained on both sides, creating intermediate proxy objects when necessary. This is both painful and error prone.
-Objects and exceptions must be converted from one type to another when they cross the bridge. This has a significant performance impact.
-To avoid multiple proxies for the same instance, instances must be cached (and appropriately invalidated). Some objects cannot be cached, because there is no reliable way to invalidate them.
-In MacRuby, all Ruby classes and objects are actually Objective-C classes and objects. There is no need to create costly proxies, convert objects, and cache instances. A Ruby object can be cast (toll-free) at the C level as an Objective-C object. The Ruby VM can also handle incoming Objective-C objects without conversion.
-
-In MacRuby, the primitive Ruby classes (e.g., String, Array, and Hash) have been re-implemented on top of their Cocoa equivalents (respectively, NSString, NSArray, and NSDictionary). As an example, all strings in MacRuby are Cocoa strings, so they can be passed directly to underlying C or Objective-C APIs. It is also possible to call any method of the String interface on any Cocoa string, subclass Objective-C methods, etc.
-
-The Objective-C calling syntax doesn't translate well to idiomatic Ruby when used from RubyCocoa. As an example, the setObject:forKey: selector is transformed to setObject_forKey_, replacing colons with underscores. MacRuby enhances the existing Ruby syntax to allow keyed arguments, as used in Objective-C. As an example, you call dict.setObject(o, forKey:k). The new syntax can be used to send messages and to define new Objective-C methods.
-
-Together, these improvements provide convenient, efficient access to a broad range of Mac OS X facilities, including Core "Audio":http://en.wikipedia.org/wiki/Core_Audio, "Data":http://en.wikipedia.org/wiki/Core_Data, "Foundation":http://en.wikipedia.org/wiki/Core_Foundation, "Image":http://en.wikipedia.org/wiki/Core_Image, "Text":http://en.wikipedia.org/wiki/Core_Text, etc.
-
-h3. Experimentation
-
-MacRuby provides a convenient way to experiment with Ruby 1.9 on Mac OS X (e.g., trying out new syntax). At the same time, MacRuby provides a convenient way to experiment with the Mac OS X frameworks. For example, macirb allows interactive access to both Ruby and Mac OS X libraries. So, for example, a Cocoa programmer might find MacRuby to be a congenial prototyping environment, even if the ultimate product needs to be written strictly in Objective-C.
+h2(headerText lobsterFont). <%= h(@page.title) %>
+
+ <p>
+ "Mac OS X":http://en.wikipedia.org/wiki/Mac_OS_X 10.5 (Leopard) provides a build of "MRI":http://en.wikipedia.org/wiki/Ruby_MRI (Matz's Ruby Interpreter), version 1.8.6. This is the current de facto standard for Ruby interpreters; it is stable, well documented, tested, and understood, etc. If you need to run a legacy Ruby script, with a minimum of hassle, the default ruby(1) command is probably the right choice. Similarly, if you have a legacy "RubyCocoa":http://en.wikipedia.org/wiki/RubyCocoa application which you simply wish to run, RubyCocoa is certainly the right choice.
+ </p>
+ <p>
+ However, if you have needs that aren't well met by these offerings, MacRuby is certainly worthy of your consideration. MacRuby began as an attempt to work around many problems inherent in RubyCocoa. In the course of solving these problems, MacRuby has also solved numerous problems in "Ruby":http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 1.8. Consequently, there are a number of reasons (e.g., convenience, efficiency, flexibility, performance) why one might wish to use MacRuby for new (and ongoing) Ruby applications:
+ </p>
+
+h3(headerText lobsterFont). Interpreter Performance
+
+<section class="block">
+ <p>
+ MacRuby is based on Ruby 1.9, so it is powered by the "YARV":http://en.wikipedia.org/wiki/YARV bytecode interpreter. This greatly reduces the execution time of Ruby programs.
+ </p>
+</section>
+
+h3(headerText lobsterFont). Thread Support
+
+<section class="block">
+ <p>
+ The Ruby 1.8 threading model uses green (emulated) threads. Calling Cocoa from a Ruby thread might cause unexpected problems, because in many places in Cocoa uses per-native-thread data. In Leopard, both Ruby and RubyCocoa were modified to appropriately save and restore autorelease pools and exception handlers, which are the most important per-thread data in Cocoa. While this works in most cases, it is clearly a non-optimal solution.
+ </p>
+ <p>
+ Because the Ruby 1.8 runtime is not thread safe, it is impossible to call back to it from a different POSIX thread. RubyCocoa was modified to route calls from other threads to the main one, but this approach doesn't scale very well and can even cause deadlocks. The threading model in Ruby 1.9 has been significantly improved, allowing multiple threads to call back to the runtime. Also, Ruby threads in 1.9 are now native "POSIX threads":http://en.wikipedia.org/wiki/POSIX_threads.
+ </p>
+</section>
+
+h3(headerText lobsterFont). Garbage Collection
+
+<section class="block">
+ <p>
+ The Ruby "garbage collector":http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29 performs slow collections while stopping the program flow; it also integrates poorly with the Objective-C garbage collector. MacRuby doesn't use the traditional Ruby garbage collector. Instead, it uses the Objective-C garbage collector, which is new in Leopard. The new Objective-C garbage collector engine, due to its generational nature, performs fast collections. It also doesn't stop the world while collecting memory, because collections are done in a separate thread.
+ </p>
+</section>
+
+h3(headerText lobsterFont). Mac OS X Framework Access
+
+<section class="block">
+ <p>
+ Traditional Ruby provides no built-in way to access Mac OS X Frameworks. RubyCocoa provides this access, but at a large cost in convenience and efficiency:
+ </p>
+ <p>
+ The class and object model has to be maintained on both sides, creating intermediate proxy objects when necessary. This is both painful and error prone.
+ Objects and exceptions must be converted from one type to another when they cross the bridge. This has a significant performance impact.
+ To avoid multiple proxies for the same instance, instances must be cached (and appropriately invalidated). Some objects cannot be cached, because there is no reliable way to invalidate them.
+ In MacRuby, all Ruby classes and objects are actually Objective-C classes and objects. There is no need to create costly proxies, convert objects, and cache instances. A Ruby object can be cast (toll-free) at the C level as an Objective-C object. The Ruby VM can also handle incoming Objective-C objects without conversion.
+ </p>
+ <p>
+ In MacRuby, the primitive Ruby classes (e.g., String, Array, and Hash) have been re-implemented on top of their Cocoa equivalents (respectively, NSString, NSArray, and NSDictionary). As an example, all strings in MacRuby are Cocoa strings, so they can be passed directly to underlying C or Objective-C APIs. It is also possible to call any method of the String interface on any Cocoa string, subclass Objective-C methods, etc.
+ </p>
+ <p>
+ The Objective-C calling syntax doesn't translate well to idiomatic Ruby when used from RubyCocoa. As an example, the setObject:forKey: selector is transformed to setObject_forKey_, replacing colons with underscores. MacRuby enhances the existing Ruby syntax to allow keyed arguments, as used in Objective-C. As an example, you call dict.setObject(o, forKey:k). The new syntax can be used to send messages and to define new Objective-C methods.
+ </p>
+ <p>
+ Together, these improvements provide convenient, efficient access to a broad range of Mac OS X facilities, including Core "Audio":http://en.wikipedia.org/wiki/Core_Audio, "Data":http://en.wikipedia.org/wiki/Core_Data, "Foundation":http://en.wikipedia.org/wiki/Core_Foundation, "Image":http://en.wikipedia.org/wiki/Core_Image, "Text":http://en.wikipedia.org/wiki/Core_Text, etc.
+ </p>
+</section>
+
+h3(headerText lobsterFont). Experimentation
+
+<section class="block">
+ <p>
+ MacRuby provides a convenient way to experiment with Ruby 1.9 on Mac OS X (e.g., trying out new syntax). At the same time, MacRuby provides a convenient way to experiment with the Mac OS X frameworks. For example, macirb allows interactive access to both Ruby and Mac OS X libraries. So, for example, a Cocoa programmer might find MacRuby to be a congenial prototyping environment, even if the ultimate product needs to be written strictly in Objective-C.
+ </p>
+</section>
View
20 content/index.txt
@@ -16,21 +16,23 @@ filter:
<aside>
<h2 class="headerText1 lobsterFont"><img class="gridIcon1" src="../images/icon_toolbox.png" alt="#" />Why MacRuby?</h2>
- <div class="gridContent boxed">
+ <div class="gridContent boxed equalHeights1">
+ <div class="padding15">
MacRuby began as an attempt to work around many problems inherent in RubyCocoa. In the course of solving these problems, MacRuby has also solved numerous problems in the original implementation of Ruby. Consequently, there are a number of reasons (e.g. convenience, efficiency, flexibility, performance) why one might wish to use MacRuby for new (and ongoing) Ruby applications... <a href="/documentation/why-macruby.html"><br/><i>Read more...</i></a>
+ </div>
</div>
</aside>
<aside>
<h2 class="headerText1 lobsterFont"><img class="gridIcon2" src="../images/icon_star.png" alt="#" /> Whats Going on</h2>
- <div class="gridContent boxed">
- <div class="abstract">
+ <div class="gridContent boxed equalHeights1">
+ <div class="abstract padding15">
<h3 class="headerText1"><a href="#">News Item 1</a><span class="date">2010-10-08</span></h3>
A new development version of the <a href="http://bridgesupport.macosforge.org/trac/wiki">BridgeSupport</a> project, now based on the clang/<span class="caps">LLVM</span> compiler framework, is available for testing!<br />
<a href='/blog/2010/10/08/bridgesupport-preview.html'>Read more&#8230;</a>
</div>
- <div class="abstract">
+ <div class="abstract padding15">
<h3 class="headerText1"><a href="#">News Item 2</a><span class="date">2010-10-08</span></h3>
A new development version of the <a href="http://bridgesupport.macosforge.org/trac/wiki">BridgeSupport</a> project, now based on the clang/<span class="caps">LLVM</span> compiler framework, is available for testing!<br />
<a href='/blog/2010/10/08/bridgesupport-preview.html'>Read more&#8230;</a>
@@ -43,22 +45,24 @@ filter:
<aside>
<h2 class="headerText1 lobsterFont"><img class="gridIcon3" src="../images/icon_notebook.png" alt="#" />The Definitive Guide</h2>
- <div class="gridContent boxed">
+ <div class="gridContent boxed equalHeights2">
+ <div class="padding15">
Matt Aimonetti is currently working on a MacRuby book for O'Reilly. It is under development and the book is being published as it is being written. The work is released under a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/us/">Creative Commons</a> license, with the idea of getting early feedback from the community.
<br/><a href="http://macruby.labs.oreilly.com/">Check it out!</a>
+ </div>
</div>
</aside>
<aside>
<h2 class="headerText1 lobsterFont"><img class="gridIcon4" src="../images/icon_cloud.png" alt="#" />MacRuby Blogs</h2>
- <div class="gridContent boxed">
- <div class="abstract">
+ <div class="gridContent boxed equalHeights2">
+ <div class="abstract padding15">
<h3 class="headerText1"><a href="#">Blog Item 1</a><span class="date">2010-10-08</span></h3>
A new development version of the <a href="http://bridgesupport.macosforge.org/trac/wiki">BridgeSupport</a> project, now based on the clang/<span class="caps">LLVM</span> compiler framework, is available for testing!<br />
<a href='/blog/2010/10/08/bridgesupport-preview.html'>Read more&#8230;</a>
</div>
- <div class="abstract">
+ <div class="abstract padding15">
<h3 class="headerText1"><a href="#">Blog Item 2</a><span class="date">2010-10-08</span></h3>
A new development version of the <a href="http://bridgesupport.macosforge.org/trac/wiki">BridgeSupport</a> project, now based on the clang/<span class="caps">LLVM</span> compiler framework, is available for testing!<br />
<a href='/blog/2010/10/08/bridgesupport-preview.html'>Read more&#8230;</a>
View
33 content/javascripts/scripts.js
@@ -0,0 +1,33 @@
+/**
+ * Equal Heights Plugin
+ * Equalize the heights of elements. Great for columns or any elements
+ * that need to be the same size (floats, etc).
+ *
+ * Version 1.0
+ * Updated 12/10/2008
+ *
+ * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com)
+ *
+ * Usage: $(object).equalHeights([minHeight], [maxHeight]);
+ *
+ * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
+ * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
+ * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
+ * than 300 pixels tall. Elements with too much content will gain a scrollbar.
+ *
+ */
+
+(function($) {
+ $.fn.equalHeights = function(minHeight, maxHeight) {
+ tallest = (minHeight) ? minHeight : 0;
+ this.each(function() {
+ if($(this).height() > tallest) {
+ tallest = $(this).height();
+ }
+ });
+ if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
+ return this.each(function() {
+ $(this).height(tallest).css("overflow","auto");
+ });
+ }
+})(jQuery);
View
66 content/stylesheets/main.css
@@ -65,6 +65,22 @@ input, select { vertical-align: middle; }
and read this CSS rule. Don't ever use a normal HTML
comment inside the CC or it will close prematurely. */
+.padding15 {
+ padding: 15px;
+}
+ul li {
+ padding: 5px 10px;
+}
+.alternatingRows {
+ list-style-type: none;
+}
+.alternatingRows li {
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.alternatingRows li:nth-child(odd) { background-color:#eee; }
+.alternatingRows li:nth-child(even) { background-color:#fff; }
+
@font-face {
font-family: "Lobster 1.4"; src: url('lobster_1.4.otf');
}
@@ -99,9 +115,34 @@ body {
line-height: 1.5;
background: #e4e4e4 url(../images/new/bg.jpg) top repeat-x;
}
+
+::selection {
+background:#93DC01;
+color:black;
+}
+::-moz-selection {
+background:#93DC01;
+color:black;
+}
+::-webkit-selection {
+background:#93DC01;
+color:black;
+}
+
+p {
+ margin: 1em 0;
+}
+p:first-child {
+ margin-top: 0;
+}
+p:last-child {
+ margin-bottom: 0;
+}
+
a {color: #b71515}
a:hover {color: black}
}
+
ul {
list-style-type: none;
}
@@ -169,19 +210,13 @@ header h1.logo a {
background: url(../images/cross_divider.png) top no-repeat;
}
.grid .date {
+ float: right;
font-size: 80%;
font-style: italic;
}
-.grid .top,
-.grid .bottom {
- height: 330px;
-}
.grid aside {
position: relative;
padding: 30px;
- padding-top: 20px;
- min-height: 200px;
- height: 100%;
width: 420px;
float: left;
}
@@ -197,13 +232,21 @@ header h1.logo a {
z-index: 999;
}
.grid h3 a {
+ font-weight: bold;
text-decoration: none;
}
.grid .headerText .date {
float: right;
}
-.grid .abstract {
- height: 125px;
+.grid .abstract:hover {
+ color: white;
+ background: #971111;
+ -moz-box-shadow:inset 0 0 2px white;
+ -webkit-box-shadow:inset 0 0 2px white;
+ box-shadow:inset 0 0 2px white;
+}
+.grid .abstract:hover a {
+ color: #FBB7B7;
}
.grid .gridIcon1 {top: 24px; left: 23px;}
.grid .gridIcon2 {left: 30px;}
@@ -212,14 +255,11 @@ header h1.logo a {
.grid .gridContent {
overflow: hidden;
- padding: 0 10px;
+ xxxpadding: 0 10px;
}
.grid .boxed {
- height: 250px;
margin-top: -19px;
- xxxposition: relative;
bottom: 0;
- padding: 15px;
border: 1px solid #cecece;
background: white;
-moz-border-radius: 10px;

0 comments on commit 2e409b8

Please sign in to comment.
Something went wrong with that request. Please try again.