From 0f8abfb2d48497e804d87e6e47a41c70e728901a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 7 May 2024 22:02:54 +0200 Subject: docs: Setting up doc generation --- docs/.nix/derivation.nix | 37 +++++++++++++++++++++++++++++++++++++ docs/Doxygen.in | 6 +++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 docs/.nix/derivation.nix (limited to 'docs') diff --git a/docs/.nix/derivation.nix b/docs/.nix/derivation.nix new file mode 100644 index 0000000..9780f52 --- /dev/null +++ b/docs/.nix/derivation.nix @@ -0,0 +1,37 @@ +{ lib +, stdenvNoCC +, python3 +, python3Packages +, doxygen +, gasp +, version +}: + +stdenvNoCC.mkDerivation { + pname = "forstio-docs"; + inherit version; + + src = ../../.; + + nativeBuildInputs = [ + python3 + python3Packages.sphinx + python3Packages.sphinx-rtd-theme + doxygen + gasp + ]; + + buildPhase = '' + # C++ API generation + doxygen docs/Doxygen.in + python3 ${gasp.outPath}/bin/gasp.py xml --namespace duke > cpp_map.json + # C++ and C template generation + python3 ${gasp.outPath}/bin/make_rst.py --title="C++" -t ${gasp.outPath}/templates/rst -m cpp_map.json -o source/cpp_api + make html + ''; + + installPhase = '' + mkdir -p $out + mv build/html $out/html + ''; +} diff --git a/docs/Doxygen.in b/docs/Doxygen.in index 0ea6e2b..d9005ba 100644 --- a/docs/Doxygen.in +++ b/docs/Doxygen.in @@ -1,5 +1,5 @@ GENERATE_XML = YES PROJECT_NAME = forstio -RECURSIVE = YES -FILE_PATTERNS = *.cpp *.h -INPUT = ../c++ +RECURSIVE = YES +FILE_PATTERNS = *.cpp *.hpp +INPUT = modules -- cgit v1.2.3