scripts/generate-demo-app-docs.js
function generateTypedocDocs(typedocDocsDir) {
  const publicApiConfigFile = path.resolve(__dirname, '../src/ng5-slider/lib/public_api.json');
  const publicApiConfig = JSON.parse(fs.readFileSync(publicApiConfigFile, { encoding: 'utf8' }));

  const files = publicApiConfig.exports
    .map(exportDef => path.resolve(__dirname, `../src/ng5-slider/lib/${exportDef.file}.ts`));

  const themeDir = path.resolve(__dirname, '../typedoc-theme');

  // HACK: When Typedoc finda a README.md file, it uses it to generate content for the index page of documentation
  // This is not very helpful, as it repeats the same stuff that's already shown on Github and NPM
  // So instead, replace the README.md with our own file
  const apiDocsReadmeFile = path.resolve(__dirname, '../typedoc-theme/README.md');
  utils.copyReadmeMd(apiDocsReadmeFile);

  const app = new typedoc.Application({
    module: 'commonjs',
    target: 'es6',
    includeDeclarations: false,
    experimentalDecorators: true,
    excludeExternals: true,
    theme: themeDir
  });

  app.generateDocs(files, typedocDocsDir);

  // HACK: restore the README.md to original
  const mainReadmeFile = path.resolve(__dirname, '../README.md');
  utils.copyReadmeMd(mainReadmeFile);
}
function generateTypedocDocs(typedocDocsDir) {
  const publicApiConfigFile = path.resolve(__dirname, '../src/ng5-slider/lib/public_api.json');
  const publicApiConfig = JSON.parse(fs.readFileSync(publicApiConfigFile, { encoding: 'utf8' }));

  const files = publicApiConfig.exports
    .map(exportDef => path.resolve(__dirname, `../src/ng5-slider/lib/${exportDef.file}.ts`));

  const themeDir = path.resolve(__dirname, '../typedoc-theme');

  // HACK: When Typedoc finda a README.md file, it uses it to generate content for the index page of documentation
  // This is not very helpful, as it repeats the same stuff that's already shown on Github and NPM
  // So instead, replace the README.md with our own file
  const apiDocsReadmeFile = path.resolve(__dirname, '../typedoc-theme/README.md');
  utils.copyReadmeMd(apiDocsReadmeFile);

  const app = new typedoc.Application({
    module: 'commonjs',
    target: 'es6',
    includeDeclarations: false,
    experimentalDecorators: true,
    excludeExternals: true,
    theme: themeDir
  });

  app.generateDocs(files, typedocDocsDir);

  // HACK: restore the README.md to original
  const mainReadmeFile = path.resolve(__dirname, '../README.md');
  utils.copyReadmeMd(mainReadmeFile);
}
function generateTypedocDocs ( typedocDocsDir ) { const publicApiConfigFile = path . resolve ( __dirname , '../src/ng5-slider/lib/public_api.json' ) ; const publicApiConfig = JSON . parse ( fs . readFileSync ( publicApiConfigFile , { encoding : 'utf8' } ) ) ; const files = publicApiConfig . exports . map ( exportDef => path . resolve ( __dirname , ` ${ exportDef . file } ` ) ) ; const themeDir = path . resolve ( __dirname , '../typedoc-theme' ) ; // HACK: When Typedoc finda a README.md file, it uses it to generate content for the index page of documentation // This is not very helpful, as it repeats the same stuff that's already shown on Github and NPM // So instead, replace the README.md with our own file const apiDocsReadmeFile = path . resolve ( __dirname , '../typedoc-theme/README.md' ) ; utils . copyReadmeMd ( apiDocsReadmeFile ) ; const app = new typedoc . Application ( { module : 'commonjs' , target : 'es6' , includeDeclarations : false , experimentalDecorators : true , excludeExternals : true , theme : themeDir } ) ; app . generateDocs ( files , typedocDocsDir ) ; // HACK: restore the README.md to original const mainReadmeFile = path . resolve ( __dirname , '../README.md' ) ; utils . copyReadmeMd ( mainReadmeFile ) ; }
Run typedoc over library public API files to generate HTML files from customised typedoc theme
The resulting files are not really useful on their own; they will be used later to generate demo app code
Run typedoc over library public API files to generate HTML files from customised typedoc theme The resulting files are not really useful on their own ; they will be used later to generate demo app code