mustdown

15
Mw S Cr - @pp

Upload: simon-courtois

Post on 10-May-2015

960 views

Category:

Technology


0 download

DESCRIPTION

Slides of the talk I gave at Paris.rb on 12/11/2012.

TRANSCRIPT

Page 1: Mustdown

M!"#$%w&S'(%& C%!r#%'" - @)*pp+&%,

Page 2: Mustdown

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

Page 3: Mustdown

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

Page 4: Mustdown

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

Page 5: Mustdown

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

Page 6: Mustdown

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

Page 7: Mustdown

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 %>

Page 8: Mustdown

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 %>

Page 9: Mustdown

github: simonc/mustdown http://slidesha.re/mustdown

M!"#$%w& - ).0p.r"

<%= mustdown template, object %>

<%= mustache template, object %>

<%= markdown template %>

Page 10: Mustdown

github: simonc/mustdown http://slidesha.re/mustdown

I&"#*00*#'%&

gem 'mustdown'

redcarpet

mustache

http://github.com/simonc/mustdown

Page 11: 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 }

Page 12: Mustdown

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 }

Page 13: Mustdown

github: simonc/mustdown http://slidesha.re/mustdown

M!"#$%w& - TODO

Rails

Tests Tests Tests !

Page 14: Mustdown

Q!."#'%&" ?

github: simonc/mustdown http://slidesha.re/mustdown

Page 15: Mustdown

M.r-' !@)*pp+&%,

github: simonc/mustdown http://slidesha.re/mustdown