Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Asciidoctor PDF generation

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Fri, 18 May 2018 08:54:18 -0700
On 5/17/18 11:55 PM, Jaap Keuter wrote:
> Hi list,
> 
> Working on a Debian testing system, the packagers have come so far as to package the recent update to Asciidoctor. This allows to generate the Wireshark documentation (WSUG/WSDG) with the proper layout. One stage is PDF generation, which requires an additional backend, being asciidoctor-pdf. This, not being in the Debian repository, is to be installed though gem, which works perfectly fine. 
> 
> Still, for this to work with the Wireshark documentation generation (PDF versions of it) there needs to be an additional option to the asciidoctor command line, otherwise it will not be aware of the PDF backend and fail. The addition is to the cmake/modules/FindAsciidoctor.cmake file, to the macro ASCIIDOCTOR2PDF. In there the parameter ‘--require asciidoctor-pdf’ needs to be added. 
> 
> Before pushing a change, I wanted to confirm that this additional parameter would not interfere with other doc build setups. Can you ‘Asciidoctor-J’ people out there confirm?
> 
> --- /tmp/5T9mK4_FindAsciidoctor.cmake
> +++ src/wireshark/wsug_mate/cmake/modules/FindAsciidoctor.cmake
> @@ -127,6 +127,7 @@
>                  ${_output_pdf}
>              COMMAND ${_asciidoctor_common_command}
>                  --backend pdf
> +                --require asciidoctor-pdf
>                  ${_asciidoctor_common_args}
>                  --out-file ${_output_pdf}
>                  ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}

`asciidoctorj --backend pdf --require asciidoctor-pdf` works fine for me here. We should probably make the PDF targets depend on AsciidoctorJ or asciidoctor-pdf as discussed in https://code.wireshark.org/review/#/c/26129/ .