Closed somasis closed 4 years ago
I really wish this functionality were bundled with asciidoctor rather than being an extension
Ideally, this macro would be available as a formal extension that you can install. I would support the effort to graduate it to a dedicated gem. This is intended to be a lab, so nothing here should be used in production.
The proposal to add a built-in man macro only available when doctype is manpage seems reasonable.
As for the output produced, the problem seems to be that the extension is not compatible with Asciidoctor 2. It should be returning an Inline object, not a string. Returning a string is deprecated.
However, Asciidoctor 2 still allows the extension to return a string. It just issues an info message in verbose mode. The reason the extension stopped working is because Asciidoctor 2 uses additional intermediate markup for formatted text to prevent it from being improperly escaped. This is why the extension should return an object instead of a string.
Fixed.
Thank you :)
With asciidoctor 2.0.10, when generating with the
manpage
backend, the incorrect output is generated.Looking at the generated roff output, it seems that the backslashes are being escaped rather than being passed directly through.
After some discussion in the Gitter, it seems that the problem is indeed that. The
INFO
message indicates that an Inline node should be returned, not a String.@djencks suggested the following change, which does indeed produce the expected
See \fBgittutorial\fP(7) to get started.
output.(unrelated, but I really wish this functionality were bundled with asciidoctor rather than being an extension, it'd be so effortless to distribute good HTML and manpage documentation with it being included.)