Skip to content

Commit

Permalink
Fix code blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanoneil committed Sep 19, 2012
1 parent 4481b53 commit 93bd63c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 29 deletions.
78 changes: 50 additions & 28 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,55 @@ <h1>Active<span>Admin</span></h1>
<h2>An administration framework for Ruby on Rails</h2>
</div>
</section>
<section data-markdown>
<h1>The <span>Problem</span></h1>
```ruby
class PostsController < ApplicationController
def update
@post = Post.find(params[:id])
@post.update_attributes(params[:post])
<section>
<section data-markdown>
<h1>The <span>Problem</span></h1>
<pre><code class="ruby">
class PostsController < ApplicationController
def update
@post = Post.find(params[:id])
@post.update_attributes(params[:post])
end
end
end

class PagesController < ApplicationController
def update
@page = Page.find(params[:id])
@page.update_attributes(params[:page])
class PagesController < ApplicationController
def update
@page = Page.find(params[:id])
@page.update_attributes(params[:page])
end
end
end
```
</pre></code>
</section>
<section data-markdown>
<h1>The <span>Problem</span></h1>
<pre><code class="ruby">
<%= form_for(@post) do |f| %>
<%= f.text_field :title %>
<%= f.text_area :body %>

<%= f.submit %>
<% end %>

<%= form_for(@page) do |f| %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.label :body %>
<%= f.text_area :body %>

<%= f.submit %>
<% end %>
</pre></code>
</section>
</section>
<section data-markdown>
<h1>The <span>Solution</span></h1>
```ruby
<pre><code class="ruby">
ActiveAdmin.register Post do
end

ActiveAdmin.register Page do
end
```
</code></pre>
</section>
<section>
<h1>It's <span>Pretty</span></h1>
Expand All @@ -80,23 +102,23 @@ <h1>It's <span>Pretty</span></h1>
<section data-markdown>
<h1>Get <span>Started</span></h1>
<h3>Add to Gemfile</h3>
```ruby
<pre><code class="ruby">
gem 'activeadmin'
```
</code></pre>

<h3>Run in CLI</h3>
```bash
<pre><code class="bash">
rails generate active_admin:install
rails generate active_admin:resource [resource]
```
</code></pre>
</section>
<section>
<section>
<h1><span>D</span>omain <span>S</span>pecific <span>L</span>anguage</h1>
</section>
<section data-markdown>
<h1>Index <span>Views</span></h1>
```ruby
<pre><code class="ruby">
index do
column :title
column :author
Expand All @@ -109,11 +131,11 @@ <h1>Index <span>Views</span></h1>
column :some_secret_data
end
end
```
</code></pre>
</section>
<section data-markdown>
<h1>Show <span>Views</span></h1>
```ruby
<pre><code class="ruby">
show do
h3 post.title
div do
Expand All @@ -127,11 +149,11 @@ <h1>Show <span>Views</span></h1>
end
end
end
```
</code></pre>
</section>
<section data-markdown>
<h1>Form <span>Definitions</span></h1>
```ruby
<pre><code class="ruby">
form do |f|
f.inputs "Post Details" do
f.input :title
Expand All @@ -142,17 +164,17 @@ <h1>Form <span>Definitions</span></h1>

f.buttons
end
```
</code></pre>
</section>
<section data-markdown>
<h1>Controller <span>Definitions</span></h1>
```ruby
<pre><code class="ruby">
controller do
def update
# override default update action behavior.
end
end
```
</code></pre>
</section>
</section>
<section>
Expand Down
2 changes: 1 addition & 1 deletion lib/js/showdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,4 +1338,4 @@ var escapeCharacters_callback = function(wholeMatch,m1) {
} // end of Showdown.converter

// export
if (typeof module !== 'undefined') module.exports = Showdown;
if (typeof module !== 'undefined') module.exports = Showdown;

0 comments on commit 93bd63c

Please sign in to comment.