Skip to content

Commit ad15926

Browse files
committed
asciidoc.conf: Automatically number unlabeled paragraphs
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
1 parent 279806c commit ad15926

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

asciidoc.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# http://asciidoc.org/faq.html#_how_do_i_number_all_paragraphs
2+
3+
[paragraph]
4+
{counter2:paracounter}
5+
{set2:pid:{id?{id}}{id!_para-{paracounter}}}
6+
{title#}<formalpara id="{pid}"{role? role="{role}"} xreflabel="¶"><title>{title}</title><para>
7+
{title%}<simpara id="{pid}"{role? role="{role}"} xreflabel="¶">
8+
|
9+
{title%}<superscript><xref linkend="{pid}" /></superscript></simpara>
10+
{title#}<superscript><xref linkend="{pid}" /></superscript></para></formalpara>
11+
{empty}

0 commit comments

Comments
 (0)