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

Add anchor constructor option for slide anchor customization #340

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Aug 11, 2022

Framework users can control id attribute for each slides by setting anchor constructor option.

// Set page number as anchor (id attribute)
new Marpit({ anchor: true })  // <section id="1">
new Marpit({ anchor: false }) // <section>

// Custom anchor: <section id="page-1">
new Marpit({ anchor: (pageIndex) => `page-${pageIndex + 1}` })

@yhatt yhatt linked an issue Aug 11, 2022 that may be closed by this pull request
@yhatt yhatt merged commit 1364611 into main Aug 11, 2022
@yhatt yhatt deleted the anchor-option branch August 11, 2022 01:37
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.

Make customizable page anchor ID for each slides
1 participant