Skip to content

Commit

Permalink
asciidoc.conf: Automatically number unlabeled paragraphs
Browse files Browse the repository at this point in the history
For labeled paragraphs, e.g.:

  [[foo]]
  Foo bar baz...

the paragraph ID (pid) will be "foo".  For unlabeled paragraphs, e.g.:

  Foo bar baz...

the paragraph label will be _para-#.

The implementation is based on the FAQ entry [1], but I've shuffled
things around to get the _para-# support and a linkable pilcrow (a la
Purple Pilcrows [3]).  It would still be nice to have logic to only
show pilcrows on hover (although I'm not sure how that would work in
PDF output).

[1]: http://asciidoc.org/faq.html#_how_do_i_number_all_paragraphs
[2]: http://www.tbray.org/ongoing/When/200x/2004/05/31/PurpleAgain

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Nov 15, 2016
1 parent 8bc6ee3 commit c22a8dd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions asciidoc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# http://asciidoc.org/faq.html#_how_do_i_number_all_paragraphs

[paragraph]
{counter2:paracounter}
{set2:pid:{id?{id}}{id!_para-{paracounter}}}
{title#}<formalpara id="{pid}"{role? role="{role}"} xreflabel="¶"><title>{title}</title><para>
{title%}<simpara id="{pid}"{role? role="{role}"} xreflabel="¶">
|
{title%}<superscript><xref linkend="{pid}" /></superscript></simpara>
{title#}<superscript><xref linkend="{pid}" /></superscript></para></formalpara>
{empty}

0 comments on commit c22a8dd

Please sign in to comment.