asciidoctor / asciidoctor-bespoke

:b: An Asciidoctor converter that generates the HTML component of a Bespoke.js presentation from AsciiDoc.
http://asciidoctor.org
MIT License
49 stars 24 forks source link

Add named routes with bespoke-hash? #9

Closed cexbrayat closed 7 years ago

cexbrayat commented 7 years ago

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 commented 7 years ago

We are waiting on https://github.com/bespokejs/bespoke-hash/pull/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?

mojavelinux commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

Can you test the open PR? https://github.com/bespokejs/bespoke-hash/pull/4

cexbrayat commented 7 years ago

I just did, and it works great 👍

mojavelinux commented 7 years ago

\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 commented 7 years ago

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

cexbrayat commented 7 years ago

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

mojavelinux commented 7 years ago

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. :+1:

cexbrayat commented 7 years ago

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 commented 7 years ago

Our pleasure! We love saving good people valuable time. 🍺