build-doc-index.js 706 B

1234567891011121314151617181920212223242526272829303132333435
  1. const fs = require('fs-extra');
  2. const utils = require('@jupyterlab/buildutils');
  3. let index = `<!DOCTYPE html>
  4. <!--
  5. Copyright (c) Jupyter Development Team.
  6. Distributed under the terms of the Modified BSD License.
  7. -->
  8. <html>
  9. <head>
  10. <meta charset="utf-8">
  11. <title>JupyterLab API Docs</title>
  12. </head>
  13. <body>
  14. <h2>JupyterLab Packages</h2>
  15. <div style='display:flex;flex-direction:column'>`;
  16. const data = utils.readJSONFile('./package.json');
  17. const pkgs = Object.keys(data.dependencies);
  18. pkgs.forEach(function(pkg) {
  19. const name = pkg.split('/')[1];
  20. index += `<a href="${name}/index.html">${name}</a>\n`;
  21. });
  22. index += `
  23. </div>
  24. </body>
  25. </html>`;
  26. fs.writeFileSync('../../docs/api/index.html', index);