CartoDB / odyssey.js

Making it easy to merge map and narrative
BSD 3-Clause "New" or "Revised" License
1.62k stars 187 forks source link

MD in file export #145

Closed andrewxhill closed 10 years ago

andrewxhill commented 10 years ago

Following on @clhenrick's comment, it actually would have been really handy if we had made this part a bit more functional,

<script>window.ODYSSEY_MD = "```\n-title: \"Andrew's life story\"\n-author: \"Andrew\"\n-baseurl: \"http://{s}.api.cartocdn.com/base-antique/{z}/{x}/{y}.png\"\n```\n\n#slide1\nsome text\n\n#slide2\nmore text"</script>

we've unnecessarily muddled the MD inside the HTML. What is awesome is that the template uses the MD, so once you get the hang of it, you could drop new md into your html file without the editor at all. So I would propose something more like this,

<script type="text/html" id="sql_template">
'''
-title: "Andrew's life story"
-author: "Andrew"
'''

#slide1

some text

#slide2

more text
</script>
<script>window.ODYSSEY_MD = $('#markdown').html();</script>
andrewxhill commented 10 years ago

@matallo @javisantana makes sense right?

andrewxhill commented 10 years ago

it preserves the human readability of the whole md part

matallo commented 10 years ago

check, huracán!