I tried splitting out the markdown content and using Shortcode Assets Plugin to include the CSS and markdown.js in the page, but the markdown syntax of remark.js uses three dashes (---) as the slide separator, and this may be conflicting with Grav and YAML front matter. Not sure. But it’s not working, it shows the markdown slide content unformatted and not displayed as slides.
Would love to be able to get this working inside my Grav site, without having to host these slide pages externally on a http site.
remark.js expects the slide source code as unmodified markdown. So I think it’s worth a try to just disable markdown processing for a slides page. In the Admin panel when you edit the page under the Normal - Advanced tab you’ll see Screenshot at Feb 24 15-55-27. Or you can set that in the page frontmatter/header like this:
Ah good idea @bleutzinn, I was going to suggest to add that code into the page Twig, but it also works in the page with markdown disabled., just checked.
@kylemcbride, what does the HTML source code of the page Grav creates look like? Do all stylesheets get loaded? Is the inline Javascript there? Must be something like that I guess.
@bleutzinn, I know the css is getting loaded, since it messes up my sidebar styling. As for the Javascript … I don’t think I see it in the generated HTML.
I pulled out the javascript from the remark.js boilerplate, and put it in a .js file in the same user/pages folder as the page itself (see below). Then used this in the page:
That doesn’t look good. The initialisation JS code of Remark.js isn’t there. Since you have CSS Pipelining active it isn’t clear whether the CSS Remark requires are loaded. Switching the pipelining off temporarily will add every CSS file as a separate HTML line.
To load the JS you put in a single file you could follow this Tip.
FYI - I’ve just tried to fix my .js file by taking out the external URL sources and leaving only the Javascript code without the tags. And then changed my shortcodes to:
Yes, progress…using Assets plugin and not loading the file but using js_inline asset type, I have that Javascript now generated in the HTML by Grav. Still not getting the http: source initialized for remark.js when using: