Skip to content

Conversation

t-fritsch
Copy link
Collaborator

@t-fritsch t-fritsch commented Aug 5, 2023

Following the issue #3231, this PR adds the possibility to link to a slide by the id of an element inside it (as stated in the issue, this is especialy useful when the markup is generated by an external tool).

Usage example :

<section>
    <h2>Slide 1</h2>
    <a href="#section-id">#section-id</a> (already working)<br/>
    <a href="#nested-id">#nested-id</a> (added by this PR)<br/>
</section>
<section id="section-id">
    <h2>Slide 2</h2>
    <div>
        <div id="nested-id">some div inside the slide</div>
    <div>
</section>
more complete example (with vertical slides)
<section>
	<a href="#section-id">#section-id</a> <br/>
	<a href="#nested-id">#nested-id</a> <br/>
	<a href="#vertical-section-id">#vertical-section-id</a> <br/>
	<a href="#vertical-nested-id-1">#vertical-nested-id-1</a> <br/>
	<a href="#vertical-section-id-2">#vertical-section-id-2</a> <br/>
	<a href="#vertical-nested-id-2">#vertical-nested-id-2</a> <br/>
</section>
<section id="section-id">
	<h2>section id</h2>
	<div id="nested-id"></div>
</section>
<section>
	<section id="vertical-section-id">
		<h2>vertical section id</h2>
		<ul>
			<li id="vertical-nested-id-1">
				vertical nested id 1
			</li>
			<li>
				<section>
					<li id="vertical-nested-id-2">
						vertical nested id 2
					</li>
				</section>
			</li>
		</ul>
	</section>
	<section id="vertical-section-id-2">
		<h2>vertical section id 2</h2>
	</section>
</section>

@hakimel hakimel merged commit b66121e into hakimel:master Aug 6, 2023
@hakimel
Copy link
Owner

hakimel commented Aug 6, 2023

Being able to link to any element by ID is a great addition. Thanks for adding that!

@t-fritsch t-fritsch deleted the allow-link-to-nested-element-id branch September 12, 2023 11:47
cderv added a commit to quarto-dev/quarto-cli that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants