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 named routes with bespoke-hash? #9

Closed
cexbrayat opened this issue Mar 24, 2017 · 11 comments
Closed

Add named routes with bespoke-hash? #9

cexbrayat opened this issue Mar 24, 2017 · 11 comments

Comments

@cexbrayat
Copy link
Contributor

Sorry if this is obvious, but I can't figure out how to use name route hashes provided by https://github.com/bespokejs/bespoke-hash with asciidoctor-bespoke...

If I understand https://github.com/asciidoctor/asciidoctor-bespoke/blob/master/templates/slim/section.html.slim this might not yet be supported (it doesn't look like data-bespoke-hash can be added to the section.

Something like:

[hash="intro"]
== Intro

allowing to go to /#intro would be great.

If you agree (and if it isn't yet supported), I can provide a naive PR to implement it.

@mojavelinux
Copy link
Member

mojavelinux commented Mar 24, 2017

We are waiting on bespokejs/bespoke-hash#4 to be merged upstream.

Then you can just write:

[#intro]
== Intro

And it will work.

Of course, I'm now maintainer on Bespoke, so I guess I can approve that PR now. Would you like to test it?

cexbrayat added a commit to cexbrayat/asciidoctor-bespoke that referenced this issue Mar 24, 2017
cexbrayat added a commit to cexbrayat/asciidoctor-bespoke that referenced this issue Mar 24, 2017
@mojavelinux
Copy link
Member

@cexbrayat Do you think we should just fix this in bespoke-hash instead? I don't really love the idea of adding a hash attribute to the section. But I can be swayed.

@cexbrayat
Copy link
Contributor Author

Well, even better than what I was trying to come with :)

Sure, ping me when it's testable, I'll gladly give it a go.
I'll close my related and now unneeded PR, thx Dan!

@mojavelinux
Copy link
Member

Can you test the open PR? bespokejs/bespoke-hash#4

@cexbrayat
Copy link
Contributor Author

I just did, and it works great 👍

@mojavelinux
Copy link
Member

\o/

Do you see any reason why we wouldn't want to base the association on the ID? (I can't really think of any).

@cexbrayat
Copy link
Contributor Author

TBH that was what I tried first without looking at the docs, so I think it would be the way to go :)

cexbrayat added a commit to cexbrayat/asciidoctor-bespoke that referenced this issue Mar 24, 2017
cexbrayat added a commit to cexbrayat/asciidoctor-bespoke that referenced this issue Mar 24, 2017
@cexbrayat
Copy link
Contributor Author

@mojavelinux I added a PR to document that (if it ever gets merged upstream :) )

@mojavelinux
Copy link
Member

TBH that was what I tried first without looking at the docs, so I think it would be the way to go :)

That's exactly what we like to hear before merging a feature. 👍

@cexbrayat
Copy link
Contributor Author

I just tested bespoke-hash@1.1.0 and it works like a charm. I'm really happy to be able to navigate my 700 slides without remembering the id of the slides ^^.

Thanks @mojavelinux and @hsablonniere for your (as always) quick and very nice help!

@mojavelinux
Copy link
Member

mojavelinux commented Mar 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants