tajmone / ST4-Asciidoctor

AsciiDoc Package for SublimeText 4
https://tajmone.github.io/ST4-Asciidoctor
MIT License
11 stars 6 forks source link

Command to Externalize In-Line Footnotes #15

Open polyglot-jones opened 3 years ago

polyglot-jones commented 3 years ago

Add a command to convert all inline footnotes to externalized footnotes, by way of AsciiDoc attributes.

Some text.footnote:[Some note.]

becomes:

Some text.{fn1}

with this is added to the top of the file:

:fn1: footnote:[Some note.]

The new attribute name will be :fnNN: where NN is whatever number is the highest existing footnote number plus one. Just in case the author has a habit of moving the exterized footnotes to a separate include file, we'll scan for all references ({fnNN}) to determine the highest number, not just definitions (:fnNN:)

Newly assigned numbers will not be zero-padded, even if the existing number(s) are.