Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switch to JS highlighter

  • Loading branch information...
commit 6881316bbfb35898d3605d74d92ba047d9496e38 1 parent 671f04a
Thomas Reynolds authored

Showing 27 changed files with 103 additions and 202 deletions. Show diff stats Hide diff stats

  1. 4  Gemfile
  2. 8  config.rb
  3. 4  helpers/guide_helpers.rb
  4. 2  source/.htaccess
  5. 2  source/advanced/dynamic-pages.html.markdown
  6. 7  source/advanced/file-size-optimization.html.markdown
  7. 2  source/advanced/improving-cacheability.html.markdown
  8. 17  source/{extensions → advanced}/localization.html.markdown
  9. 5  source/advanced/pretty-urls.html.markdown
  10. 2  source/advanced/rack-middleware.html.markdown
  11. 2  source/advanced/speeding-up.html.markdown
  12. 13  source/extensions/blog.html.markdown
  13. 13  source/extensions/custom.html.markdown
  14. 3  source/extensions/livereload.html.markdown
  15. 6  source/extensions/remote-api.html.markdown
  16. 10  source/getting-started/welcome.html.markdown
  17. 1  source/javascripts/highlight.pack.js
  18. 4  source/layouts/layout.erb
  19. 3  source/metadata/local-data.html.markdown
  20. 1  source/metadata/sitemap.html.markdown
  21. 1  source/metadata/yaml-frontmatter.html.markdown
  22. 65  source/stylesheets/_pygments/_solarized.scss
  23. 4  source/stylesheets/site.css.scss
  24. 90  source/stylesheets/solarized_light.scss
  25. 18  source/templates/helpers.html.markdown
  26. 1  source/templates/sass-and-compass.html.markdown
  27. 17  source/templates/templates-layouts-partials.html.markdown
4  Gemfile
@@ -2,6 +2,4 @@ source :rubygems
2 2
 
3 3
 gem "redcarpet"
4 4
 gem "builder"
5  
-gem "middleman", "3.0.0.rc.4"
6  
-gem "rack-codehighlighter", :git => "git://github.com/wbzyl/rack-codehighlighter.git"
7  
-gem "pygments.rb"
  5
+gem "middleman", "3.0.0"
8  config.rb
@@ -5,14 +5,6 @@
5 5
 set :markdown, :tables => true, :autolink => true
6 6
 set :markdown_engine, :redcarpet
7 7
 
8  
-require 'rack/codehighlighter'
9  
-require "pygments"
10  
-use Rack::Codehighlighter, 
11  
-  :pygments,
12  
-  :element => "pre>code",
13  
-  :pattern => /\A:::([-_+\w]+)\s*\n/,
14  
-  :markdown => true
15  
-
16 8
 # Build-specific configuration
17 9
 configure :build do
18 10
   # For example, change the Compass output style for deployment
4  helpers/guide_helpers.rb
@@ -23,8 +23,8 @@ def pages_for_group(group_name)
23 23
     return pages unless group
24 24
     
25 25
     if group.directory
26  
-      pages << sitemap.resources.select { |r| 
27  
-        r.path.include? group.directory
  26
+      pages << sitemap.resources.select { |r|
  27
+        r.path.include?(group.directory) && !r.data.hidden
28 28
       }.map do |r|
29 29
         ::Middleman::Util.recursively_enhance({
30 30
           :title => r.data.title,
2  source/.htaccess
@@ -6,12 +6,12 @@ RewriteRule ^guides/frontend-optimization/?$ /advanced/frontend-optimization [R=
6 6
 RewriteRule ^guides/pretty-urls/?$ /advanced/pretty-urls [R=301,L]
7 7
 RewriteRule ^guides/rack-middleware/?$ /advanced/rack-middleware [R=301,L]
8 8
 RewriteRule ^guides/speeding-up/?$ /advanced/speeding-up [R=301,L]
  9
+RewriteRule ^guides/localization/?$ /advanced/localization [R=301,L]
9 10
 
10 11
 # Extensions
11 12
 RewriteRule ^guides/blog/?$ /extensions/blog [R=301,L]
12 13
 RewriteRule ^guides/extensions/?$ /extensions/custom [R=301,L]
13 14
 RewriteRule ^guides/livereload/?$ /extensions/livereload [R=301,L]
14  
-RewriteRule ^guides/localization/?$ /extensions/localization [R=301,L]
15 15
 RewriteRule ^guides/remote-api/?$ /extensions/remote-api [R=301,L]
16 16
 
17 17
 # Getting Started
2  source/advanced/dynamic-pages.html.markdown
Source Rendered
@@ -6,7 +6,6 @@ title: Dynamic Pages
6 6
 
7 7
 Middleman has the ability to generate pages which do not have a one-to-one relationship with their template files. What this means is that you can have a single template which generates multiple files based on variables. Here's an example `config.rb` setup:
8 8
 
9  
-    :::ruby
10 9
     ["tom", "dick", "harry"].each do |name|
11 10
       page "/about/#{name}.html", :proxy => "/about/template.html" do
12 11
         @person_name = name
@@ -22,7 +21,6 @@ When this project is built, four files will be output:
22 21
 
23 22
 In most cases, you will not want to generate the template itself without the @person_name variable, so you can tell Middleman to ignore it:
24 23
 
25  
-    :::ruby
26 24
     ["tom", "dick", "harry"].each do |name|
27 25
       page "/about/#{name}.html", :proxy => "/about/template.html", :ignore => true do
28 26
         @person_name = name
7  source/advanced/file-size-optimization.html.markdown
Source Rendered
@@ -10,7 +10,6 @@ Middleman handles CSS minification and Javascript compression so you don't have
10 10
 
11 11
 In your `config.rb`, activate the `minify_css` and `minify_javascript` features during the build of your site.
12 12
 
13  
-    :::ruby
14 13
     configure :build do
15 14
       activate :minify_css
16 15
       activate :minify_javascript
@@ -20,7 +19,6 @@ If you are already using a compressed file that includes `.min` in its filename,
20 19
 
21 20
 You can customize how the JavaScript compressor works by setting the `:compressor` option when activating the `:minify_javascript` extension in `config.rb` to a custom instance of Uglifier. See (Uglifier's docs)[https://github.com/lautis/uglifier] for details. For example, you could enable unsafe optimizations and mangle top-level variable names like this:
22 21
 
23  
-    :::ruby
24 22
     set :js_compressor, Uglifier.new(:toplevel => true, :unsafe => true)
25 23
 
26 24
 If you want to exclude any files from being minified, pass the `:ignore` option when activating these extensions, and give it one or more globs, regexes, or procs that identify the files to ignore. Likewise, you can pass an `:exts` option to change which file extensions are renamed.
@@ -29,7 +27,6 @@ If you want to exclude any files from being minified, pass the `:ignore` option
29 27
 
30 28
 It's a good idea to [serve compressed files](http://developer.yahoo.com/performance/rules.html#gzip) to user agents that can handle it. Many web servers have the ability to gzip files on the fly, but that requires CPU work every time the file is served, and as a result most servers don't perform the maximum compression. Middleman can produce gripped versions of your HTML, CSS, and JavaScript alongside your regular files, and you can instruct your web server to serve those pre-gzipped files directly. First, enable the `:gzip` extension:
31 29
 
32  
-    :::ruby
33 30
     activate :gzip
34 31
 
35 32
 Then configure your server to serve those files. If you use Nginx, check out [the gzip_static](http://wiki.nginx.org/NginxHttpGzipStaticModule) module. For Apache, you'll have to do something a little trickier - see [this Gist](https://gist.github.com/2200790) for an example.
@@ -40,17 +37,13 @@ If you also want to compress images on build, you can use the [Middleman Smusher
40 37
 
41 38
 To install:
42 39
 
43  
-    :::bash
44 40
     gem install middleman-smusher
45 41
 
46 42
 Then activate in your `config.rb`:
47 43
 
48  
-    :::ruby
49 44
     configure :build do
50 45
       activate :smusher
51 46
     end
52 47
 
53  
- 
54  
-
55 48
 [Middleman Smusher extension]: https://github.com/middleman/middleman-smusher
56 49
 [Yahoo's Smush.it tool]: http://www.smushit.com/ysmush.it/
2  source/advanced/improving-cacheability.html.markdown
Source Rendered
@@ -10,7 +10,6 @@ To make your website render as quickly as possible, you should serve any assets,
10 10
 
11 11
 The most effective technique for preventing users from using outdated files is to change the asset's filename every time you change one of your assets. Since that would be a pain to do by hand, Middleman comes with an `:asset_hash` extension that does it for you. First, activate the extension in your `config.rb`:
12 12
 
13  
-    :::ruby
14 13
     activate :asset_hash
15 14
     
16 15
 Now, refer to your assets as normal, with their original filename. You can use helpers like `image_tag` as well. However, when your site is built, each asset will be produced with a bit of extra text at the end of the filename that is tied to the content of the file, and all of your other files (HTML, CSS, JavaScript, etc) will be changed to reference that unique-ified filename instead of the original one. Now you can serve your assets with a "never expire" policy, but be sure that when you change them, they'll show up as a different filename.
@@ -23,7 +22,6 @@ If you want to exclude any files from being renamed, pass the `:ignore` option w
23 22
 
24 23
 The second approach is to append a value to the end of URLs that reference your assets. For example, instead of referencing `my_image.png` you'd reference `my_image.png?1234115152`. The extra info at the end of the URL is enough to tell many (but not all) browsers and proxies to cache that file separately from the same file with a different cache buster value. To use this, activate the `:cache_buster` extension in your `config.rb`:
25 24
 
26  
-    :::ruby
27 25
     activate :cache_buster
28 26
     
29 27
 Now, to use cache-safe URLs, you must use [asset path helpers](http://www.padrinorb.com/api/Padrino/Helpers/AssetTagHelpers.html) like `image_path` or `javascript_include_tag`. Make sure to use [Compass helpers](http://compass-style.org/reference/compass/helpers/urls/) in your SASS too (`image-url`, etc.). For JavaScript, you'll need to make ERb templates like `my script.js.erb` and call asset helpers via ERb tags to output the right values. If you forget one, your users will still get the file (since the copy on the server just has a normal name) but they might not see changes.
17  source/extensions/localization.html.markdown → source/advanced/localization.html.markdown
Source Rendered
@@ -4,35 +4,26 @@ title: Localization (i18n)
4 4
 
5 5
 # Localization (i18n)
6 6
 
7  
-Middleman 2.1 ships with an official extension to support basic localization which allows you to build pages for multiple languages with a single set of templates. Simply install the gem:
  7
+The extension provides an api for enabling localization in your `config.rb`:
8 8
 
9  
-    :::bash
10  
-    gem install middleman-i18n
11  
-
12  
-The extension provides a new api for enabling localization in your `config.rb`:
13  
-
14  
-    :::ruby
15 9
     activate :i18n
16 10
 
17 11
 By default this will search the `locales` folder in the root of your project for YAML files representing each locale you want to support. The YAML file is a set of keys and values for each string you need to localize in your site. The keys, which is how you will refer to these strings in your templates, must be the same in each locale, but the values will change. Here are two example YAML files.
18 12
 
19 13
 `locales/en.yml`:
20 14
 
21  
-    :::yaml
22 15
     ---
23 16
     en:
24 17
       hello: "Hello"
25 18
 
26 19
 `locales/es.yml`:
27 20
 
28  
-    :::yaml
29 21
     ---
30 22
     es:
31 23
       hello: "Hola"
32 24
 
33 25
 Localizable templates live in the `source/localizable` folder by default (see below on how to change this option). Each template in that folder will have access to the `I18n` helper. Using this helper, you can refer to keys from your YAML files and inject the language-specific values into your template. Here's a simple `source/localizable/hello_world.html.erb` template:
34 26
 
35  
-    :::erb
36 27
     <%= I18n.t(:hello) %> World
37 28
 
38 29
 This would output two files:
@@ -50,7 +41,6 @@ Each individual language is accessible in its own namespaced path. By default, t
50 41
 
51 42
 You can change this with the `:path` option, but remember: the URL will always include the name of the YAML file:
52 43
 
53  
-    :::ruby
54 44
     activate :i18n, :path => "/langs/:locale/"
55 45
 
56 46
 Now the paths would be:
@@ -61,7 +51,6 @@ Now the paths would be:
61 51
 
62 52
 If you are unhappy using the YAML file names as part of your path, you can remap them to different values.
63 53
 
64  
-    :::ruby
65 54
     activate :i18n, :path => "/langs/:locale/", 
66 55
       :lang_map => { :en => :english, :es => :spanish, :fr => :french }
67 56
 
@@ -82,7 +71,6 @@ Let's say we have a file `source/localizable/hello.html.erb`. By default, this w
82 71
 
83 72
 If we want to rename that file to `hola.html` for Spanish only, we can use the `paths` key in `locales/es.yml`:
84 73
 
85  
-    :::yaml
86 74
     ---
87 75
     es:
88 76
       hello: "Hola"
@@ -98,7 +86,6 @@ Now, the files would be output as:
98 86
 
99 87
 By default, the contents of `source/localizable` will be built in multiple languages while the rest of your templates will continue to work normally. The name of this folder can be changed with the `:templates_dir` option:
100 88
 
101  
-    :::ruby
102 89
     # Look in `source/language_specific` instead
103 90
     activate :i18n, :templates_dir => "language_specific"
104 91
 
@@ -106,7 +93,6 @@ By default, the contents of `source/localizable` will be built in multiple langu
106 93
 
107 94
 If you'd prefer specify a list of supported languages rather than automatically discovering files in `locales/`, you can use the `:langs` option:
108 95
 
109  
-    :::ruby
110 96
     activate :i18n, :langs => [:en] # Ignore all languages except :en
111 97
 
112 98
 ## Default (Root) Language
@@ -119,7 +105,6 @@ By default, the first language (either specified by `:langs` or discovered in yo
119 105
 
120 106
 You can change the default or disable mounting a specific language at the root entirely using the `:mount_at_root` option:
121 107
 
122  
-    :::ruby
123 108
     activate :i18n, :mount_at_root => :es # Mount spanish at root instead
124 109
     # or
125 110
     activate :i18n, :mount_at_root => false # All languages will be prefixed
5  source/advanced/pretty-urls.html.markdown
Source Rendered
@@ -14,7 +14,6 @@ This makes sense for a static website, but many find the .html distasteful and w
14 14
 
15 15
 If you are using a Rack-based web-server, you can use the `Rack::TryStatic` middleware found in the [rack-contrib] project. In your `config.ru` (or Rails Rack configuration), add the following:
16 16
 
17  
-    :::ruby
18 17
     require "rack/contrib/try_static"
19 18
     use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html']
20 19
 
@@ -28,7 +27,6 @@ However, serving your site via Rack somewhat defeats the purpose of generating a
28 27
 
29 28
 If you are not using a Rack-based web-server, you can use the Directory Indexes feature to tell Middleman to create a folder for each `.html` file and place the built template file as the index of that folder. In your `config.rb`:
30 29
 
31  
-    :::ruby
32 30
     activate :directory_indexes
33 31
 
34 32
 Now when the above project is built, the `about-us.html.erb` file will be output as `about-us/index.html`. When placed in an Apache compatible web-server, the page would be available at:
@@ -37,19 +35,16 @@ Now when the above project is built, the `about-us.html.erb` file will be output
37 35
     
38 36
 If you prefer a different file be output, you can use the `index_file` variable. For example, IIS uses default.html:
39 37
 
40  
-    :::ruby
41 38
     set :index_file, "default.html"
42 39
 
43 40
 Or, you may want a PHP file:
44 41
 
45  
-    :::ruby
46 42
     set :index_file, "index.php"
47 43
 
48 44
 ### Opt-out
49 45
 
50 46
 If there are pages which you don't want automatically renamed, you can opt-out:
51 47
 
52  
-    :::ruby
53 48
     page "/i-really-want-the-extension.html", :directory_index => false
54 49
 
55 50
 `page` works with regexes or file globs if you want to turn off indexes for many files at once.
2  source/advanced/rack-middleware.html.markdown
Source Rendered
@@ -12,7 +12,6 @@ Middleman has full access to Rack Middleware which opens up an expansive univers
12 12
 
13 13
 This site is written in Middleman and features many code blocks which have syntax highlighting. This syntax highlighting is accomplished outside the scope of Middleman. This site renders `<code>` blocks and then Rack Middleware takes over an enhances those blocks with syntax highlight. The middleware in use is called [`Rack::Codehighlighter`](https://github.com/wbzyl/rack-codehighlighter). Here's how it can be used in your `config.rb`:
14 14
   
15  
-    :::ruby
16 15
     require 'rack/codehighlighter'
17 16
     require "pygments"
18 17
     use Rack::Codehighlighter, 
@@ -23,7 +22,6 @@ This site is written in Middleman and features many code blocks which have synta
23 22
 
24 23
 Make sure you add the right dependencies to your `Gemfile` to make those work:
25 24
   
26  
-    :::ruby
27 25
     gem "rack-codehighlighter", :git => "git://github.com/wbzyl/rack-codehighlighter.git"
28 26
     gem "pygments.rb"
29 27
 
2  source/advanced/speeding-up.html.markdown
Source Rendered
@@ -14,7 +14,6 @@ The latest version of Ruby, version 1.9.3, is much faster than its predecessor.
14 14
 
15 15
 Use `therubyracer` which uses the Google Chrome engine to compile Javascript. Using a faster JSON parser can also speed up Javascript minification. In your Gemfile:
16 16
 
17  
-    :::ruby
18 17
     gem 'therubyracer' # faster ExecJS
19 18
     gem 'oj'           # faster JSON
20 19
     # gem 'yajl-ruby'  # if 'oj' doesn't work for you
@@ -25,7 +24,6 @@ Don't forget to run `bundle install`!
25 24
 
26 25
 Middleman includes `maruku` for rendering Markdown by default, but you can use the `redcarpet` gem for a speed boost (and some nice features):
27 26
 
28  
-    :::ruby
29 27
     # in Gemfile
30 28
     gem 'redcarpet' # faster ExecJS
31 29
     
13  source/extensions/blog.html.markdown
Source Rendered
@@ -6,24 +6,20 @@ title: Blogging Extension
6 6
 
7 7
 Middleman has an official extension to support blogging, articles and tagging. `middleman-blog` ships as an extension and must be installed to use. Simply specify the gem in your `Gemfile`:
8 8
 
9  
-    :::ruby
10 9
     gem "middleman-blog"
11 10
     
12 11
 Or install it by hand if you're not using Bundler:
13 12
     
14  
-    :::bash
15 13
     gem install middleman-blog
16 14
 
17 15
 Then activate the extension in your `config.rb`:
18 16
 
19  
-    :::ruby
20 17
     activate :blog do |blog|
21 18
       # set options on blog
22 19
     end
23 20
     
24 21
 Alternatively, you can generate a fresh project already setup for blogging:
25 22
 
26  
-    :::bash
27 23
     middleman init MY_BLOG_PROJECT --template=blog
28 24
 
29 25
 If you already have a Middleman project, you can re-run `middleman init` with the blog template option to generate the sample [`index.html`](https://github.com/middleman/middleman-blog/blob/master/lib/middleman-blog/template/source/index.html.erb), [`tag.html`](https://github.com/middleman/middleman-blog/blob/master/lib/middleman-blog/template/source/tag.html.erb), [`calendar.html`](https://github.com/middleman/middleman-blog/blob/master/lib/middleman-blog/template/source/calendar.html.erb), and [`feed.xml`](https://github.com/middleman/middleman-blog/blob/master/lib/middleman-blog/template/source/feed.xml.builder), or you can write those yourself. You can see [what gets generated](https://github.com/middleman/middleman-blog/tree/master/lib/middleman-blog/template/source) on GitHub.
@@ -48,14 +44,12 @@ As a shortcut, you can run `middleman article TITLE` and Middleman will create a
48 44
 
49 45
 The base path for your blog defaults to `/` (the root of your website) but can be overridden in `config.rb`:
50 46
 
51  
-    :::ruby
52 47
     activate :blog do |blog|
53 48
       # set options on blog
54 49
     end
55 50
 
56 51
 The permalink for viewing your posts can be easily changed as well:
57 52
 
58  
-    :::ruby
59 53
     activate :blog do |blog|
60 54
       blog.permalink = "blog/:year/:title.html"
61 55
     end
@@ -68,7 +62,6 @@ By default, articles can be truncated when viewed outside their permalink page.
68 62
 
69 63
 This can be changed in `config.rb`:
70 64
 
71  
-    :::ruby
72 65
     activate :blog do |blog|
73 66
       blog.summary_separator = /SPLIT_SUMMARY_BEFORE_THIS/
74 67
     end
@@ -93,7 +86,6 @@ Now you can find this article listed on `tags/blogging.html`.
93 86
 
94 87
 This path can be changed in `config.rb`:
95 88
 
96  
-    :::ruby
97 89
     activate :blog do |blog|
98 90
       blog.taglink = "categories/:tag.html"
99 91
     end
@@ -112,7 +104,6 @@ In templates, you can use the [`blog_year_path`](http://rubydoc.info/github/midd
112 104
 
113 105
 You can set a specific [layout](/templates/templates-layouts-partials) to be used for all articles in your `config.rb`:
114 106
   
115  
-    :::ruby
116 107
     activate :blog do |blog|
117 108
       blog.layout = "blog_layout"
118 109
     end
@@ -127,7 +118,6 @@ Each [`BlogArticle`](http://rubydoc.info/github/middleman/middleman-blog/master/
127 118
 
128 119
 For example, the following shows the 5 most-recent articles and their summary:
129 120
 
130  
-    :::erb
131 121
     <% blog.articles[0...5].each do |article| %>
132 122
       <article>
133 123
         <h1>
@@ -143,7 +133,6 @@ For example, the following shows the 5 most-recent articles and their summary:
143 133
 
144 134
 You can also get access to the tag data for a tag archive:
145 135
 
146  
-    :::erb
147 136
     <ul>
148 137
       <% blog.tags.each do |tag, articles| %>
149 138
         <li>
@@ -158,7 +147,6 @@ You can also get access to the tag data for a tag archive:
158 147
     
159 148
 Or similarly for a calendar list:
160 149
     
161  
-    :::erb
162 150
     <ul>
163 151
       <% blog.articles.group_by {|a| a.date.year }.each do |year, articles| %>
164 152
         <li>
@@ -174,7 +162,6 @@ Or similarly for a calendar list:
174 162
 
175 163
 Or if you added a `published` flag to your front matter:
176 164
 
177  
-    :::erb
178 165
     <h1>Published Articles</h1>
179 166
     <% blog.articles.select {|a| a.page.data[:published] }.each do |article| %>
180 167
       ...
13  source/extensions/custom.html.markdown
Source Rendered
@@ -8,7 +8,6 @@ Middleman extensions are Ruby classes which can hook into various points of the
8 8
 
9 9
 The most basic extension looks like:
10 10
 
11  
-    :::ruby
12 11
     module MyFeature
13 12
       class << self
14 13
         def registered(app)
@@ -24,7 +23,6 @@ This module must be accessible to your `config.rb` file. Either define it direct
24 23
 
25 24
 Finally, once your module is included, you must activate it in `config.rb`:
26 25
 
27  
-    :::ruby
28 26
     activate :my_feature
29 27
 
30 28
 The [`register`](http://rubydoc.info/github/middleman/middleman/master/Middleman/Extensions#register-class_method) method lets you choose the name your extension is activated with. It can also take a block if you want to require files only when your extension is activated.
@@ -33,7 +31,6 @@ In the `MyFeature` extension, the `registered` method will be called as soon as
33 31
 
34 32
 `activate` can also take an options hash (which are passed to `register`) or a block which can be used to configure your extension. 
35 33
 
36  
-    :::ruby
37 34
     module MyFeature
38 35
       # All the options for this extension
39 36
       class Options < Struct.new(:foo, :bar); end
@@ -58,7 +55,6 @@ Passing options to `activate` is generally preferred to setting global variables
58 55
 
59 56
 The [`Middleman::Application`](http://rubydoc.info/github/middleman/middleman/Middleman/Application) class can be used to change global settings (variables using the `set` command) that can be used in your extension.
60 57
 
61  
-    :::ruby
62 58
     module MyFeature
63 59
       class << self
64 60
         def registered(app)
@@ -70,7 +66,6 @@ The [`Middleman::Application`](http://rubydoc.info/github/middleman/middleman/Mi
70 66
 
71 67
 You can also use this ability to create new settings which can be accessed later in your extension.
72 68
 
73  
-    :::ruby
74 69
     module MyFeature
75 70
       class << self
76 71
         def registered(app)
@@ -93,7 +88,6 @@ You can also use this ability to create new settings which can be accessed later
93 88
 
94 89
 Methods available inside `config.rb` as simply class methods of `Middleman::Application`. Let's add a new method to be used in the `config.rb`:
95 90
 
96  
-    :::ruby
97 91
     module MyFeature
98 92
       class << self
99 93
         def registered(app)
@@ -115,7 +109,6 @@ By extending the `Middleman::Application` class, available as `app`, we've added
115 109
 
116 110
 Sometimes you will want to wait until the `config.rb` has been executed to run code. For example, if you rely on the `:css_dir` variable, you should wait until it has been set. For this, we'll use a callback:
117 111
 
118  
-    :::ruby
119 112
     module MyFeature
120 113
       class << self
121 114
         def registered(app)
@@ -132,7 +125,6 @@ Sometimes you will want to wait until the `config.rb` has been executed to run c
132 125
 
133 126
 Similarly, if you're extension relies on variable and settings within Compass to be ready, use the `compass_config` callback.
134 127
 
135  
-    :::ruby
136 128
     module MyFeature
137 129
       class << self
138 130
         def registered(app)
@@ -149,7 +141,6 @@ Similarly, if you're extension relies on variable and settings within Compass to
149 141
 
150 142
 Helpers are methods available inside your template. To add helper methods, we do the following:
151 143
 
152  
-    :::ruby
153 144
     module MyFeature
154 145
       class << self
155 146
         def registered(app)
@@ -167,7 +158,6 @@ Helpers are methods available inside your template. To add helper methods, we do
167 158
 
168 159
 Now, inside your templates, you will have access to a `make_a_link` method. Here's an example using an ERb template:
169 160
 
170  
-    :::erb
171 161
     <h1><%= make_a_link("http://example.com", "Click me") %></h1>
172 162
 
173 163
 ## Request Callback
@@ -176,7 +166,6 @@ The request callback allows you to do processing before Middleman renders the pa
176 166
 
177 167
 Here's an example:
178 168
 
179  
-    :::ruby
180 169
     module MyFeature
181 170
       class << self
182 171
         def registered(app)
@@ -195,7 +184,6 @@ The above sets the `:currently_requested_path` value at the beginning of each re
195 184
 
196 185
 You can modify or add pages in the [sitemap](/metadata/sitemap) by creating a Sitemap extension. The [`:directory_indexes`](/advanced/pretty-urls) extension uses this feature to reroute normal pages to their directory-index version, and the [blog extension](/extensions/blog/) uses several plugins to generate tag and calendar pages. See [the `Sitemap::Store` class](http://rubydoc.info/github/middleman/middleman/Middleman/Sitemap/Store#register_resource_list_manipulator-instance_method) for more details.
197 186
 
198  
-    :::ruby
199 187
     module MyFeature
200 188
       class << self
201 189
         def registered(app)
@@ -227,7 +215,6 @@ You can modify or add pages in the [sitemap](/metadata/sitemap) by creating a Si
227 215
 
228 216
 This callback is used to execute code after the build process has finished. The [middleman-smusher] extension uses this feature to compress all the images in the build folder after it has been built. It's also conceivable to integrate a deployment script after build.
229 217
 
230  
-    :::ruby
231 218
     module MyFeature
232 219
       class << self
233 220
         def registered(app)
3  source/extensions/livereload.html.markdown
Source Rendered
... ...
@@ -1,17 +1,16 @@
1 1
 ---
2 2
 title: LiveReload
  3
+hidden: true
3 4
 ---
4 5
 
5 6
 # LiveReload
6 7
 
7 8
 Middleman provides an official extension to support for the LiveReload browser extension. Simply install the gem:
8 9
 
9  
-    :::bash
10 10
     gem install middleman-livereload
11 11
 
12 12
 If you have installed [the LiveReload extension] in your browser, you can have Middleman automatically tell the browser to refresh upon changes to your source code. To do this, you will need to start the Middleman server in LiveReload mode:
13 13
 
14  
-    :::bash
15 14
     middleman server --livereload
16 15
 
17 16
 Now, browsers using the LiveReload extension can connect to Middleman and automatically refresh after you update your code.
6  source/extensions/remote-api.html.markdown
Source Rendered
... ...
@@ -1,5 +1,6 @@
1 1
 ---
2 2
 title: Remote API Proxy Extension
  3
+hidden: true
3 4
 ---
4 5
 
5 6
 # Remote API Proxy Extension
@@ -8,25 +9,21 @@ Middleman 2.1 ships with an official extension to support loading remote APIs du
8 9
 
9 10
 The Remote API Proxy allows you to mount a remote API, Twitter Search for example, inside your domain during development. Simply install the gem:
10 11
 
11  
-    :::bash
12 12
     gem install middleman-proxy
13 13
 
14 14
 Then activate the extension in your `config.rb`:
15 15
 
16  
-    :::ruby
17 16
     require "middleman-proxy"
18 17
     
19 18
     activate :proxy
20 19
 
21 20
 Next, we will mount the Twitter Search API inside our app in `config.rb`:
22 21
 
23  
-    :::ruby
24 22
     proxy "/api_path", :to => "your-api-hostname.com"
25 23
     proxy "/ssl_api_path", :to => "your-other-api-hostname.com", :secure => true
26 24
 
27 25
 Finally, from our front-end we can now do local AJAX to get remote search results. Here's an example using jQuery:
28 26
 
29  
-    :::javascript
30 27
     $.get("/twitter/search.json", { q: "@middlemanapp" }, function(data) {
31 28
       // Handle the search results for @middlemanapp
32 29
     });
@@ -47,7 +44,6 @@ If you own the API you are connecting to, you can also provide support for CORS
47 44
 
48 45
 For example, with a Sinatra application:
49 46
 
50  
-    :::ruby
51 47
     headers 'Access-Control-Allow-Origin' => '*',
52 48
         'Access-Control-Allow-Methods' => 'GET, PUT, POST, OPTIONS, HEAD, DELETE, PATCH',
53 49
         'Access-Control-Allow-Headers' => 'Content-Type, Authorization',
10  source/getting-started/welcome.html.markdown
Source Rendered
@@ -16,7 +16,6 @@ Mac OS X comes prepackaged with both Ruby and Rubygems, however, some of the Mid
16 16
 
17 17
 Once you have Ruby and RubyGems up and running, execute the following from the command line:
18 18
 
19  
-    :::bash
20 19
     gem install middleman --pre
21 20
 
22 21
 This will install Middleman, its dependencies and the command-line tools for using Middleman.
@@ -35,7 +34,6 @@ To get started we will need to create a project folder for Middleman to work out
35 34
 
36 35
 Simply point the command at the folder for your new site and Middleman will build a skeleton project in that folder (or create the folder for you).
37 36
 
38  
-    :::bash
39 37
     middleman init my_new_project
40 38
 
41 39
 ### The Skeleton
@@ -56,26 +54,22 @@ A config.ru file describes how the site should be loaded by a Rack-enabled webse
56 54
 
57 55
 To include a boilerplate `config.ru` file in your project, add the `--rack` flag to the init command:
58 56
 
59  
-    :::bash
60 57
     middleman init my_new_project --rack
61 58
 
62 59
 ### Project Templates
63 60
 
64 61
 In addition to the default basic skeleton, Middleman comes with an optional project template based on the [HTML5 Boilerplate] project. Alternative templates can be accessed using the `-t` or `--template` command-line flags. For example, to start a new project based on HTML5 Boilerplate, run this command:
65 62
 
66  
-    :::bash
67 63
     middleman init my_new_boilerplate_project --template=html5
68 64
 
69 65
 Finally, you can create your own custom template skeletons by creating folders in the `~/.middleman/` folder. For example, I can create a folder at `~/.middleman/mobile/` and fill it with files I intend to use on mobile projects.
70 66
 
71 67
 If you run middleman init with the help flag, you will see a list of all the possible templates it has detected:
72 68
 
73  
-    :::bash
74 69
     middleman init --help
75 70
 
76 71
 This will list my custom mobile framework and I can create new projects based on it as before:
77 72
 
78  
-    :::bash
79 73
     middleman init my_new_mobile_project --template=mobile
80 74
 
81 75
 ## The Development Cycle (middleman server)
@@ -86,7 +80,6 @@ The vast majority of time spent using Middleman will be in the Development Cycle
86 80
 
87 81
 From the command-line, start the preview web-server from inside your project folder:
88 82
 
89  
-    :::bash
90 83
     cd my_project
91 84
     bundle exec middleman server
92 85
 
@@ -100,7 +93,6 @@ You can stop the preview server from the command-line using CTRL-C.
100 93
 
101 94
 Running `middleman` without any commands is the same as starting a server.
102 95
 
103  
-    :::bash
104 96
     bundle exec middleman
105 97
 
106 98
 This will do exactly the same thing as `middleman server`.
@@ -109,7 +101,6 @@ This will do exactly the same thing as `middleman server`.
109 101
 
110 102
 Under some circumstances(one known case is under Windows, see [here](https://github.com/middleman/middleman/issues/101)), `middleman` might not work as expected, try using a full command instead:
111 103
 
112  
-    :::bash
113 104
     middleman server -p 4567 -e development
114 105
 
115 106
 Under some circumstances(say if your config file has gone wild), middleman server might not be able to boot itself, and no error output can be seen on the console, don't panic, just try `middleman build` to see the full trace of the problem and fix it.
@@ -118,7 +109,6 @@ Under some circumstances(say if your config file has gone wild), middleman serve
118 109
 
119 110
 Finally, when you are ready to deliver static code or, in the case of "blog mode", host a static blog, you will need to build the site. Using the command-line, from the project folder, run `middleman build`:
120 111
 
121  
-    :::bash
122 112
     cd my_project
123 113
     bundle exec middleman build
124 114
 
1  source/javascripts/highlight.pack.js
... ...
@@ -0,0 +1 @@
  1
+var hljs=new function(){function m(p){return p.replace(/&/gm,"&amp;").replace(/</gm,"&lt;")}function c(r,q,p){return RegExp(q,"m"+(r.cI?"i":"")+(p?"g":""))}function j(r){for(var p=0;p<r.childNodes.length;p++){var q=r.childNodes[p];if(q.nodeName=="CODE"){return q}if(!(q.nodeType==3&&q.nodeValue.match(/\s+/))){break}}}function g(t,s){var r="";for(var q=0;q<t.childNodes.length;q++){if(t.childNodes[q].nodeType==3){var p=t.childNodes[q].nodeValue;if(s){p=p.replace(/\n/g,"")}r+=p}else{if(t.childNodes[q].nodeName=="BR"){r+="\n"}else{r+=g(t.childNodes[q])}}}if(/MSIE [678]/.test(navigator.userAgent)){r=r.replace(/\r/g,"\n")}return r}function a(s){var q=s.className.split(/\s+/);q=q.concat(s.parentNode.className.split(/\s+/));for(var p=0;p<q.length;p++){var r=q[p].replace(/^language-/,"");if(d[r]||r=="no-highlight"){return r}}}function b(p){var q=[];(function(s,t){for(var r=0;r<s.childNodes.length;r++){if(s.childNodes[r].nodeType==3){t+=s.childNodes[r].nodeValue.length}else{if(s.childNodes[r].nodeName=="BR"){t+=1}else{if(s.childNodes[r].nodeType==1){q.push({event:"start",offset:t,node:s.childNodes[r]});t=arguments.callee(s.childNodes[r],t);q.push({event:"stop",offset:t,node:s.childNodes[r]})}}}}return t})(p,0);return q}function l(y,z,x){var r=0;var w="";var t=[];function u(){if(y.length&&z.length){if(y[0].offset!=z[0].offset){return(y[0].offset<z[0].offset)?y:z}else{return z[0].event=="start"?y:z}}else{return y.length?y:z}}function s(C){var D="<"+C.nodeName.toLowerCase();for(var A=0;A<C.attributes.length;A++){var B=C.attributes[A];D+=" "+B.nodeName.toLowerCase();if(B.value!==undefined&&B.value!==false&&B.value!==null){D+='="'+m(B.value)+'"'}}return D+">"}while(y.length||z.length){var v=u().splice(0,1)[0];w+=m(x.substr(r,v.offset-r));r=v.offset;if(v.event=="start"){w+=s(v.node);t.push(v.node)}else{if(v.event=="stop"){var p,q=t.length;do{q--;p=t[q];w+=("</"+p.nodeName.toLowerCase()+">")}while(p!=v.node);t.splice(q,1);while(q<t.length){w+=s(t[q]);q++}}}}return w+m(x.substr(r))}function i(){function p(w,u,x){if(w.compiled){return}var t;if(!x){w.bR=c(u,w.b?w.b:"\\B|\\b");if(!w.e&&!w.eW){w.e="\\B|\\b"}if(w.e){w.eR=c(u,w.e)}}if(w.i){w.iR=c(u,w.i)}if(w.r===undefined){w.r=1}if(w.k){w.lR=c(u,w.l||hljs.IR,true);for(var v in w.k){if(!w.k.hasOwnProperty(v)){continue}if(w.k[v] instanceof Object){t=w.k[v]}else{t=w.k;v="keyword"}for(var s in t){if(!t.hasOwnProperty(s)){continue}w.k[s]=[v,t[s]]}}}if(!w.c){w.c=[]}w.compiled=true;for(var r=0;r<w.c.length;r++){if(w.c[r]=="self"){w.c[r]=w}p(w.c[r],u,false)}if(w.starts){p(w.starts,u,false)}}for(var q in d){if(!d.hasOwnProperty(q)){continue}p(d[q].dM,d[q],true)}}function e(J,D){if(!i.called){i();i.called=true}function z(r,M){for(var L=0;L<M.c.length;L++){if(M.c[L].bR.test(r)){return M.c[L]}}}function w(L,r){if(C[L].e&&C[L].eR.test(r)){return 1}if(C[L].eW){var M=w(L-1,r);return M?M+1:0}return 0}function x(r,L){return L.i&&L.iR.test(r)}function A(O,N){var M=[];for(var L=0;L<O.c.length;L++){M.push(O.c[L].b)}var r=C.length-1;do{if(C[r].e){M.push(C[r].e)}r--}while(C[r+1].eW);if(O.i){M.push(O.i)}return c(N,"("+M.join("|")+")",true)}function s(M,L){var N=C[C.length-1];if(!N.t){N.t=A(N,H)}N.t.lastIndex=L;var r=N.t.exec(M);if(r){return[M.substr(L,r.index-L),r[0],false]}else{return[M.substr(L),"",true]}}function p(N,r){var L=H.cI?r[0].toLowerCase():r[0];var M=N.k[L];if(M&&M instanceof Array){return M}return false}function F(M,O){M=m(M);if(!O.k){return M}var N="";var P=0;O.lR.lastIndex=0;var L=O.lR.exec(M);while(L){N+=M.substr(P,L.index-P);var r=p(O,L);if(r){t+=r[1];N+='<span class="'+r[0]+'">'+L[0]+"</span>"}else{N+=L[0]}P=O.lR.lastIndex;L=O.lR.exec(M)}return N+M.substr(P,M.length-P)}function K(r,M){if(M.sL&&d[M.sL]){var L=e(M.sL,r);t+=L.keyword_count;return L.value}else{return F(r,M)}}function I(M,r){var L=M.cN?'<span class="'+M.cN+'">':"";if(M.rB){q+=L;M.buffer=""}else{if(M.eB){q+=m(r)+L;M.buffer=""}else{q+=L;M.buffer=r}}C.push(M);B+=M.r}function E(O,L,Q){var R=C[C.length-1];if(Q){q+=K(R.buffer+O,R);return false}var M=z(L,R);if(M){q+=K(R.buffer+O,R);I(M,L);return M.rB}var r=w(C.length-1,L);if(r){var N=R.cN?"</span>":"";if(R.rE){q+=K(R.buffer+O,R)+N}else{if(R.eE){q+=K(R.buffer+O,R)+N+m(L)}else{q+=K(R.buffer+O+L,R)+N}}while(r>1){N=C[C.length-2].cN?"</span>":"";q+=N;r--;C.length--}var P=C[C.length-1];C.length--;C[C.length-1].buffer="";if(P.starts){I(P.starts,"")}return R.rE}if(x(L,R)){throw"Illegal"}}var H=d[J];var C=[H.dM];var B=0;var t=0;var q="";try{var y,v=0;H.dM.buffer="";do{y=s(D,v);var u=E(y[0],y[1],y[2]);v+=y[0].length;if(!u){v+=y[1].length}}while(!y[2]);if(C.length>1){throw"Illegal"}return{r:B,keyword_count:t,value:q}}catch(G){if(G=="Illegal"){return{r:0,keyword_count:0,value:m(D)}}else{throw G}}}function f(t){var r={keyword_count:0,r:0,value:m(t)};var q=r;for(var p in d){if(!d.hasOwnProperty(p)){continue}var s=e(p,t);s.language=p;if(s.keyword_count+s.r>q.keyword_count+q.r){q=s}if(s.keyword_count+s.r>r.keyword_count+r.r){q=r;r=s}}if(q.language){r.second_best=q}return r}function h(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"<br>")}return r}function o(u,x,q){var y=g(u,q);var s=a(u);var w,r;if(s=="no-highlight"){return}if(s){w=e(s,y)}else{w=f(y);s=w.language}var p=b(u);if(p.length){r=document.createElement("pre");r.innerHTML=w.value;w.value=l(p,b(r),y)}w.value=h(w.value,x,q);var t=u.className;if(!t.match("(\\s|^)(language-)?"+s+"(\\s|$)")){t=t?(t+" "+s):s}if(/MSIE [678]/.test(navigator.userAgent)&&u.tagName=="CODE"&&u.parentNode.tagName=="PRE"){r=u.parentNode;var v=document.createElement("div");v.innerHTML="<pre><code>"+w.value+"</code></pre>";u=v.firstChild.firstChild;v.firstChild.cN=r.cN;r.parentNode.replaceChild(v.firstChild,r)}else{u.innerHTML=w.value}u.className=t;u.result={language:s,kw:w.keyword_count,re:w.r};if(w.second_best){u.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function k(){if(k.called){return}k.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p<r.length;p++){var q=j(r[p]);if(q){o(q,hljs.tabReplace)}}}function n(){if(window.addEventListener){window.addEventListener("DOMContentLoaded",k,false);window.addEventListener("load",k,false)}else{if(window.attachEvent){window.attachEvent("onload",k)}else{window.onload=k}}}var d={};this.LANGUAGES=d;this.highlight=e;this.highlightAuto=f;this.fixMarkup=h;this.highlightBlock=o;this.initHighlighting=k;this.initHighlightingOnLoad=n;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BINARY_NUMBER_RE="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BINARY_NUMBER_MODE={cN:"number",b:this.BINARY_NUMBER_RE,r:0};this.inherit=function(p,s){var r={};for(var q in p){r[q]=p[q]}if(s){for(var q in s){r[q]=s[q]}}return r}}();hljs.LANGUAGES.bash=function(){var d={"true":1,"false":1};var c={cN:"variable",b:"\\$([a-zA-Z0-9_]+)\\b"};var a={cN:"variable",b:"\\$\\{(([^}])|(\\\\}))+\\}",c:[hljs.CNM]};var f={cN:"string",b:'"',e:'"',i:"\\n",c:[hljs.BE,c,a],r:0};var b={cN:"string",b:"'",e:"'",r:0};var e={cN:"test_condition",b:"",e:"",c:[f,b,c,a,hljs.CNM],k:{literal:d},r:0};return{dM:{k:{keyword:{"if":1,then:1,"else":1,fi:1,"for":1,"break":1,"continue":1,"while":1,"in":1,"do":1,done:1,echo:1,exit:1,"return":1,set:1,declare:1},literal:d},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},c,a,hljs.HCM,hljs.CNM,f,b,hljs.inherit(e,{b:"\\[ ",e:" \\]",r:0}),hljs.inherit(e,{b:"\\[\\[ ",e:" \\]\\]"})]}}}();hljs.LANGUAGES.ruby=function(){var c="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var i="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var a={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var d={cN:"yardoctag",b:"@[A-Za-z]+"};var k=[{cN:"comment",b:"#",e:"$",c:[d]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[d],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var e={cN:"subst",b:"#\\{",e:"}",l:c,k:a};var g=[hljs.BE,e];var f=[{cN:"string",b:"'",e:"'",c:g,r:0},{cN:"string",b:'"',e:'"',c:g,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:g,r:10},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:g,r:10},{cN:"string",b:"%[qw]?{",e:"}",c:g,r:10},{cN:"string",b:"%[qw]?<",e:">",c:g,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:g,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:g,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:g,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:g,r:10}];var h={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:c,k:a,c:[{cN:"title",b:i,l:c,k:a},{cN:"params",b:"\\(",e:"\\)",l:c,k:a}].concat(k)};var j={cN:"identifier",b:c,l:c,k:a,r:0};var b=k.concat(f.concat([{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]}].concat(k)},h,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:f.concat([j]),r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},j,{b:"("+hljs.RSR+")\\s*",c:k.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}]),r:0}]));e.c=b;h.c[1].c=b;return{dM:{l:c,k:a,c:b}}}();hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",c:[{b:"\\\\/"}]}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:{"font-face":1,page:1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},a]}]}}}();hljs.LANGUAGES.coffeescript=function(){var d={keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"new":1,"do":1,"return":1,"else":1,"break":1,"catch":1,"instanceof":1,"throw":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1,"debugger":1,"class":1,"extends":1,"super":1,then:1,unless:1,until:1,loop:2,of:2,by:1,when:2,and:1,or:1,is:1,isnt:2,not:1},literal:{"true":1,"false":1,"null":1,"undefined":1,yes:1,no:1,on:1,off:1},reserved:{"case":1,"default":1,"function":1,"var":1,"void":1,"with":1,"const":1,let:1,"enum":1,"export":1,"import":1,"native":1,__hasProp:1,__extends:1,__slice:1,__bind:1,__indexOf:1}};var a="[A-Za-z$_][0-9A-Za-z$_]*";var b={cN:"subst",b:"#\\{",e:"}",k:d,c:[hljs.CNM,hljs.BINARY_NUMBER_MODE]};var c={cN:"string",b:'"',e:'"',r:0,c:[hljs.BE,b]};var h={cN:"string",b:'"""',e:'"""',c:[hljs.BE,b]};var g={cN:"comment",b:"###",e:"###"};var f={cN:"regexp",b:"///",e:"///",c:[hljs.HCM]};var i={cN:"function",b:a+"\\s*=\\s*(\\(.+\\))?\\s*[-=]>",rB:true,c:[{cN:"title",b:a},{cN:"params",b:"\\(",e:"\\)"}]};var e={cN:"javascript",b:"`",e:"`",eB:true,eE:true,sL:"javascript"};return{dM:{k:d,c:[hljs.CNM,hljs.BINARY_NUMBER_MODE,hljs.ASM,h,c,g,hljs.HCM,f,e,i]}}}();
4  source/layouts/layout.erb
@@ -51,6 +51,10 @@
51 51
       </div>
52 52
     </div>
53 53
     
  54
+    <%= javascript_include_tag "highlight.pack" %>
  55
+    <%= stylesheet_link_tag "solarized_light" %>
  56
+    <script>hljs.initHighlightingOnLoad();</script>
  57
+    
54 58
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
55 59
     <script>window.jQuery || document.write('<script src="/javascripts/jquery-1.7.2.js"><\/script>')</script>
56 60
 
3  source/metadata/local-data.html.markdown
Source Rendered
@@ -8,7 +8,6 @@ Sometimes it is useful to extract the data content of a page from the rendering.
8 8
 
9 9
 Here's an example file at `data/people.yml` with the contents:
10 10
 
11  
-    :::yaml
12 11
     friends:
13 12
       - Tom
14 13
       - Dick
@@ -16,7 +15,6 @@ Here's an example file at `data/people.yml` with the contents:
16 15
 
17 16
 Now, anywhere in our template files, we will have access to this data:
18 17
 
19  
-    :::erb
20 18
     <h1>Friends</h1>
21 19
     <ol>
22 20
       <% data.people.friends.each do |f| %>
@@ -26,7 +24,6 @@ Now, anywhere in our template files, we will have access to this data:
26 24
 
27 25
 Which will render:
28 26
 
29  
-    :::html
30 27
     <h1>Friends</h1>
31 28
     <ol>
32 29
       <li>Tom</li>
1  source/metadata/sitemap.html.markdown
Source Rendered
@@ -20,7 +20,6 @@ Each page can also find other pages related to it in the site hierarchy. The `pa
20 20
 
21 21
 You can use the sitemap information to create new [dynamic pages] from `config.rb` (this is how the [blog extension](/extensions/blog) creates tag pages), but you need to be a little careful, because the sitemap isn't populated until *after* `config.rb` has already been run. To get around this, you need to register a callback for the application's `ready` event. As an example, let's say we've added a "category" element to the [frontmatter] of our pages, and we want to create category pages dynamically for each category. To do that, we'd add this to `config.rb`:
22 22
 
23  
-    :::ruby
24 23
     ready do
25 24
       sitemap.pages.group_by {|p| p.data["category"] }.each do |category, pages|
26 25
         page "/categories/#{category}.html", :proxy => "category.html" do
1  source/metadata/yaml-frontmatter.html.markdown
Source Rendered
@@ -8,7 +8,6 @@ YAML Frontmatter is similar to the [Local YAML Data] feature, except it works on
8 8
 
9 9
 Let's take a simple ERb template, adding some YAML variables and change the layout for this specific page.
10 10
 
11  
-    :::erb
12 11
     ---
13 12
     layout: "custom"
14 13
     my_list:
65  source/stylesheets/_pygments/_solarized.scss
... ...
@@ -1,65 +0,0 @@
1  
-.hll { background-color: #ffffcc }
2  
-.c { color: #93a1a1; font-style: italic } /* Comment */
3  
-.g { color: #d33682 } /* Generic */
4  
-.k { color: #859900 } /* Keyword */
5  
-.l { color: #2aa198 } /* Literal */
6  
-.n { color: #268bd2 } /* Name */
7  
-.cm { color: #93a1a1; font-style: italic } /* Comment.Multiline */
8  
-.cp { color: #93a1a1; font-style: italic } /* Comment.Preproc */
9  
-.c1 { color: #93a1a1; font-style: italic } /* Comment.Single */
10  
-.cs { color: #93a1a1; font-style: italic } /* Comment.Special */
11  
-.gd { color: #d33682 } /* Generic.Deleted */
12  
-.ge { color: #d33682 } /* Generic.Emph */
13  
-.gr { color: #d33682 } /* Generic.Error */
14  
-.gh { color: #d33682 } /* Generic.Heading */
15  
-.gi { color: #d33682 } /* Generic.Inserted */
16  
-.go { color: #d33682 } /* Generic.Output */
17  
-.gp { color: #d33682 } /* Generic.Prompt */
18  
-.gs { color: #d33682 } /* Generic.Strong */
19  
-.gu { color: #d33682 } /* Generic.Subheading */
20  
-.gt { color: #d33682 } /* Generic.Traceback */
21  
-.kc { color: #859900; font-weight: bold } /* Keyword.Constant */
22  
-.kd { color: #859900 } /* Keyword.Declaration */
23  
-.kn { color: #dc322f; font-weight: bold } /* Keyword.Namespace */
24  
-.kp { color: #859900 } /* Keyword.Pseudo */
25  
-.kr { color: #859900 } /* Keyword.Reserved */
26  
-.kt { color: #859900; font-weight: bold } /* Keyword.Type */
27  
-.ld { color: #2aa198 } /* Literal.Date */
28  
-.m { color: #2aa198; font-weight: bold } /* Literal.Number */
29  
-.s { color: #2aa198 } /* Literal.String */
30  
-.na { color: #268bd2 } /* Name.Attribute */
31  
-.nb { color: #cb4b16 } /* Name.Builtin */
32  
-.nc { color: #cb4b16 } /* Name.Class */
33  
-.no { color: #268bd2 } /* Name.Constant */
34  
-.nd { color: #268bd2 } /* Name.Decorator */
35  
-.ni { color: #268bd2 } /* Name.Entity */
36  
-.ne { color: #268bd2 } /* Name.Exception */
37  
-.nf { color: #268bd2 } /* Name.Function */
38  
-.nl { color: #268bd2 } /* Name.Label */
39  
-.nn { color: #268bd2 } /* Name.Namespace */
40  
-.nx { color: #268bd2 } /* Name.Other */
41  
-.py { color: #268bd2 } /* Name.Property */
42  
-.nt { color: #268bd2; font-weight: bold } /* Name.Tag */
43  
-.nv { color: #268bd2 } /* Name.Variable */
44  
-.ow { color: #859900 } /* Operator.Word */
45  
-.w { color: #586e75 } /* Text.Whitespace */
46  
-.mf { color: #2aa198; font-weight: bold } /* Literal.Number.Float */
47  
-.mh { color: #2aa198; font-weight: bold } /* Literal.Number.Hex */
48  
-.mi { color: #2aa198; font-weight: bold } /* Literal.Number.Integer */
49  
-.mo { color: #2aa198; font-weight: bold } /* Literal.Number.Oct */
50  
-.sb { color: #2aa198 } /* Literal.String.Backtick */
51  
-.sc { color: #2aa198 } /* Literal.String.Char */
52  
-.sd { color: #2aa198 } /* Literal.String.Doc */
53  
-.s2 { color: #2aa198 } /* Literal.String.Double */
54  
-.se { color: #2aa198 } /* Literal.String.Escape */
55  
-.sh { color: #2aa198 } /* Literal.String.Heredoc */
56  
-.si { color: #2aa198 } /* Literal.String.Interpol */
57  
-.sx { color: #2aa198 } /* Literal.String.Other */
58  
-.sr { color: #2aa198 } /* Literal.String.Regex */
59  
-.s1 { color: #2aa198 } /* Literal.String.Single */
60  
-.ss { color: #2aa198 } /* Literal.String.Symbol */
61  
-.bp { color: #cb4b16 } /* Name.Builtin.Pseudo */
62  
-.vc { color: #268bd2 } /* Name.Variable.Class */
63  
-.vg { color: #268bd2 } /* Name.Variable.Global */
64  
-.vi { color: #268bd2 } /* Name.Variable.Instance */
65  
-.il { color: #2aa198; font-weight: bold } /* Literal.Number.Integer.Long */
4  source/stylesheets/site.css.scss
@@ -12,7 +12,7 @@ $blueprint-grid-columns: 22;
12 12
 @import "blueprint";
13 13
 @include blueprint-typography;
14 14
 
15  
-tt, code {
  15
+tt {
16 16
   font-size: .95em;
17 17
   background: #F8F8F8;
18 18
   @include border-radius(4px);
@@ -109,8 +109,6 @@ aside {
109 109
   }
110 110
 }
111 111
 
112  
-@import "_pygments/solarized";
113  
-
114 112
 footer {
115 113
   font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
116 114
   font-size: 10px;
90  source/stylesheets/solarized_light.scss
... ...
@@ -0,0 +1,90 @@
  1
+/*
  2
+
  3
+Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>
  4
+
  5
+*/
  6
+
  7
+/*pre code {
  8
+  display: block; padding: 0.5em;
  9
+  background: #fdf6e3; color: #657b83;
  10
+}*/
  11
+
  12
+pre .comment,
  13
+pre .template_comment,
  14
+pre .diff .header,
  15
+pre .doctype,
  16
+pre .lisp .string,
  17
+pre .javadoc {
  18
+  color: #93a1a1;
  19
+  font-style: italic;
  20
+}
  21
+
  22
+pre .keyword,
  23
+pre .css .rule .keyword,
  24
+pre .winutils,
  25
+pre .javascript .title,
  26
+pre .method,
  27
+pre .addition,
  28
+pre .css .tag,
  29
+pre .lisp .title {
  30
+  color: #859900;
  31
+}
  32
+
  33
+pre .number,
  34
+pre .command,
  35
+pre .string,
  36
+pre .tag .value,
  37
+pre .phpdoc,
  38
+pre .tex .formula,
  39
+pre .regexp,
  40
+pre .hexcolor {
  41
+  color: #2aa198;
  42
+}
  43
+
  44
+pre .title,
  45
+pre .localvars,
  46
+pre .function .title,
  47
+pre .chunk,
  48
+pre .decorator,
  49
+pre .builtin,
  50
+pre .built_in,
  51
+pre .lisp .title,
  52
+pre .identifier,
  53
+pre .title .keymethods,
  54
+pre .id {
  55
+  color: #268bd2;
  56
+}
  57
+
  58
+pre .attribute,
  59
+pre .variable,
  60
+pre .instancevar,
  61
+pre .lisp .body,
  62
+pre .smalltalk .number,
  63
+pre .constant,
  64
+pre .class .title,
  65
+pre .parent,
  66
+pre .haskell .label {
  67
+  color: #b58900;
  68
+}
  69
+
  70
+pre .preprocessor,
  71
+pre .pi,
  72
+pre .shebang,
  73
+pre .symbol,
  74
+pre .diff .change,
  75
+pre .special,
  76
+pre .keymethods,
  77
+pre .attr_selector,
  78
+pre .important,
  79
+pre .subst,
  80
+pre .cdata {
  81
+  color: #cb4b16;
  82
+}
  83
+
  84
+pre .deletion {
  85
+  color: #dc322f;
  86
+}
  87
+
  88
+pre .tex .formula {
  89
+  background: #eee8d5;
  90
+}
18  source/templates/helpers.html.markdown
Source Rendered
@@ -10,26 +10,22 @@ Template helpers are methods which can be used in your dynamic templates to simp
10 10
 
11 11
 Padrino provides a `link_to` function that you can use to make link tags. At its most basic, `link_to` takes the name and URL of a link:
12 12
 
13  
-    :::erb
14 13
     <%= link_to 'My Site', 'http://mysite.com' %>
15 14
     
16 15
 `link_to` can also take a block, allowing you to provide more complex content for the link:
17 16
 
18  
-    :::erb
19 17
     <%= link_to 'http://mysite.com' do %>
20 18
       <%= image_tag 'mylogo.png' %>
21 19
     <% end %>
22 20
     
23 21
 Middleman enhances the `link_to` helper to be aware of the [sitemap](/metadata/sitemap). If you refer to pages in your source folder (with their file extension minus all the template extensions) then `link_to` will generate the correct link, even if you have extensions like [`:directory_indexes`](/advanced/pretty-urls) on. For example, if you had a file `source/about.html` and `:directory_indexes` on, you could link to it like this:
24 22
 
25  
-    :::erb
26 23
     <%= link_to 'About', '/about.html' %>
27 24
     
28 25
     Produces: <a href='/about/'>About</a>
29 26
     
30 27
 You can also refer to source paths relative to your current page. Some people want their links to be relative to the current page. Pass `:relative => true` to `link_to` to get a relative URL.
31 28
 
32  
-    :::erb
33 29
     From within source/foo/index.html.erb, with :directory_indexes on
34 30
     <%= link_to 'About', '/about.html', :relative => true %>
35 31
 
@@ -37,7 +33,6 @@ You can also refer to source paths relative to your current page. Some people wa
37 33
 
38 34
 If you want all URLs generated by `link_to` to be relative, add this to `config.rb`:
39 35
 
40  
-    :::ruby
41 36
     set :relative_links, true
42 37
     
43 38
 You can still override individual links to not be relative by adding `:relative => false`.
@@ -48,14 +43,12 @@ Output helpers are a collection of important methods for managing, capturing and
48 43
 
49 44
 The `content_for` functionality supports capturing content and then rendering this into a different place such as within a layout. One such example is including assets onto the layout from a template:
50 45
 
51  
-    :::erb
52 46
     <% content_for :assets do %>
53 47
       <%= stylesheet_link_tag 'index', 'custom' %>
54 48
     <% end %>
55 49
     
56 50
 Added to a template, this will capture the includes from the block and allow them to be yielded into the layout:
57 51
 
58  
-    :::erb
59 52
     <head>
60 53
       <title>Example</title>
61 54
       <%= stylesheet_link_tag 'style' %>
@@ -66,14 +59,12 @@ This will automatically insert the contents of the block (in this case a stylesh
66 59
 
67 60
 You can also check if a `content_for` block exists for a given key using `content_for?`:
68 61
 
69  
-    :::erb
70 62
     <% if content_for?(:assets) %>  
71 63
       <div><%= yield_content :assets %></div>
72 64
     <% end %>
73 65
   
74 66
 Also supports arguments yielded to the content block
75 67
 
76  
-    :::erb
77 68
     yield_content :head, param1, param2
78 69
     content_for(:head) { |param1, param2| ...content... }
79 70
      
@@ -83,7 +74,6 @@ Tag helpers are the basic building blocks used to construct html "tags" within a
83 74
 
84 75
 The tag and `content_tag` are for building arbitrary html tags with a name and specified options. If the tag contains "content" within then `content_tag` is used. For example:
85 76
 
86  
-    :::erb
87 77
     <%= tag :img, :src => "/my_image.png" %>
88 78
       # => <img src='/my_image.png'>
89 79
     
@@ -94,7 +84,6 @@ The tag and `content_tag` are for building arbitrary html tags with a name and s
94 84
   
95 85
 The input_tag is used to build tags that are related to accepting input from the user:
96 86
 
97  
-    :::ruby
98 87
     input_tag :text, :class => "demo" 
99 88
       # => <input type='text' class='demo'>
100 89
     input_tag :password, :value => "secret", :class => "demo"
@@ -104,7 +93,6 @@ The input_tag is used to build tags that are related to accepting input from the
104 93
 
105 94
 Asset helpers are intended to help insert useful html onto a view template such as hyperlinks, mail_to links, images, stylesheets and javascript. An example of their uses would be on a simple view template:
106 95
 
107  
-    :::erb
108 96
     <html>
109 97
     <head>
110 98
       <%= stylesheet_link_tag 'layout' %>
@@ -124,7 +112,6 @@ Asset helpers are intended to help insert useful html onto a view template such
124 112
 
125 113
 Form helpers are the "standard" form tag helpers you would come to expect when building forms. A simple example of constructing a non-object form would be:
126 114
 
127  
-    :::erb
128 115
     <% form_tag '/destroy', :class => 'destroy-form', :method => 'delete' do %>
129 116
       <% field_set_tag do %>
130 117
         <p>
@@ -157,14 +144,12 @@ The four format helpers are `escape_html`, `distance_of_time_in_words`, `time_ag
157 144
 The `escape_html` and `js_escape_html` function are for taking an html string and escaping certain characters.
158 145
 `escape_html` will escape ampersands, brackets and quotes to their HTML/XML entities. This is useful to sanitize user content before displaying this on a template. `js_escape_html` is used for passing javascript information from a js template to a javascript function.
159 146
 
160  
-    :::ruby
161 147
     escape_html('<hello>&<goodbye>') # => &lt;hello&gt;&amp;&lt;goodbye&gt;
162 148
 
163 149
 There is also an alias for `escape_html` called `h` for even easier usage within templates.
164 150
 
165 151
 Format helpers also includes a number of useful text manipulation functions such as `simple_format`, `pluralize`, `word_wrap`, and `truncate`.
166 152
 
167  
-    :::ruby
168 153
     simple_format("hello\nworld") 
169 154
       # => "<p>hello<br/>world</p>"
170 155
     pluralize(2, 'person') 
@@ -212,7 +197,6 @@ In addition to the helpers provided by Middleman out of the box, you can also ad
212 197
 
213 198
 To define a helper method, use the `helpers` block in `config.rb`:
214 199
 
215  
-    :::ruby
216 200
     helpers do
217 201
       def some_method
218 202
         # ...do something here...
@@ -221,7 +205,6 @@ To define a helper method, use the `helpers` block in `config.rb`:
221 205
 
222 206
 Alternatively, you can created external Ruby modules which contain helpers and include them. You can put files in the `lib` directory. For example, if you were to extract the above helpers into a file named `lib/custom_helpers.rb`, you could create a module:
223 207
 
224  
-    :::ruby
225 208
     module CustomHelpers
226 209
       def some_method
227 210
         # ...do something here...
@@ -230,7 +213,6 @@ Alternatively, you can created external Ruby modules which contain helpers and i
230 213
 
231 214
 Then in `config.rb`:
232 215
 
233  
-    :::ruby
234 216
     require "lib/custom_helpers"
235 217
     helpers CustomHelpers
236 218
 
1  source/templates/sass-and-compass.html.markdown
Source Rendered
@@ -37,7 +37,6 @@ The same styles could also be expressed in the CSS-superset SCSS format in a fil
37 37
 
38 38
 Both of these files will compile to the following `build/stylesheets/login.css` file:
39 39
 
40  
-    :::css
41 40
     body {
42 41
       background: white;
43 42
       color: black; }
17  source/templates/templates-layouts-partials.html.markdown
Source Rendered
@@ -14,12 +14,10 @@ All template files in Middleman include the extension of that templating languag
14 14
 
15 15
 To begin, this file would just contain normal HTML: