Closed rawkode closed 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.
Thank you, I'll take a look at the resources provided. Have a great weekend
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.
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.
First, some people have criticized to Marp's Markdown flavor that has many differences against the general Markdown. Thus, in new Marp ecosystem and Marpit framework, we are aiming to make less frictions from the general Markdown such as CommonMark (the consistent spec of Markdown).
CommonMark cannot bunch multiple Markdowns into one so Marp cannot too.
And we think the original request in this issue does not have to implement into Marp newly, because it may be enough just to preprocess files by using any script (JavaScript, Python, Shell script, etc) before passing Markdown to Marp.
Essentially Marp is Markdown processor, and the proposed syntax is looking like TOML rather than Markdown. So the composition process should not have to be Marp.
If we decided to implement the include feature, we would met to another issue: Marp ecosystem would not be able to keep the consistent in every context because the include syntax is depending on local file system.
Marp expects to work in widely environments like Web, that has no file system. The include feature, that is depending on file system, is not wise for our toolset because of blocking a portability of Marp document and restricting Marp supported environments. (The same thing can be said of #135)
FYI there is the proposal of transclusion for CommonMark, but it also has been pointed out the same problem.
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.
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.
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.