mustdown
DESCRIPTION
Slides of the talk I gave at Paris.rb on 12/11/2012.TRANSCRIPT
M!"#$%w&S'(%& C%!r#%'" - @)*pp+&%,
github: simonc/mustdown http://slidesha.re/mustdown
M!"#*-).
<h1>The {{name}} company</h1>
<p>Slogan: {{slogan}}</p>
<p>Site: {{url}}</p> <h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
name: Githubslogan: Social Coding (for all)url: http://github.com
Object
Mustache
HTML
github: simonc/mustdown http://slidesha.re/mustdown
M!"#*-).
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
<ul> <li>Hubot: https://github.com/github/hubot</li> <li>Gollum: https://github.com/github/gollum</li></ul>
<h1>The {{name}} company</h1>
<p>Slogan: {{slogan}}</p><p>Site: {{url}}</p>
<ul> {{#projects}} <li>{{title}}: {{url}}</li> {{/projects}}</ul>
name: Githubslogan: Social Coding (for all)url: http://github.comprojects: - title: Hubot url: https://github.com/github/hubot - title: Gollum url: https://github.com/github/gollum
Object
MustacheHTML
github: simonc/mustdown http://slidesha.re/mustdown
M!"#*-).
ActiveRecord
<h1>The {{name}} company</h1>
<p>Slogan: {{slogan}}</p> <p>Site: {{url}}</p>
<ul> {{#projects}} <li>{{title}}: {{url}}</li> {{/projects}} </ul>
company = Company.where(name: 'Github').first
template = <<-END
END
Mustache.render(template, company)
Ruby
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
<ul> <li>Hubot: https://github.com/github/hubot</li> <li>Gollum: https://github.com/github/gollum</li></ul>
HTML
github: simonc/mustdown http://slidesha.re/mustdown
M*r/$%w&
# The Github company
Slogan: Social Coding (for all)
Site: [Github](http://github.com)
* Hubot* Gollum
Markdown
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: <a href=”http://github.com”>Github</a></p>
<ul> <li>Hubot</li> <li>Gollum</li></ul>
HTML
github: simonc/mustdown http://slidesha.re/mustdown
M!"#$%w&
# The {{name}} company
Slogan: {{slogan}}
Site: {{url}}
{{#projects}}* {{title}}: {{url}}{{/projects}}
Mustdown
name: Githubslogan: Social Coding (for all)url: http://github.comprojects: - title: Hubot url: https://github.com/github/hubot - title: Gollum url: https://github.com/github/gollum
Object
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
<ul> <li>Hubot: https://github.com/github/hubot</li> <li>Gollum: https://github.com/github/gollum</li></ul>
HTML
github: simonc/mustdown http://slidesha.re/mustdown
M!"#$%w& - ).0p.r"
@company = Company.where(name: 'Github').first
class CompaniesController < ApplicationController def show
endend
View
Controller
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
<ul> <li>Hubot: https://github.com/github/hubot</li> <li>Gollum: https://github.com/github/gollum</li></ul>
HTML
# The {{name}} company
Slogan: {{slogan}}
Site: {{url}}
{{#projects}} * {{title}}: {{url}} {{/projects}}
@template = <<-END
END
# app/views/companies/show.html.erb<%= mustdown @template, @company %>
github: simonc/mustdown http://slidesha.re/mustdown
M!"#$%w& - ).0p.r"
en: companies: show: text: |
en.yml
@company = Company.where(name: 'Github').first
class CompaniesController < ApplicationController def show
endend
View
<h1>The Github company</h1>
<p>Slogan: Social Coding (for all)</p>
<p>Site: http://github.com</p>
<ul> <li>Hubot: https://github.com/github/hubot</li> <li>Gollum: https://github.com/github/gollum</li></ul>
HTML
Controller
# The {{name}} company
Slogan: {{slogan}}
Site: {{url}}
{{#projects}} * {{title}}: {{url}} {{/projects}}
# app/views/companies/show.html.erb<%= mustdown t(‘.text’), @company %>
github: simonc/mustdown http://slidesha.re/mustdown
M!"#$%w& - ).0p.r"
<%= mustdown template, object %>
<%= mustache template, object %>
<%= markdown template %>
github: simonc/mustdown http://slidesha.re/mustdown
I&"#*00*#'%&
gem 'mustdown'
redcarpet
mustache
http://github.com/simonc/mustdown
github: simonc/mustdown http://slidesha.re/mustdown
C%&12!r*#'%&
$ rails generate mustdown:install
# config/initializers/mustdown.rbMustdown.configure do |config|
end
config.markdown_extensions = { no_intra_emphasis: true, tables: true, fenced_code_blocks: true, autolink: true, strikethrough: true }
config.renderer_options = { no_styles: true, safe_links_only: true }
github: simonc/mustdown http://slidesha.re/mustdown
C%&12!r*#'%&
<%= markdown template, { autolink: false } %>, { no_links: true }
<%= mustdown template, object, { autolink: false } %>, { no_links: true }
github: simonc/mustdown http://slidesha.re/mustdown
M!"#$%w& - TODO
Rails
Tests Tests Tests !
Q!."#'%&" ?
github: simonc/mustdown http://slidesha.re/mustdown
M.r-' !@)*pp+&%,
github: simonc/mustdown http://slidesha.re/mustdown