Edward
Edward

Reputation: 4631

How to resemble the PDF-output of AsciidocFX using a Gradle build-script?

I have the following Asciidoc-document:

= Test
:doctype: article
:notitle:
:!toc:

AsciidocFX shows links in PDFs as footnotes http://stackoverflow.com[SO].

.Asciidoc in PDF does not work in Asciidoctor, but works in AsciidocFX.
[cols="2,5a"]
|===
|Line with Asciidoc code
|here comes a list:

* item 1
* item 2
* item 3

http://stackoverflow.com[Get Answers]!

|Line
|with a footnotefootnote:[footnotes do work in AsciidocFX's PDF output (but not in the preview).]

|===

When generating a PDF using asciidoctor, the output is as follows:

Output by asciidoctor

The problems are:

Using https://github.com/asciidocfx/AsciidocFX shows everything correctly:

Output of AsciidocFX

Now, I'd like to have the same output that AsciidocFX produces, but still like to use my Gradle build-script.

From https://github.com/asciidoctor/asciidoctor-pdf/issues/73#issuecomment-224327058 I learned, that AsciidoctorFX uses https://github.com/asciidoctor/asciidoctor-fopub[asciidoctor-fopub] under the hood. But how can I this pipeline in my build.gradle. Do I have to generate epub in a first task and use the output in another task? Or is there a direkt way?

Upvotes: 4

Views: 682

Answers (1)

Coventure Joe
Coventure Joe

Reputation: 149

Sorry that I am a tad late (almost 7 years!!) to answer your question, but perhaps it will help others.

Perhaps you need to upgrade. When I run your .adoc verbatim, the foootnotes come out perfectly. In fact the output is exactly as you posted correct version of output. Here is the syntax that I use:

asciidoctor-pdf -a pdf-themesdir=/path/to/themes -a pdf-theme=your-pdf-theme-file.yml -a pdf-fontsdir=/path/to/your/fonts/directory/ your_test_file.adoc

I put this syntax in a bash script with the adoc file as an argument.

I am using:

  • linux Pop!_OS 22.04 LTS (close derivative of ubuntu)
  • ruby 3.1.2p20
  • asciidoctor-pdf-2.3.0b

Ironically, I am amazed with is your AsciidoctorFX output. AsciidoctorFX pdf output looks horrible for me and there is no simple way of changing the output style, like editing the asciidoctor-pdf yaml.

Cheers, Joe

Upvotes: 0

Related Questions