From 4d321cbe18ee462a1fa2d44d2c3b7d0ce79fb5d6 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 9 Apr 2023 07:58:12 +0200 Subject: doc: Fix generating api documentation by fixing path to source --- doc/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 08132224..1a510c1a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -23,14 +23,15 @@ if (USE_DOXYGEN) message(FATAL_ERROR "Could not find doxygen. Reference documentation cannot be built.") endif() - configure_file(Doxyfile.in Doxyfile @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile @ONLY) # see INPUT/FILE_PATTERNS in Doxyfile.in - file(GLOB doxygen_input_files ${CMAKE_SOURCE_DIR}/src/*.h) + file(GLOB doxygen_input_files ${CMAKE_CURRENT_SOURCE_DIR}/../src/*.h) add_custom_command(OUTPUT html/index.html - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile - DEPENDS Doxyfile ${doxygen_input_files} + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${doxygen_input_files} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building doxygen documentation") add_custom_target(doc.doxygen DEPENDS html/index.html) else() -- cgit v1.2.3 From 6e6b3eb6fe311975774bf9105ac52dfbe50d7148 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 9 Apr 2023 07:59:12 +0200 Subject: doc: Update required CMake version to match version required by project --- doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1a510c1a..1459bac7 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -5,7 +5,7 @@ ######################################################################## -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.16.2) project(ledger NONE) -- cgit v1.2.3 From 2bfe283b68dabfa6cfcbc3e46ab619a222354a6a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 9 Apr 2023 21:48:04 +0200 Subject: doc: Add support for extra css to api documentation --- doc/CMakeLists.txt | 7 ++++++- doc/Doxyfile.in | 2 +- doc/apidoc.css | 3 +++ flake.nix | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 doc/apidoc.css (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1459bac7..9f5745ea 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -9,6 +9,9 @@ cmake_minimum_required(VERSION 3.16.2) project(ledger NONE) +set(DOXYGEN_EXTRA_CSS CACHE STRING + "Path to extra css file added to the generated API documentation") + # Point CMake at any custom modules we may ship list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include(LedgerVersion) @@ -28,11 +31,13 @@ if (USE_DOXYGEN) # see INPUT/FILE_PATTERNS in Doxyfile.in file(GLOB doxygen_input_files ${CMAKE_CURRENT_SOURCE_DIR}/../src/*.h) - add_custom_command(OUTPUT html/index.html + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${doxygen_input_files} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building doxygen documentation") + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) add_custom_target(doc.doxygen DEPENDS html/index.html) else() add_custom_target(doc.doxygen) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 58683baa..a2691e4e 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -942,7 +942,7 @@ HTML_STYLESHEET = # robust against future updates. Doxygen will copy the style sheet file to # the output directory. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/apidoc.css @DOXYGEN_EXTRA_CSS@ # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note diff --git a/doc/apidoc.css b/doc/apidoc.css new file mode 100644 index 00000000..b180c415 --- /dev/null +++ b/doc/apidoc.css @@ -0,0 +1,3 @@ +/* Use this file to customize styling Ledger API Documentation of generated with doxygen */ + +img.footer { width: 50px } diff --git a/flake.nix b/flake.nix index cd71e66a..a992594b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "A double-entry accounting system with a command-line reporting interface"; nixConfig.bash-prompt = "ledger$ "; + outputs = { self, nixpkgs }: let usePython = true; gpgmeSupport = true; -- cgit v1.2.3 From 0c7149bd2ba1b459af35507b8332439554f02c5a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 11 Apr 2023 16:59:10 +0200 Subject: doc: Add support for extra html header for api documentation --- doc/CMakeLists.txt | 2 ++ doc/Doxyfile.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/CMakeLists.txt') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9f5745ea..4fcdeb9b 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -11,6 +11,8 @@ project(ledger NONE) set(DOXYGEN_EXTRA_CSS CACHE STRING "Path to extra css file added to the generated API documentation") +set(DOXYGEN_HTML_HEADER CACHE STRING + "Path to html file used as the generated API documentation header") # Point CMake at any custom modules we may ship list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index f81e4130..55508319 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1246,7 +1246,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = @DOXYGEN_HTML_HEADER@ # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard -- cgit v1.2.3