Skip to content

Commit

Permalink
make source dir if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdruppe committed Mar 22, 2017
1 parent 74212e3 commit 1dd38e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc2.d
Expand Up @@ -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());
}

Expand Down

0 comments on commit 1dd38e2

Please sign in to comment.