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 slide name-based navigation #30

Open
jamesnw opened this issue Feb 13, 2024 · 1 comment
Open

Add slide name-based navigation #30

jamesnw opened this issue Feb 13, 2024 · 1 comment
Assignees

Comments

@jamesnw
Copy link
Contributor

jamesnw commented Feb 13, 2024

Is your feature request related to a problem? Please describe.
When adding links between slides, it could be difficult to keep index-based links up to date, for instance if a new title slide is inserted at the beginning.

Describe the solution you'd like
Each slide could have an optional slide-name attribute, for instance slide-name="shortcuts". Then, the user could add a <button type="button" to-slide-named="shortcuts">To Shortcuts</button> element, which would behave similarly to to-slide="#" where # is the index for [slide-name="shortcuts"].

Ideally, we would also be able to use the name for URL-based hash navigation, but I'm not thinking of a good way to allow for the element to have the index id AND the named id simultaneously.

@mirisuzanne
Copy link
Member

I think we could even use to-slide for both?

  • If it's a number, go to that number
  • If it's a string, look for a slide name
  • If there's no value, get the ancestor slide index

The only potential overlap would be if you wanted to give a slide a number name? But that seems like a good thing to discourage.

Ideally, we would also be able to use the name for URL-based hash navigation, but I'm not thinking of a good way to allow for the element to have the index id AND the named id simultaneously.

We can't use two IDs. But we could use a non-ID method for numbering slides and moving numerically? Then the ID could be name-based when a name is available? Names could even be provided directly as IDs, potentially. It adds a bit of abstraction to the code. goTo(15) has to look up the 15th slide, find out what ID/name is applied to it. But currently we would have to do the inverse of that (taking the name and looking up a number), so it's not a big loss.

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

No branches or pull requests

2 participants