Skip to content

Commit

Permalink
Replace deprecated pandoc --self-contained option
Browse files Browse the repository at this point in the history
"--embed-resources --standalone" is the recommended replacement. Fall
back to the deprecated option for old Pandoc versions that don't
support "--embed-resources".

Closes: #29
  • Loading branch information
airtower-luna committed Apr 27, 2024
1 parent 4281e28 commit 6e8737a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ pdflatex = find_program('pdflatex', required: false)
doc_style = files('style.css')[0]

if pandoc.found()
if pandoc_version.version_compare('>=2.19')
self_contained = ['--embed-resources', '--standalone']
else
# old Pandoc, use now deprecated option
self_contained = ['--self-contained']
endif

doc_meta = configure_file(input: 'mod_gnutls_manual.yaml.in',
output: 'mod_gnutls_manual.yaml',
configuration : conf_data)
Expand Down Expand Up @@ -31,7 +38,7 @@ if pandoc.found()
doc_style],
command : [
pandoc, '--css', '@INPUT2@',
'--toc', '--self-contained',
'--toc', self_contained,
'-f', 'markdown',
'-o', '@OUTPUT@',
'@INPUT0@', '@INPUT1@'],
Expand Down
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ apache2 = declare_dependency(
mod_dir = run_command(apxs, '-q', 'LIBEXECDIR', check: true).stdout().strip()

pandoc = find_program('pandoc', required: false)
if pandoc.found()
pandoc_version = run_command(
pandoc, '--version', check: true, capture: true).stdout().split()[1]
message('Found Pandoc version:', pandoc_version)
endif
httpd = find_program('apache2', 'httpd', dirs: ['/usr/sbin'], required: true)

incdir = include_directories('include')
Expand Down

0 comments on commit 6e8737a

Please sign in to comment.