From ee8ed80bf279247d94ca8021ebe065a76daf02c7 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 5 Sep 2024 00:24:09 +0200 Subject: docs: add urlmap to gi-docgen --- docs/default.nix | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'docs/default.nix') diff --git a/docs/default.nix b/docs/default.nix index 0940e42..8d362ce 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -16,8 +16,18 @@ mkdir -p $out/${outPath} gi-docgen generate -C ${data} ${output}/share/gir-1.0/${name}-0.1.gir cp -r ${name}-0.1/* $out/${outPath} + echo ${data} >> $out/data.txt ''; + urlMap = builtins.toJSON [ + ["GLib" "https://docs.gtk.org/glib/"] + ["GObject" "https://docs.gtk.org/gobject/"] + ["Gio" "https://docs.gtk.org/gio/"] + ["Gdk" "https://docs.gtk.org/gdk4/"] + ["Gtk" "https://docs.gtk.org/gtk4/"] + ["GdkPixbuf" "https://docs.gtk.org/gdk-pixbuf/"] + ]; + genLib = name: namespace: description: { authors ? "Aylur", dependencies ? {}, @@ -31,15 +41,19 @@ library = { inherit description authors; license = "LGPL-2.1"; - browse_url = "https://github.com/Aylur/Astal"; - repository_url = "https://github.com/Aylur/Aylur.git"; + browse_url = "https://github.com/aylur/astal"; + repository_url = "https://github.com/aylur/aylur.git"; website_url = "https://aylur.github.io/astal"; + dependencies = ["GObject-2.0"] ++ (builtins.attrNames dependencies); }; - dependencies = { - inherit (dependency) "GObject-2.0"; - inherit dependencies; + extra = { + urlmap_file = pkgs.writeText "urlmap" '' + baseURLs = ${urlMap} + ''; }; + + dependencies = dependencies // dependency; }; }; -- cgit v1.2.3