Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 638212 - app-text/asciidoc-8.6.9-r2 source highlighting doesn't work
Summary: app-text/asciidoc-8.6.9-r2 source highlighting doesn't work
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marc Joliet
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-20 11:00 UTC by Jaak Ristioja
Modified: 2017-11-22 21:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaak Ristioja 2017-11-20 11:00:41 UTC
$ cat test
== Sample

[source,sh]
----
echo 'Hello, World!'
----
$ asciidoc test
/bin/sh: source-highlight: command not found
asciidoc: WARNING: test: line 5: filter non-zero exit code: source-highlight -f xhtml -s sh: returned 127
asciidoc: WARNING: test: line 5: no output from filter: source-highlight -f xhtml -s sh

app-text/asciidoc-8.6.9-r2::gentoo  USE="highlight -examples -graphviz {-test}" PYTHON_SINGLE_TARGET="python2_7 (-pypy)" PYTHON_TARGETS="python2_7 (-pypy)"

dev-util/source-highlight is not installed. dev-python/pygments is version 2.1.1. app-text/highlight is version 3.17.

# emerge --info
Portage 2.3.13 (python 3.4.5-final-0, hardened/linux/amd64/no-multilib, gcc-6.4.0, glibc-2.26-r3, 4.14.0-gentoo x86_64)
=================================================================
System uname: Linux-4.14.0-gentoo-x86_64-*-with-gentoo-2.4.1
KiB Mem:    16305600 total,   5739800 free
KiB Swap:   16777212 total,  16775676 free
Timestamp of repository gentoo: Mon, 20 Nov 2017 00:45:01 +0000

sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.5::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.8::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo, 2.28-r2::gentoo, 2.28.1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0-r3::gentoo, 6.2.0-r1::gentoo, 6.4.0::gentoo, 7.1.0-r1::gentoo, 7.2.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r3::gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -ggdb"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="-O2 -pipe -march=native -ggdb"
DISTDIR="/var/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="64bit X a52 aac acl acpi alsa amd64 amr aspell avx avx2 bash-completion bidi boost brightness-control bzip2 cairo canberra caps cdda cdr cli color-management colord cpudetection cracklib crypt cups custom-optimization cxx dbus doc double-precision dri dvd dvdr dvdread eds egl eglfs elogind emboss enca encode evdev evo exif faac faad fam fbcon ffmpeg fftw firefox flac fluidsynth fontconfig fontforge gcrypt gif git glitz gmp gnat_2017 gnuplot gnutls gpg gphoto2 gpm gtk gtk3 handbook hardened hdri htmlhandbook iconv icu id3tag idn imagemagick introspection ipv6 jpeg justify kate kde kontact kpathsea ladspa lapack laptop latex lcms libnotify lua lz4 lzma lzo mad mailwrapper matroska md5sum midi mikmod mmap mms mmx mng modplug modules mp3 mp4 mpeg mudflap ncurses nptl nptlonly ogg openal openexr opengl openh264 opus otr pcre pdf pic pie plasma png policykit postscript ppds projectm pulseaudio qalculate raw readline reflection rrdtool rtmp scanner schroedinger sdl sdl2 seccomp session smp sndfile source speex spell spl sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssp ssse3 startup-notification subversion svg sysfs system-sqlite tbb tcpd theora threads tiff truetype ucs2 udev unicode urandom usb v4l v4l2 vaapi valgrind vc vdpau vorbis vpx webp wifi wmf x264 xattr xcb xcomposite xetex xft xinerama xorg xosd xprint xscreensaver xtpax xulrunner xv xvid zlib" ABI_X86="64" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 popcnt sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" KERNEL="linux" L10N="en et et-EE" LINGUAS="en et et_EE" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" USERLAND="GNU"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Maybe related to #552148
Comment 1 Hadrien Lacour 2017-11-20 11:50:56 UTC
The issue is more complex. The highlighter installed by Gentoo is pygments so you should have `source-highlighter=pygments` in ~/.asciidoc/asciidoc.conf BUT it doesn't work (it is read, but the directive is ignored). Using `asciidoc -a source-highlighter=pygments` works though.
Comment 2 Marc Joliet 2017-11-22 21:41:02 UTC
(In reply to Hadrien Lacour from comment #1)
> The issue is more complex. The highlighter installed by Gentoo is pygments
> so you should have `source-highlighter=pygments` in
> ~/.asciidoc/asciidoc.conf BUT it doesn't work (it is read, but the directive
> is ignored). Using `asciidoc -a source-highlighter=pygments` works though.

Your configuration file is wrong.  In the asciidoc.conf you also need the appropriate section heading (it's INI-style), like so:

    [attributes]
    source-highlighter=pygments

Alternatively, you can add the attribute to your asciidoc source file, but then you need to use the correct title level, so the following also works:

    = Sample
    :source-highlighter: pygments
    
    [source,sh]
    ----
    echo 'Hello, World!'
    ----

At this point I would like to mention that asciidoc upstream appears to now recommend using asciidoctor instead, so maybe give that a try.  They haven't bothered to update the homepage (yet, I hope), refer to https://github.com/asciidoc/asciidoc/releases/tag/8.6.10 instead.

(I'd also like to point out that I had actually forgotten all this, I had to look it up in the documentation myself. Hint, hint ;-) .)