Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
achimwackerow opened this issue Jul 18, 2024 · 5 comments
Labels
question Further information is requested

Comments

@achimwackerow
Copy link

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.

@achimwackerow achimwackerow added the triage Author does not see it yet label Jul 18, 2024
@attakei
Copy link
Owner

attakei commented Jul 21, 2024

Why are the main sections wrapped in another section?

This is for "Vertical Slides" feature of revealjs.
sphinx-revealjs defines and implements that h1 and h2 sections are top of vertical slides.
And , it is generated nested sections everytimes for implementation simplify.

@attakei
Copy link
Owner

attakei commented Jul 21, 2024

Please paste or share your reproduction code.

v3.0.x provides directives to inject attributes into per section elements.
Therefore, I think that can do it in current version.

I need to see your code issued for this to judge where are there problems.

@attakei attakei added question Further information is requested and removed triage Author does not see it yet labels Jul 21, 2024
@achimwackerow
Copy link
Author

I realized now that I wrongly placed the directive "revealjs-section". I corrected it and it works. The related fragment of conf.py, the rst file and a screenshot are attached.
BTW the discussions link is broken. Is there a possibility to ask questions other than with github issues?
Thanks again!
conf.py.fragment.txt
index.rst.txt
example_screenshot

@achimwackerow
Copy link
Author

Here are the files which combine the directives "revealjs-section" and "revealjs-vertical".
index2.rst.txt
example2_screenshot

@attakei
Copy link
Owner

attakei commented Aug 6, 2024

I realized now that I wrongly placed the directive "revealjs-section". I corrected it and it works. The related fragment of conf.py, the rst file and a screenshot are attached.

Good! You can embed any revealjs plugins when using revealjs-section and revealjs-vertical properly.

BTW the discussions link is broken. Is there a possibility to ask questions other than with github issues?

I cloesed discussion pages once because questions are not much, but I missed to remove link for it.
If you want to questions for it, use issue (it may reopen discussion, but it will be not now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants