asciidoctor / asciidoctor

:gem: A fast, open source text processor and publishing toolchain, written in Ruby, for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.
https://asciidoctor.org
Other
4.75k stars 789 forks source link

Add a back to top button document attribute #4220

Closed HarshKapadia2 closed 9 months ago

HarshKapadia2 commented 2 years ago

Add a :back-to-top-btn: document attribute using the Intersection Observer API.

Example (bottom right):

image

mojavelinux commented 9 months ago

There a myriad of ways that this could be implemented and I don't think there is universal agreement on how it should look or work. Instead, I have create a docinfo extension in that lab that adds this widget to the page. See https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/main/lib/back-to-top-docinfo-processor.rb If that garners interested and we can decide how that might be integrated into the built-in HTML converter, then we can consider promoting it.