From c38c23dcab5d7e5e389ea5527301017571cfce24 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 25 Apr 2023 11:41:06 +0200 Subject: doc: Generate Ledger Python module documentation using pydoc when building web docs. --- doc/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 58034f63..ef93c293 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -170,7 +170,17 @@ if (BUILD_WEB_DOCS) VERBATIM) list(APPEND ledger_doc_files ledger.1.pdf) else() - message(FATAL_ERROR "Could not find man2html or groff. HTML version of man page cannot be built.") + message(WARNING "Could not find man2html or groff. HTML version of man page will not be built.") + endif() + + if (USE_PYTHON AND Python_EXECUTABLE) + add_custom_command(OUTPUT ledger.html + COMMAND ${CMAKE_COMMAND} -E env + PYTHONPATH=${CMAKE_BINARY_DIR} + ${Python_EXECUTABLE} -m pydoc -w ledger + DEPENDS ${CMAKE_BINARY_DIR}/${_ledger_python_module_name} + VERBATIM) + list(APPEND ledger_doc_files ledger.html) endif() endif(BUILD_WEB_DOCS) -- cgit v1.2.3