Created
September 19, 2011 15:37
-
-
Save zapatoche/1226774 to your computer and use it in GitHub Desktop.
load markdown with YAML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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