doersino / markdeep-slides

Build presentation slides with Markdeep and present them right in your browser.
https://doersino.github.io/markdeep-slides/demo.md.html
BSD 2-Clause "Simplified" License
172 stars 13 forks source link

directory structure for multiple slide sets #29

Closed IngmarBitter closed 2 years ago

IngmarBitter commented 2 years ago

I'm just starting out with markdeep-slides, but am already very excited! I'd like to have a bunch of slide sets, one for each chapter in my 'book'. They all have accompanying files, so each chapter should be its own subdirectory. With the current setup in the repo that means I need to copy the markdeep-slides folder into each of the chapter folders. That's a pain to maintain if there are changes to the folder and is a lot of wasted space. Instead, I'd like to move the markdeep-slides folder one up in the directory structure so it becomes a sibling of Chapter1, Chapter2, Chapter3, etc. It seemed pretty straightforward. I simply edited the final section to prepend the paths with '../'. And it mostly works, but somehow the fonts are not the correct ones and it's not obvious why. So this issue is to get assistance in fixing the fonts. Here is my final demo.md.html section:

<!-- Markdeep slides stuff -->
<script>
    markdeepSlidesOptions = {
        aspectRatio: 16 / 9,
        theme: 'simple',
        fontSize: 28,
        diagramZoom: 1.0,
        totalSlideNumber: false,
        progressBar: true,
        breakOnHeadings: false,
        slideChangeHook: (oldSlide, newSlide) => {},
        modeChangeHook: (newMode) => {}
    };
</script>
<link rel="stylesheet" href="../markdeep-slides/lib/markdeep-relative-sizes/1.11/relativize.css">
<link rel="stylesheet" href="../markdeep-slides/markdeep-slides.css">
<script src="../markdeep-slides/markdeep-slides.js"></script>

<!-- Markdeep stuff -->
<script>
    markdeepOptions = {
        tocStyle: 'none',
        detectMath: false,
        onLoad: function() {
            initSlides();
        }
    };
</script>
<style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style>
<script src="../markdeep-slides/lib/markdeep/1.11/markdeep.min.js" charset="utf-8"></script>
<script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>
doersino commented 2 years ago

That's certainly an interesting question!

I first suspected that this behavior was due to Same-origin policy, but it isn't – instead, it's because how theme loading works: