From da894f6e1303e9fc1cb7cd1326ce1ba44e8fd51e Mon Sep 17 00:00:00 2001 From: Alex David Date: Thu, 2 Apr 2026 12:15:32 -0700 Subject: [PATCH] Move source link on docs website --- website/flake.nix | 7 ++++--- website/static-docs/extra.css | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 website/static-docs/extra.css diff --git a/website/flake.nix b/website/flake.nix index c98a4d8..7709709 100644 --- a/website/flake.nix +++ b/website/flake.nix @@ -10,7 +10,7 @@ lib = pkgs.lib; repo = rec { - rev = if self ? rev then self.rev else lib.warn "Repo is dirty, links will not work!" "???"; + rev = if self ? rev then self.rev else lib.warn "Repo is dirty, links point to main!" "main"; shortRev = lib.substring 0 8 rev; urls = { base = "https://git.sr.ht/~alexdavid/jail.nix"; @@ -34,9 +34,9 @@ in '' ### ${name} - **${name} :: ${combinatorObj.sig}** + Source - [Source](${repo.urls.file file attrPos.line}) + **${name} :: ${combinatorObj.sig}** ${combinatorObj.doc} ''; @@ -104,6 +104,7 @@ name = "readthedocs"; hljs_languages = [ "nix" ]; }; + extra_css = [ "extra.css" ]; # Copyright is placed directly into the page within a

tag. # Concatenating with

here is super janky, but good enough for # now. diff --git a/website/static-docs/extra.css b/website/static-docs/extra.css new file mode 100644 index 0000000..843bfef --- /dev/null +++ b/website/static-docs/extra.css @@ -0,0 +1,9 @@ +.document { + position: relative; +} + +a.source { + position: absolute; + margin-top: -48px; + right: 0; +}