Skip to content

Dvpl 11058 -- Added assets directory to be included while generating docs #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* Constants
*/
var DEFAULT_PORT = 6969;
var DOC_DIRECTORY = "docs";
var REFDOC_DIRECTORY = "refs";
var CLIENT_DIRECTORY = "client";
var TEST_DIRECTORY = "tests";
Expand All @@ -44,6 +43,10 @@
var DOC_FILE = "index.html";
var BUILD_CACHE_FILE = ".buildcache";
var SDK_VERSION = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../package.json")).toString("utf-8")).version;
var DOC_DIRECTORY = "docs-" + SDK_VERSION;
var DOC_ASSETS_DIRECTORY = "assets";
var DOC_DIRECTORY_ASSETS = path.join("bin/docs", DOC_ASSETS_DIRECTORY);
var GENERATED_DOC_ASSETS = path.join(DOC_DIRECTORY, DOC_ASSETS_DIRECTORY);
var IGNORED_MODULES = [
"../contrib/nodeunit/test_reporter",
"../contrib/nodeunit/junit_reporter",
Expand Down Expand Up @@ -643,11 +646,12 @@
}

ensureDirectoryExists(DOC_DIRECTORY);
ensureDirectoryExists(path.join(DOC_DIRECTORY, SDK_VERSION));
ensureDirectoryExists(path.join(DOC_DIRECTORY, SDK_VERSION, REFDOC_DIRECTORY));

// copy static assets directory
copyDirectoryRecursiveSync(DOC_DIRECTORY_ASSETS, GENERATED_DOC_ASSETS);

for (var name in data) {
var htmlPath = path.join(DOC_DIRECTORY, SDK_VERSION, REFDOC_DIRECTORY, name + ".html");
var htmlPath = path.join(DOC_DIRECTORY, name + ".html");
fs.writeFileSync(htmlPath, data[name]);
}

Expand Down
Loading