Add a high level feature for creating in-page anchors #689

Open
practicingruby opened this Issue Mar 6, 2014 · 6 comments

Comments

Projects
None yet
2 participants
@practicingruby
Member

practicingruby commented Mar 6, 2014

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.

@practicingruby

This comment has been minimized.

Show comment Hide comment
@practicingruby

practicingruby Mar 6, 2014

Member

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.

Member

practicingruby commented Mar 6, 2014

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.

@practicingruby

This comment has been minimized.

Show comment Hide comment
@practicingruby

practicingruby Mar 10, 2014

Member

Should also consider adding a higher level interface for making external links to, particularly for use w. images

Member

practicingruby commented Mar 10, 2014

Should also consider adding a higher level interface for making external links to, particularly for use w. images

@practicingruby

This comment has been minimized.

Show comment Hide comment
@practicingruby

practicingruby Dec 3, 2014

Member

Bumping this just because I've ran into the problem myself several times.

Member

practicingruby commented Dec 3, 2014

Bumping this just because I've ran into the problem myself several times.

@mojavelinux

This comment has been minimized.

Show comment Hide comment
@mojavelinux

mojavelinux Dec 3, 2014

Contributor

I can also add that many users of Asciidoctor PDF are requesting a feature that depends on it. See asciidoctor/asciidoctor-pdf#56. I've hacked in some support for linking to sections, but references are not generally available atm.

Contributor

mojavelinux commented Dec 3, 2014

I can also add that many users of Asciidoctor PDF are requesting a feature that depends on it. See asciidoctor/asciidoctor-pdf#56. I've hacked in some support for linking to sections, but references are not generally available atm.

@practicingruby

This comment has been minimized.

Show comment Hide comment
@practicingruby

practicingruby Dec 3, 2014

Member

@mojavelinux:

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.

Member

practicingruby commented Dec 3, 2014

@mojavelinux:

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.

@mojavelinux

This comment has been minimized.

Show comment Hide comment
@mojavelinux

mojavelinux Dec 3, 2014

Contributor

Great! Thanks!

As I work on the feature, I'll let you know if any instincts about an API
emerge.

Contributor

mojavelinux commented Dec 3, 2014

Great! Thanks!

As I work on the feature, I'll let you know if any instincts about an API
emerge.

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