Skip to content

Commit

Permalink
More Pandoc HTML fixes (#717)
Browse files Browse the repository at this point in the history
- Make html manpages build with old pandoc versions
- Add building of html docs to CMake
  • Loading branch information
ktmf01 authored Jul 4, 2024
1 parent b6b5b32 commit e14acb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,15 @@ if(INSTALL_MANPAGES)
OUTPUT man/metaflac.1
COMMAND pandoc --standalone --to man "${CMAKE_SOURCE_DIR}/man/metaflac.md" > man/metaflac.1
)
add_custom_target(man ALL DEPENDS man/flac.1 man/metaflac.1)
add_custom_command(
OUTPUT man/flac.html
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
)
add_custom_command(
OUTPUT man/metaflac.html
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
)
add_custom_target(man ALL DEPENDS man/flac.1 man/metaflac.1 man/flac.html man/metaflac.html)
install(FILES "${CMAKE_BINARY_DIR}/man/flac.1" "${CMAKE_BINARY_DIR}/man/metaflac.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
else()
if(EXISTS "${CMAKE_SOURCE_DIR}/man/flac.1" AND EXISTS "${CMAKE_SOURCE_DIR}/man/metaflac.1")
Expand Down
6 changes: 3 additions & 3 deletions man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ flac.1: flac.md

metaflac.1: metaflac.md
pandoc --standalone --to man $? > $@

flac.html: flac.md
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@
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 $? > $@

metaflac.html: metaflac.md
pandoc --standalone --to html --css style.css -B header.inc -A footer.inc --embed-resources $? > $@
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 $? > $@

man_MANS = flac.1 metaflac.1
doc_DATA = flac.html metaflac.html
Expand Down

0 comments on commit e14acb9

Please sign in to comment.