Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #274078 > unrolled thread

asciidoctor-pdf

Started byTom Browder <tom.browder@gmail.com>
First post2024-10-26 17:10 +0200
Last post2024-10-26 23:40 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  asciidoctor-pdf Tom Browder <tom.browder@gmail.com> - 2024-10-26 17:10 +0200
    Re: asciidoctor-pdf <tomas@tuxteam.de> - 2024-10-26 18:10 +0200
      Re: asciidoctor-pdf Tom Browder <tom.browder@gmail.com> - 2024-10-26 22:30 +0200
    Re: asciidoctor-pdf Jeffrey Walton <noloader@gmail.com> - 2024-10-26 23:30 +0200
    Re: asciidoctor-pdf Jeffrey Walton <noloader@gmail.com> - 2024-10-26 23:40 +0200

#274078 — asciidoctor-pdf

FromTom Browder <tom.browder@gmail.com>
Date2024-10-26 17:10 +0200
Subjectasciidoctor-pdf
Message-ID<JBQAp-4mZJ-7@gated-at.bofh.it>
I am running Debian 11 and trying to run asciidoctor and
asciidoctor-pdf with no luck so far.

I run it with this bash script:

asciidoctor -r asciidoctor-pdf -b pdf \
  -a pdf-theme=binder \
  -a pdf-themesdir=./data/themes \
  -a document_name=”Raku Guide” \
  -o rakuguide-binder.pdf rakuguide-binder.adoc

and get this error:

Traceback (most recent call last):
9: from /usr/bin/asciidoctor-pdf:21:in `<main>'
8: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:193:in `parse!'
7: from /usr/lib/ruby/2.7.0/optparse.rb:1691:in `parse!'
6: from /usr/lib/ruby/2.7.0/optparse.rb:1666:in `permute!'
5: from /usr/lib/ruby/2.7.0/optparse.rb:1569:in `order!'
4: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `parse_in_order'
3: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `catch'
2: from /usr/lib/ruby/2.7.0/optparse.rb:1621:in `block in parse_in_order'
1: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in
`block (2 levels) in parse!'
/usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in `encode':
"\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

I have asked for help from the asciidoctor community but no response so far.

Anyone here running asciidoctor have any suggestions?

Thanks.

-Tom

[toc] | [next] | [standalone]


#274080

From<tomas@tuxteam.de>
Date2024-10-26 18:10 +0200
Message-ID<JBRwt-4ny3-3@gated-at.bofh.it>
In reply to#274078

[Multipart message — attachments visible in raw view] — view raw

On Sat, Oct 26, 2024 at 10:06:10AM -0500, Tom Browder wrote:
> I am running Debian 11 and trying to run asciidoctor and
> asciidoctor-pdf with no luck so far.

[...]

> `block (2 levels) in parse!'
> /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in `encode':
> "\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

This looks a bit as if the thing were receiving a character encoding it
doesn't expect.

FWIW, hex E2 would be "â" in Latin-1 (ISO-8859-1, more precisely). I
don't know which kind of input asciidoctor needs (beyond ASCII, that
is).

What you can do is

 - find out whether it's specific characters in your input
  which trigger the problem

 - experiment with iconv (e.g. iconv -f ISO-8859-1 -t UTF-8 < from > to)

Perhaps there's an option to asciidoctor to tell it what your file's
enccding is supposed to be.

Perhaps, also, your file is UTF-8 and asciidoctor guesses so,but there
are some "bad" sequences strewn in.

HTH
-- 
tomás

[toc] | [prev] | [next] | [standalone]


#274083

FromTom Browder <tom.browder@gmail.com>
Date2024-10-26 22:30 +0200
Message-ID<JBVA5-4pV1-5@gated-at.bofh.it>
In reply to#274080

[Multipart message — attachments visible in raw view] — view raw

On Sat, Oct 26, 2024 at 11:05 <tomas@tuxteam.de> wrote:

> On Sat, Oct 26, 2024 at 10:06:10AM -0500, Tom Browder wrote:
> > I am running Debian 11 and trying to run asciidoctor and
> > asciidoctor-pdf with no luck so far.
>
> [...]
>
> > `block (2 levels) in parse!'
> > /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in `encode':
> > "\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
>
> This looks a bit as if the thing were receiving a character encoding it
> doesn't expect.


Tomas, you’re right. I’ll check their docs some more. They do mention
encoding, but I thought my defaults would take care  of it.

Thank you very much.

Please, no more responses until I get time to work on this. I’ll report
back in a few days.

Cheers!

-Tom

[toc] | [prev] | [next] | [standalone]


#274084

FromJeffrey Walton <noloader@gmail.com>
Date2024-10-26 23:30 +0200
Message-ID<JBWw9-4qtx-1@gated-at.bofh.it>
In reply to#274078
On Sat, Oct 26, 2024 at 2:13 PM Tom Browder <tom.browder@gmail.com> wrote:
>
> I am running Debian 11 and trying to run asciidoctor and
> asciidoctor-pdf with no luck so far.
>
> I run it with this bash script:
>
> asciidoctor -r asciidoctor-pdf -b pdf \
>   -a pdf-theme=binder \
>   -a pdf-themesdir=./data/themes \
>   -a document_name=”Raku Guide” \
>   -o rakuguide-binder.pdf rakuguide-binder.adoc
>
> and get this error:
>
> Traceback (most recent call last):
> 9: from /usr/bin/asciidoctor-pdf:21:in `<main>'
> 8: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:193:in `parse!'
> 7: from /usr/lib/ruby/2.7.0/optparse.rb:1691:in `parse!'
> 6: from /usr/lib/ruby/2.7.0/optparse.rb:1666:in `permute!'
> 5: from /usr/lib/ruby/2.7.0/optparse.rb:1569:in `order!'
> 4: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `parse_in_order'
> 3: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `catch'
> 2: from /usr/lib/ruby/2.7.0/optparse.rb:1621:in `block in parse_in_order'
> 1: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in
> `block (2 levels) in parse!'
> /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in `encode':
> "\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
>
> I have asked for help from the asciidoctor community but no response so far.
>
> Anyone here running asciidoctor have any suggestions?

In your case, I suggest making sure the pdf conforms to the pdf spec.
Try running qpdf on the pdf file:

    qpdf --check <pdf file>

Jeff

[toc] | [prev] | [next] | [standalone]


#274085

FromJeffrey Walton <noloader@gmail.com>
Date2024-10-26 23:40 +0200
Message-ID<JBWFP-4qxe-13@gated-at.bofh.it>
In reply to#274078
On Sat, Oct 26, 2024 at 2:13 PM Tom Browder <tom.browder@gmail.com> wrote:
>
> I am running Debian 11 and trying to run asciidoctor and
> asciidoctor-pdf with no luck so far.
>
> I run it with this bash script:
>
> asciidoctor -r asciidoctor-pdf -b pdf \
>   -a pdf-theme=binder \
>   -a pdf-themesdir=./data/themes \
>   -a document_name=”Raku Guide” \
>   -o rakuguide-binder.pdf rakuguide-binder.adoc
>
> and get this error:
>
> Traceback (most recent call last):
> 9: from /usr/bin/asciidoctor-pdf:21:in `<main>'
> 8: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:193:in `parse!'
> 7: from /usr/lib/ruby/2.7.0/optparse.rb:1691:in `parse!'
> 6: from /usr/lib/ruby/2.7.0/optparse.rb:1666:in `permute!'
> 5: from /usr/lib/ruby/2.7.0/optparse.rb:1569:in `order!'
> 4: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `parse_in_order'
> 3: from /usr/lib/ruby/2.7.0/optparse.rb:1575:in `catch'
> 2: from /usr/lib/ruby/2.7.0/optparse.rb:1621:in `block in parse_in_order'
> 1: from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in
> `block (2 levels) in parse!'
> /usr/lib/ruby/vendor_ruby/asciidoctor/cli/options.rb:87:in `encode':
> "\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
>
> I have asked for help from the asciidoctor community but no response so far.
>
> Anyone here running asciidoctor have any suggestions?

And one more comment. According to <https://asciidoctor.org/>:

<SNIP>

If you’re using a non-English Windows environment, you may bump into
an Encoding::UndefinedConversionError when invoking Asciidoctor. To
solve this issue, we recommend overriding the default external and
internal character encodings to utf-8. You can do so by setting the
RUBYOPT environment variable as follows:

    RUBYOPT="-E utf-8:utf-8"

Once you make this change, all your Unicode headaches should be behind you.

If you’re using an IDE like Eclipse, make sure you set the encoding to
UTF-8 there as well. Asciidoctor is optimized to work with UTF-8 as
the default encoding.
</SNIP>

Jeff

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web