Skip to content

Hierarchy of sections not clear in generated HTML. Is there an unnecessary wrapping section? #174

@achimwackerow

Description

@achimwackerow

What happened?

Why are the main sections wrapped in another section? Revealjs doesn't do this.
This can cause issues for revealjs plugins.

The generated HTML of the sphinx-revealjs demo has following structure:

<body>
	<div class="reveal">
		<div class="slides" role="main">
			<section>
				<section>
					<h1>Introduction of sphinx-revealjs</h1>
				</section>
			</section>
			<section>
				<section>
					<h2>Overview</h2>
				</section>
				<section>
					<h3>What is this?</h3>
...

It is not clear why each main section (like h1 and h2) are in a section which is in a section. One level of section seems to be enough.
(Furthermore there is an unnecessary closing "" after "<script async". This might be caused by some issue in the Python code.)

The reveal.js demo barebones at https://github.com/hakimel/reveal.js/blob/master/examples/barebones.html
has following structure:

<body>
	<div class="reveal">
		<div class="slides">
			<section>
				<h2>Barebones Presentation</h2>
				<p>This example contains the bare minimum includes and markup required to run a reveal.js presentation.</p>
			</section>
			<section>
				<h2>No Theme</h2>
...

This is a simpler structure which can be used successfully with the revealjs plugin simplemenu. An attribute "data-name" is specified to each main section. A menu of main sections can then automatically be generated.

This is not possible with an additional outer section (which is currently generated by sphinx-revealjs). The data-name would show up only in the inner section which is then ignored by the plugin.

For the demo of simplemenu see: https://github.com/Martinomagnifico/reveal.js-simplemenu/blob/master/demo.html
in action: https://martinomagnifico.github.io/reveal.js-simplemenu/demo.html#/whatitdoes

Operating system

Windows 10

Python runtime and version

Python 3.12.4

Sphinx version

7.2.6

Library version

3.0.2

Extra context

Thank you for the version 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions