Skip to content

Commit e14acb9

Browse files
authored
More Pandoc HTML fixes (#717)
- Make html manpages build with old pandoc versions - Add building of html docs to CMake
1 parent b6b5b32 commit e14acb9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,15 @@ if(INSTALL_MANPAGES)
300300
OUTPUT man/metaflac.1
301301
COMMAND pandoc --standalone --to man "${CMAKE_SOURCE_DIR}/man/metaflac.md" > man/metaflac.1
302302
)
303-
add_custom_target(man ALL DEPENDS man/flac.1 man/metaflac.1)
303+
add_custom_command(
304+
OUTPUT man/flac.html
305+
COMMAND pandoc --standalone --embed-resources --to html "${CMAKE_SOURCE_DIR}/man/flac.md" > man/flac.html || pandoc --self-contained --to html "${CMAKE_SOURCE_DIR}/man/flac.md" > man/flac.html
306+
)
307+
add_custom_command(
308+
OUTPUT man/metaflac.html
309+
COMMAND pandoc --standalone --embed-resources --to html "${CMAKE_SOURCE_DIR}/man/metaflac.md" > man/metaflac.html || pandoc --self-contained --to html "${CMAKE_SOURCE_DIR}/man/metaflac.md" > man/metaflac.html
310+
)
311+
add_custom_target(man ALL DEPENDS man/flac.1 man/metaflac.1 man/flac.html man/metaflac.html)
304312
install(FILES "${CMAKE_BINARY_DIR}/man/flac.1" "${CMAKE_BINARY_DIR}/man/metaflac.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
305313
else()
306314
if(EXISTS "${CMAKE_SOURCE_DIR}/man/flac.1" AND EXISTS "${CMAKE_SOURCE_DIR}/man/metaflac.1")

man/Makefile.am

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ flac.1: flac.md
2222

2323
metaflac.1: metaflac.md
2424
pandoc --standalone --to man $? > $@
25-
25+
2626
flac.html: flac.md
27-
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@
27+
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@ || pandoc --self-contained --to html --css style.css -B header.inc -A footer.inc $? > $@
2828

2929
metaflac.html: metaflac.md
30-
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@
30+
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@ || pandoc --self-contained --to html --css style.css -B header.inc -A footer.inc $? > $@
3131

3232
man_MANS = flac.1 metaflac.1
3333
doc_DATA = flac.html metaflac.html

0 commit comments

Comments
 (0)