From 1dd38e2509f0928258c9d88c1458f41d8b2f4a7f Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Wed, 22 Mar 2017 09:37:15 -0400 Subject: [PATCH] make source dir if not exists --- doc2.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc2.d b/doc2.d index e14e323..152cb57 100644 --- a/doc2.d +++ b/doc2.d @@ -2417,6 +2417,13 @@ void main(string[] args) { annotatedSourceDocument.title = mod.name ~ " source code"; + if(!exists(outputDirectory ~ "source")) + mkdir(outputDirectory ~ "source"); + foreach(ele; annotatedSourceDocument.querySelectorAll("link, script[src]")) + if(ele.tagName == "link") + ele.attrs.href = "../" ~ ele.attrs.href; + else + ele.attrs.src = "../" ~ ele.attrs.src; std.file.write(outputDirectory ~ "source/" ~ mod.name ~ ".d.html", annotatedSourceDocument.toString()); }