diff --git a/source/app.d b/source/app.d index 9dfb7c4..370c020 100644 --- a/source/app.d +++ b/source/app.d @@ -311,7 +311,7 @@ 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]; diff --git a/source/dub/dub.d b/source/dub/dub.d index e8e34b9..c62ca0f 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -400,15 +400,16 @@ 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/"); } }