diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2023-04-24 12:35:11 +0200 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2023-04-24 12:46:36 +0200 |
commit | 14b90d8d952b40e0a474223e7f74a1e6505d5450 (patch) | |
tree | 0bcfffd0c316c8a3469b39fa3a86b8034ae78319 /doc | |
parent | f67e2e64b243171112d1d835d015d72fa9886b42 (diff) | |
download | fork-ledger-14b90d8d952b40e0a474223e7f74a1e6505d5450.tar.gz fork-ledger-14b90d8d952b40e0a474223e7f74a1e6505d5450.tar.bz2 fork-ledger-14b90d8d952b40e0a474223e7f74a1e6505d5450.zip |
doc: Prefer mandoc over groff to generate ledger.1.html
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 6271bb95..9a4a728d 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -89,6 +89,7 @@ if (BUILD_DOCS) find_program(TEXI2PDF texi2pdf) find_program(TEX tex) find_program(MAN2HTML man2html) + find_program(MANDOC mandoc) find_program(GROFF groff) set(ledger_info_files ledger3.texi) @@ -147,9 +148,15 @@ if (BUILD_WEB_DOCS) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 VERBATIM) list(APPEND ledger_doc_files ledger.1.html) - elseif(GROFF) + elseif (MANDOC OR GROFF) + set(_cmd ${MANDOC}) + if (NOT _cmd) + # HTML produced by mandoc is much nicer looking, use groff only as a last resort. + message(WARNING "Using ${GROFF} to generate ledger1.html, as mandoc could not be found.") + set(_cmd ${GROFF}) + endif() add_custom_command(OUTPUT ledger.1.html - COMMAND ${BASH} -c "${GROFF} -mandoc -Thtml ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 > ledger.1.html" + COMMAND ${BASH} -c "${_cmd} -mandoc -Thtml ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 > ledger.1.html" DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 VERBATIM) list(APPEND ledger_doc_files ledger.1.html) |