Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
I'm seeking a ':paralinks:' (paragraph links) attribute similar to ':sectlinks:' Does such a thing exist?
Motivation. Such a thing provides more-granular references to each paragraph in a document. Among other things, this enables excellent references for requirements-traceability projects. Here's an example paragraph link from the attached .html file (below). Details: I want it to do something similar to what's found in the the attached files (below), with one change: I want the link highlights to be "invisible" and the clickable link area to span all of the paragraph, rather than just the inserted '§'--and get rid of the '§'. Just like :sectlinks: does for section titles, but applied to each paragraph. This would all be generated automatically in Asciidoctor .html output by setting: :paralinks: 1 or some, similar construct. Workaround if no feature exists: If no automated feature/pre-processor/gizmo/etc (I'm not yet familiar with pre processors or other, detailed Asciidoctor features) currently exists, I plan to write a Python script to automatically add the following code to each paragraph in a Asciidoctor source file (as per the example files below): [id='101'] <<101,§>> Paragraph text... example_paralinks.txt example_paralinks.html |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
This feature is not provided out of the box...but of course, anything is possible :) There are a bunch of examples of extensions in the extension lab: https://github.com/asciidoctor/asciidoctor-extensions-lab/tree/master/lib Here's one that is pretty close to what you want to do: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/shell-session-treeprocessor/extension.rb You'd want to search for all paragraph blocks, which you can do using document.find_by :paragraph Then, you can add an autogenerated id to the paragraph and inject extra text in the beginning of the source text to create an anchor point. You may also need to weave in some extra CSS, which you can do with a DocinfoProcessor. To get this started, I recommend filing an issue for the idea in the extension lab repo. That sort of establishes the goal. Then, people in the community who are interested can jump in and help you formulate a solution. Cheers, -Dan On Fri, Jun 12, 2015 at 9:45 AM, hydrostarr [via Asciidoctor :: Discussion] <[hidden email]> wrote: I'm seeking a ':paralinks:' (paragraph links) attribute similar to ':sectlinks:' Does such a thing exist? ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
This post was updated on Jul 16, 2017; 2:51pm.
Thanks Dan.
Updates:
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
Here's my preferred path to solution, if asciidoctor team is unable: my team submits a patch to the "core" (of asciidoctor). I'm hoping that the same (hopefully simply) code lines/method that implements section links can be modularized to apply to all paragraphs. And therefore not a big change.
Questions: If we can do it, is it feasible on your (the asciidoctor's dev/admin team) end? Do y'all have automated testing mechanism(s) that I can employ to test these changes? (My team is not yet ruby savvy, but hoping that's not a big deal.) |
Free forum by Nabble | Edit this page |