Let "dub --build=ddox" start a local HTTP server instead of generating .html files.
1 parent 299a4d0 commit f3a818e61b916bd844b50120ad1fe61502686207
@Sönke Ludwig Sönke Ludwig authored on 2 Nov 2013
Showing 2 changed files
View
2
■■■
source/app.d
gensettings.runArgs = app_args;
 
logDiagnostic("Generating using %s", generator);
dub.generateProject(generator, gensettings);
if( build_type == "ddox" ) dub.runDdox();
if (build_type == "ddox") dub.runDdox(gensettings.run);
break;
case "describe":
if (args.length >= 2) package_name = args[1];
if (!loadSelectedPackage()) return 1;
View
16
source/dub/dub.d
string[] commands;
string[] filterargs = m_project.mainPackage.info.ddoxFilterArgs.dup;
if (filterargs.empty) filterargs = ["--min-protection=Protected", "--only-documented"];
commands ~= dub_path~"ddox filter "~filterargs.join(" ")~" docs.json";
commands ~= dub_path~"ddox generate-html --navigation-type=ModuleTree docs.json docs";
version(Windows) commands ~= "xcopy /S /D "~dub_path~"public\\* docs\\";
else commands ~= "cp -r \""~dub_path~"public/*\" docs/";
if (!run) {
commands ~= dub_path~"ddox generate-html --navigation-type=ModuleTree docs.json docs";
version(Windows) commands ~= "xcopy /S /D "~dub_path~"public\\* docs\\";
else commands ~= "cp -r \""~dub_path~"public/*\" docs/";
}
runCommands(commands);
 
if (run) {
auto url = Url("file", m_rootPath~"docs/index.html");
logDiagnostic("Openening generated docs at %s", url.toString());
browse(url.toString());
spawnProcess([dub_path~"ddox", "serve-html", "--navigation-type=ModuleTree", "docs.json", "--web-file-dir="~dub_path~"public"]);
browse("http://127.0.0.1:8080/");
}
}
 
private void updatePackageSearchPath()