fabe/gatsby-starter-deck

Multiple Slides in one MD

signalwerk opened this issue · 2 comments

Hey @fabe

Thanks a lot for your work! Since I'm teaching students (part time) I'm often handling larger decks. I worked till now with reveal.js and one thing I really like is the fact that I'm able to have one MD-File and have all my slides in there. If I decide to switch one slide back or forth I just need to copy paste and not fiddle around with renaming files. I was thinking about how to implement that in gatsby with your starter. But I didn't find a good solution. One option would be:

  1. exports.createPages → search in all *.md files my slide-separator (--s--) and createPage for each part
  2. slide.js → splice here the correct part of the html (kind'a ugly...)

or do you have an other good idea?

fabe commented

That's something I've been thinking about, although I would like to keep it to one slide per file. Would a small CLI helper do? Something like:

$ npm run add-slide 6

Which would create a new slide at position 6 (6.md) and rename all the other slides accordingly. Could be used together with npm run remove-slide. To rearrange slides you could still just copy and paste from file to file then.

that might be a nice helper function! personally it's not flexible and fast enough for me. I know myself and I have to shuffle many slides back and forth and it's just easy to do it in one file. I often also don't know on what number of slide I'm currently working on because it's not important for me. but maybe that's just a personal preference and other are cool with having all in separate files. great work on your side anyway! 🌟💫