asciidoctor-reveal.js icon indicating copy to clipboard operation
asciidoctor-reveal.js copied to clipboard

New docinfo before slides

Open wiibaa opened this issue 5 years ago • 5 comments

Hello,

I'm looking into integrating some plugin such as https://github.com/martinomagnifico/reveal.js-simplemenu/ but these require to put HTML content before/after the slides div Current docinfo allow only to add content inside this slides div, before the first / after the last slide.

Adding a new injection point seems way to easy (https://github.com/wiibaa/asciidoctor-reveal.js/commit/665f072a7966e39520a6f248fafb183f32dac4d6) but I suppose the naming would need to be approved before finalizing a pull request (adapting the doc...) so I raise a question first

Cheers

wiibaa avatar Aug 18 '20 13:08 wiibaa

Instead of introducing a new named docinfo, I think it might be better considering moving the "header" docinfo. The idea of the "header" docinfo is that it provides content outside the main document.

If that would cause too much of an issue, I would recommend a different name like "topbar" or just "top". I don't like the idea of "topheader" as that's just too similar to "header".

mojavelinux avatar Aug 18 '20 18:08 mojavelinux

Thanks for the quick reply, I would go for a new "top" injection point as moving the existing one could have unwanted side-effect depending (thinking about css rules mainly)

wiibaa avatar Aug 21 '20 07:08 wiibaa

You're right that moving the existing docinfo slots could have quite a ripple effect.

The top insertion slot is still inside of the "reveal" div. So it's not really purely the top. Does it have to be inside the "reveal" div? If so, I wonder if there is a name for this location in reveal terminology. I think getting the terminology is important here to avoid confusing users.

mojavelinux avatar Aug 21 '20 08:08 mojavelinux

The reference I could find is more about behind "outside of the .slides:" but being under the .reveal seems important looking at the code:

var simpleMenu = function simpleMenu(deck, options) {
  var viewport = deck.getRevealElement().tagName == "BODY" ? document : deck.getRevealElement();
  var menus = selectionArray(viewport, ".".concat(options.menuclass));

From the reveal.js changelog:

Adds Reveal.getRevealElement() for retrieving the presentation's root element (<div class="reveal">).

Reveal defines the hierarchy but does not name its parts

The presentation markup hierarchy needs to be .reveal > .slides > section where the section represents one slide and can be repeated indefinitely. If you place multiple section elements inside of another section they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and will be included in the horizontal sequence.

Should we call it one of those:

  • root => docinfo-root-revealjs.html
  • deck => docinfo-deck-revealjs.html
  • revealElement => docinfo-revealElement-revealjs.html .

Could not find other plugins requiring HTML in outside of the slides this https://github.com/Martinomagnifico/reveal.js-simplemenu is the only example so far.

Edit: could be "viewport" as per https://revealjs.com/markup/#viewport

wiibaa avatar Aug 21 '20 11:08 wiibaa

The top insertion slot is still inside of the "reveal" div. So it's not really purely the top.

True but at the same time, I don't think it makes sense to put content at the top of <body> right? So I'm OKish with the name "top".

Could not find other plugins requiring HTML in outside of the slides this Martinomagnifico/reveal.js-simplemenu is the only example so far.

That's why I'm not 100% convinced that we should introduce a new docinfo location to accommodate a single plugin. I mean people might get creative and find more usage but it feels too much... but at the same time I can't find a simple workaround :grimacing:

ggrossetie avatar Nov 28 '20 23:11 ggrossetie

This issue can be closed. Simplemenu can use an internal config to insert the menu, since the last version (2.0.0).

Martinomagnifico avatar May 10 '23 15:05 Martinomagnifico

Thanks for the heads-up!

ggrossetie avatar May 10 '23 16:05 ggrossetie