Skip to content
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

Differentiate workspace APIs in ref docs #10883

Merged
merged 1 commit into from
Nov 2, 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
46 changes: 33 additions & 13 deletions Tools/jsdoc/cesium_template/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function attachModuleSymbols(doclets, modules) {
* @return {string} The HTML for the navigation sidebar.
*/
function buildNav(members) {
var nav = '<ul id="ClassList">',
var nav = '<div id="ClassList">',
seen = {},
hasClassList = false,
classNav = "",
Expand All @@ -223,22 +223,37 @@ function buildNav(members) {
return a.longname.toLowerCase().localeCompare(b.longname.toLowerCase());
});

if (items.length) {
items.forEach(function (m) {
if (!hasOwnProp.call(seen, m.longname)) {
nav +=
'<li data-name="' +
m.name +
'">' +
linkto(m.longname, m.name) +
"</li>";
}
seen[m.longname] = true;
});
const addItems = (items) => {
if (items.length) {
items.forEach(function (m) {
if (!hasOwnProp.call(seen, m.longname)) {
nav +=
'<li data-name="' +
m.name +
'">' +
linkto(m.longname, m.name) +
"</li>";
}
seen[m.longname] = true;
});
}
};

if (process.env.CESIUM_PACKAGES) {
process.env.CESIUM_PACKAGES.split(",").forEach((package) => {
nav += `<h5>${package}</h5>`;
nav += "<ul>";
addItems(items.filter((item) => item.meta.package === package));
nav += "</ul>";
});
} else {
nav += "<ul>";
addItems(items);
nav += "</ul>";
}

nav += "</div>";

return nav;
}

Expand Down Expand Up @@ -356,6 +371,11 @@ exports.publish = function (taffyData, opts, tutorials) {
doclet.meta.sourceUrl = conf["sourceUrl"]
.replace("{version}", process.env.CESIUM_VERSION)
.replace("{filename}", docletPath);
if (process.env.CESIUM_PACKAGES) {
doclet.meta.package = process.env.CESIUM_PACKAGES.split(",").find(
(package) => doclet.meta.sourceUrl.indexOf(package) > -1
);
}
}
}
});
Expand Down
9 changes: 8 additions & 1 deletion Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ code {
font-size: 12px;
}

#ClassList > li {
#ClassList > ul > li {
font-family: Consolas, "Liberation Mono", Menlo, "Courier New", Courier,
Monaco, monospace;
word-break: break-all;
Expand Down Expand Up @@ -299,6 +299,13 @@ div.nav li {
list-style-type: none;
}

div.nav h5 {
font-family: Consolas, "Liberation Mono", Menlo, "Courier New", Courier,
Monaco, monospace;
margin-top: 12px;
border-bottom: 1px solid #ccc;
}

nav a {
color: #5c5954;
}
Expand Down
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ export function buildDocs() {
`npx jsdoc --configure Tools/jsdoc/conf.json --pedantic ${generatePrivateDocumentation}`,
{
stdio: "inherit",
env: Object.assign({}, process.env, { CESIUM_VERSION: version }),
env: Object.assign({}, process.env, {
CESIUM_VERSION: version,
CESIUM_PACKAGES: packageJson.workspaces,
}),
}
);

Expand Down