commit 8e15157a4ed4aa6a386a7c36e82f23c1197d5937
parent 778ea83c97c103b76f821658d6ae998db864bbb3
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 21 Apr 2021 10:22:53 -0400
haredoc: use absolute paths to submodules
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha
@@ -8,6 +8,7 @@ use hare::module;
use hare::unparse;
use io;
use os;
+use path;
use strings;
use strio;
@@ -53,8 +54,14 @@ fn emit_html(ctx: *context) (void | error) = {
for (let i = 0z; i < len(ctx.version.subdirs); i += 1) {
let dir = ctx.version.subdirs[i];
if (dir == "cmd") continue;
+
+ let path = module::identpath(ctx.ident);
+ defer free(path);
+ let path = path::join("/", path, dir);
+ defer free(path);
+
fmt::printf("<li><a href='");
- html::escape(os::stdout, dir);
+ html::escape(os::stdout, path);
fmt::printf("'>");
html::escape(os::stdout, dir);
fmt::printfln("</a></li>");