Support for building multiple presentations or custom export filenames
See original GitHub issueFirst of all, thanks so much for all the hard work that’s gone into this package. It’s been a HUGE timesaver building presentations for my job.
I have a scenario that I’m wondering if there’s an easier way to support. I have built several presentations which all share the same theme, images, fonts, etc. And as such I’ve kept them all in the same repo so they can share assets. The problem comes at build time. As far as I can tell the default build script is only capable of outputing a single presentation at a time, and always names them as index.html
and main.js
. This is a fine for building a single presentation, but what I’ve had to do is write my own wrapper around the mdx-deck
build script which catches the files after they’ve been output and renames them. Would it be possible to add a configuration option that allows the user to specify the output filenames in the CLI? I’m envisioning something like this:
mdx-deck build presentation.mdx --filename custom-name
Which would output the following:
├── dist/
│ ├── custom-name.html
│ ├── custom-name.js
Or alternatively, the build script could accept an array of presentation arguments, which it would use to automatically generate these filenames like this:
mdx-deck build slides1.mdx slides2.mdx slides3.mdx
Which would output:
├── dist/
│ ├── slides1.html
│ ├── slides1.js
│ ├── slides2.html
│ ├── slides2.js
│ ├── slides3.html
│ ├── slides3.js
If I was more comfortable with Webpack I would just put in a pull request myself, but as it stands I thought I would just bring this use-case to your attention. I’ve solved this problem for myself with some ancillary tooling, but it would be nice to have it baked in for future projects.
One other thought, at first run, I anticipated that the build script would also copy any static assets being used and include them in the dist folder. Would this as an option also be possible? I’ve ended up having to write a post-build script that finds the assets and copies them to the build folder so all of the relative links still work. Anyways, just a thought.
Thanks again!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
The new Gatsby theme lets you develop multiple decks at once in the same site. This will be the recommended way going forward, so closing this issue for now
Here is a example of multiple mdx-deck https://github.com/sibelius/relay-modern-course
in a monorepo
it was deployed using now.sh here: https://relay-modern-course.now.sh/packages/
it would be cool to run all slides all at once for development and be able to link one set of slides in another one