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

Cross references don't work when target is a block #110

Closed
mojavelinux opened this issue May 11, 2015 · 2 comments
Closed

Cross references don't work when target is a block #110

mojavelinux opened this issue May 11, 2015 · 2 comments
Assignees

Comments

@mojavelinux
Copy link
Member

Cross references don't work when the target is a block. To reproduce, assign an id to a block.

.Pretty picture
[#pretty-picture]
image::pretty-picture.png[Pretty Picture,600,400]

Then link to that block.

See the <<pretty-picture>>.

A link is created, but when you click on it, it does not work.

@mojavelinux mojavelinux added this to the v1.5.0 milestone May 11, 2015
@mojavelinux mojavelinux self-assigned this May 11, 2015
@mojavelinux
Copy link
Member Author

We need to create destinations for every referencable block (i.e., a block with an id).

Here's the code that is needed. Perhaps we can wrap it into a utility method, create_destination.

if node.id
  dest_y = at_page_top? ? page_height : y
  add_dest node.id, (node_dest = (dest_xyz 0, dest_y))
  # optionally store this destination on the node so we can access it later
  #node.set_attr 'destination', node_dest
end

@mojavelinux
Copy link
Member Author

This is a duplicate of #83.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 18, 2015
- introduce add_dest_for_block for adding xref targets (i.e, destinations)
- call add_dest_for_block in each block handler
- add support in parser for <a name> to set inline destinations
- handle render_behind callback to add inline destinations
- enable inline ref and bibref targets
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 18, 2015
- introduce add_dest_for_block for adding xref targets (i.e, destinations)
- call add_dest_for_block in each block handler
- add support in parser for <a name> to set inline destinations
- handle render_behind callback to add inline destinations
- enable inline ref and bibref targets
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 25, 2015
- introduce add_dest_for_block for adding xref targets (i.e, destinations)
- call add_dest_for_block in each block handler
- add support in parser for <a name> to set inline destinations
- handle render_behind callback to add inline destinations
- enable inline ref and bibref targets
- use pdf-destination as attribute name to hold PDF destination
mojavelinux added a commit that referenced this issue May 25, 2015
resolves #110 fix xrefs to non-section content
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