summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-05-07 22:02:54 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-05-07 22:02:54 +0200
commit0f8abfb2d48497e804d87e6e47a41c70e728901a (patch)
tree2bc49f336f0e4e2329ef5760295cb1952871d472
parentcd2a1ee7429c85b942229b6c91040aeccb02b571 (diff)
docs: Setting up doc generation
-rw-r--r--default.nix12
-rw-r--r--docs/.nix/derivation.nix37
-rw-r--r--docs/Doxygen.in6
3 files changed, 51 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index 4315710..7abf030 100644
--- a/default.nix
+++ b/default.nix
@@ -1,6 +1,11 @@
{ pkgs ? import <nixpkgs> {}
, stdenv ? pkgs.llvmPackages_17.stdenv
, clang-tools ? pkgs.clang-tools_17
+, gasp ? (import ((builtins.fetchGit {
+ url = "git@git.keldu.de:apps/gasp";
+ ref = "master";
+ }).outPath + "/default.nix"){
+ }).gasp
}:
let
@@ -81,7 +86,12 @@ in rec {
inherit clang-tools;
build_examples = "true";
- };
+ };
+
+ docs = pkgs.callPackage docs/.nix/derivation.nix {
+ inherit version;
+ inherit gasp;
+ };
};
stable = pkgs.symlinkJoin {
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