Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add a high level feature for creating in-page anchors #689
RIght now using anchors in Prawn relies on digging down into the very low level PDF::Core::Destinations code, and it shouldn't have to. For this reason, I actually undocumented anchors in our manual and API docs.
I started an experiment to implement higher level functionality in #684, but then realized I'd rather someone who has a practical use case for anchors take a stab at building an API for them. Until then, our support for anchors should be considered mostly unsupported.
Suggestions are welcome on this, and it might be an easy patch for someone new to the project.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Note that #683 is still a valid issue currently, I've only closed it because until we have a legitimate high level interface to support, it's a bug in the internals rather than in something that is officially part of Prawn's external API. A patch is still welcome, and I will reopen #683 when we find a solution for this ticket.
Here's how I implemented cross-references in a small project I'm currently working on:
add_dest "LinkedSection", dest_xyz(bounds.absolute_left, y) # somewhere else in the document text '<link anchor="LinkedSection">Click me!</link>', :inline_format => true
So... we have the raw tools in place, they're just awkward to use. I'll give some thought into how to wrap them nicely, but proposals are welcome.