bookshelf-doc/static/importedBy.js

20 lines
640 B
JavaScript
Raw Normal View History

2022-07-22 14:56:51 +00:00
import { DeclarationDataCenter } from "./declaration-data.js";
fillImportedBy();
async function fillImportedBy() {
2023-09-10 10:39:37 +00:00
if (typeof(MODULE_NAME) == "undefined") {
2022-07-22 14:56:51 +00:00
return;
}
const dataCenter = await DeclarationDataCenter.init();
const moduleName = MODULE_NAME;
const importedByList = document.querySelector(".imported-by-list");
const importedBy = dataCenter.moduleImportedBy(moduleName);
var innerHTML = "";
for(var module of importedBy) {
const moduleLink = dataCenter.moduleNameToLink(module);
innerHTML += `<li><a href="${SITE_ROOT}${moduleLink}">${module}</a></li>`
}
importedByList.innerHTML = innerHTML;
}