Skip to content

Instantly share code, notes, and snippets.

@zapatoche
Created September 19, 2011 15:37
Show Gist options
  • Select an option

  • Save zapatoche/1226774 to your computer and use it in GitHub Desktop.

Select an option

Save zapatoche/1226774 to your computer and use it in GitHub Desktop.
load markdown with YAML
//in data/test.yml
copy: >
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
body: >
:markdown
But can include **Markdown** using the appropriate Haml filter.
//in the HAML, template
- test = YAML::load(File.open('data/test.yml'))
//doesn't work
= test["body"]
//work
:markdown
#test
test
test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment