feat(quiver): reposition URL comment in latex export

This commit is contained in:
2026-01-09 09:16:51 -07:00
parent ef695a7766
commit 72a39a80ae
3 changed files with 35 additions and 4 deletions

6
flake.lock generated
View File

@@ -800,11 +800,11 @@
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1766962538,
"narHash": "sha256-313iDCii/tKr3UCPxCP2uzeH93Qk1cWbyrbU82dlF9Y=",
"lastModified": 1767975357,
"narHash": "sha256-MDVh3/aVhkD1bh/r8c0gs9DL4e78CrUbUxOZHWlCwLM=",
"owner": "msyds",
"repo": "sydpkgs",
"rev": "7a3eaf67885e23b7596bd1b91100e6f71d3bb985",
"rev": "233479ab277d47b1dbda202eafca50e61c659151",
"type": "github"
},
"original": {

View File

@@ -4,12 +4,17 @@ let cfg = config.sydnix.deertopia.quiver;
in {
options.sydnix.deertopia.quiver = {
enable = lib.mkEnableOption "Quiver, a commutative diagram editor";
package = lib.mkPackageOption sydpkgs.packages.${system} "quiver" {};
};
config = lib.mkIf cfg.enable {
sydnix.deertopia.nginx.vhosts."q".vhost =
let
package = sydpkgs.packages.${system}.quiver;
package = cfg.package.overrideAttrs (finalAttrs: prevAttrs: {
patches = (prevAttrs.patches or []) ++ [
./quiver/move-export-url.patch
];
});
in {
forceSSL = true;
enableACME = true;

View File

@@ -0,0 +1,26 @@
diff --git a/src/quiver.mjs b/src/quiver.mjs
index 4c303d9a4a..59fc5c637c 100644
--- a/src/quiver.mjs
+++ b/src/quiver.mjs
@@ -610,7 +610,9 @@
// `tikzcd` environment.
let tikzcd = `\\begin{tikzcd}${
diagram_options.length > 0 ? `[${diagram_options.join(",")}]` : ""
- }\n${
+ }\n% ${
+ QuiverImportExport.base64.export(quiver, settings, options, definitions).data
+ }\n${
output.length > 0 ? `${
output.split("\n").map(line => `\t${line}`).join("\n")
}\n` : ""
@@ -622,9 +624,7 @@
tikzcd = `\\documentclass[tikz]{standalone}\n\\usepackage{quiver}\n\\begin{document}\n${tikzcd}\n\\end{document}`;
}
// URL.
- return `% ${
- QuiverImportExport.base64.export(quiver, settings, options, definitions).data
- }\n${tikzcd}`;
+ return tikzcd;
};
// Early exit for empty quivers.