dhall: Use --base-import-url flag for documentation (#128588)

This updates `pkgs.dhallPackages.buildDhallGitHubPackage` to use the
newly added `--base-import-url` `dhall-docs` flag. This flag is used
by the generated documentation so that paths copied to the clipboard
represent complete URLs that can be imported instead of only the
relative path to the import.

authored by Gabriel Gonzalez and committed by GitHub ef0a4234 c865d036

+19 -4
+6 -3
pkgs/development/interpreters/dhall/build-dhall-github-package.nix
··· 43 "rev" 44 ]); 45 46 - prefix = lib.optionalString (directory != "") "${directory}/"; 47 48 in 49 buildDhallPackage ··· 51 52 name = versionedName; 53 54 - code = "${src}/${prefix}${file}"; 55 } 56 // lib.optionalAttrs document 57 - { documentationRoot = "${src}/${prefix}"; } 58 ) 59 )
··· 43 "rev" 44 ]); 45 46 + prefix = lib.optionalString (directory != "") "/${directory}"; 47 48 in 49 buildDhallPackage ··· 51 52 name = versionedName; 53 54 + code = "${src}${prefix}/${file}"; 55 } 56 // lib.optionalAttrs document 57 + { documentationRoot = "${src}/${prefix}"; 58 + 59 + baseImportUrl = "https://raw.githubusercontent.com/${owner}/${repo}/${rev}${prefix}"; 60 + } 61 ) 62 )
+13 -1
pkgs/development/interpreters/dhall/build-dhall-package.nix
··· 37 # 38 # If `null`, then no documentation is generated. 39 , documentationRoot ? null 40 }: 41 42 let ··· 85 ${lib.optionalString (documentationRoot != null) '' 86 mkdir -p $out/${dataDhall} 87 88 - XDG_DATA_HOME=$out/${data} ${dhall-docs}/bin/dhall-docs --input '${documentationRoot}' --package-name '${name}' --output-link $out/docs 89 ''} 90 ''
··· 37 # 38 # If `null`, then no documentation is generated. 39 , documentationRoot ? null 40 + 41 + # Base URL prepended to paths copied to the clipboard 42 + # 43 + # This is used in conjunction with `documentationRoot`, and is unused if 44 + # `documentationRoot` is `null`. 45 + , baseImportUrl ? null 46 }: 47 48 let ··· 91 ${lib.optionalString (documentationRoot != null) '' 92 mkdir -p $out/${dataDhall} 93 94 + XDG_DATA_HOME=$out/${data} ${dhall-docs}/bin/dhall-docs --output-link $out/docs ${lib.cli.toGNUCommandLineShell { } { 95 + base-import-url = baseImportUrl; 96 + 97 + input = documentationRoot; 98 + 99 + package-name = name; 100 + }} 101 ''} 102 ''