marp-team / marpit

The skinny framework for creating slide deck from Markdown
https://marpit.marp.app/
MIT License
948 stars 45 forks source link

Composable Decks #257

Closed rawkode closed 4 years ago

rawkode commented 4 years ago

Hi,

Apologises if this is already possible and I've missed it, but I did look for examples first and couldn't find any.

I have a lot of common slides that I reuse across my presentations. I'd like to be able to use markdown, YAML, or JS to pick and order the slides I need in each.

Example, I would like to have common directory with my hello, about me, and goodbye slides.

Each talk would then have its own directory with specifics, and then I may have some topic based directories.

So each deck I'd like to provide a YAML list or JS array that states how to construct the deck.

deck = [
  common/hello.md
  common/about me.md
  deck/1.md
  deck/3.md
  deck/12.md
  kubernetes/what-is-it.md
  common/bye.md
];
yhatt commented 4 years ago

You can see the most similar solution for your purpose in #227 and marp-team/marp-core#163. They are just using extended import syntax within Markdown powered by markdown-it-include, but may be enough to make the composed deck.

And there is a real-world Marp slide using composition with markdown-it-include too (from community).

Probably we would not make a framework-level support for the composable deck from multiple Markdowns because it looks like limited needs. Even so, Marpit framework can extend as you like by using exist compatible markdown-it plugin or writting Marpit plugin with your need.

rawkode commented 4 years ago

Thank you, I'll take a look at the resources provided. Have a great weekend

ricardo-reis-1970 commented 4 years ago

As a newbie enthusiast, I'm looking at several corners of Marp and, regarding markdown-it-include, it really doesn't strike me as a solution in the same footing as the remainder of Marp.

Not at all being shy to jump into Node after 20 lovely years of JavaScript, it really breaks my current flow of writing markdown and having it served directly from the docker image with -s .. Furthermore, if the solution is down to coding a composable markdown, it looks like we're diverging from Marp altogether.

Absolutely understanding that suggesting upgrades / new features is much easier than actually implementing them, I feel a bit intrigued by the absence of this basic include feature, whatever the demand for it might be -- which I really anticipate as high! -- as it seems so easy when compared to everything else Marp already does.

I would also like to have it as attempting to do a similar thing with CSS, through @import proved unsuccessful, leading to a lot of repetition and additional burden to maintain / improve / upgrade / rebrand any slide deck.

EDIT: @import is working.

yhatt commented 4 years ago

Even if it looks like easy to implement, we would not work on the uncommon include feature because of our policies.

I have explained the fragmented reason every time when asked about a lacked feature, but I thought it's better to explain some backgrounds on this occasion.

The plugin architecture for Marpit and Marp compatible with markdown-it has adopted to resolve them in user-side, and markdown-it-include is one of "really working" solution without breaking exist workflow of Marp tool.

ricardo-reis-1970 commented 4 years ago

That is a very fair point, and I stand corrected. In fact, I'm doing some beautiful presentations already, enhancing Markdown with some HTML / CSS tricks and I guess that if I'm willing to walk that extra mile, your proposed mile is not that far after all.

We users are the worst, always complaining and asking for more. I really hope I will be able to give something back in the future.