How to use the dgeni.Dgeni function in dgeni

To help you get started, we’ve selected a few dgeni examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / components / tools / dgeni / bazel-bin.ts View on Github external
// Since our base directory is the Bazel execroot, we need to make sure that Dgeni can
    // find all templates needed to output the API docs.
    templateFinder.templateFolders = [join(execRootPath, 'tools/dgeni/templates/')];

    // The output path for files will be computed by joining the output folder with the base path
    // from the "readFilesProcessors". Since the base path is the execroot, we can just use
    // the output path passed from Bazel (e.g. $EXECROOT/bazel-out/bin/src/docs-content)
    writeFilesProcessor.outputFolder = outputDirPath;
  });

  // Run the docs generation. The process will be automatically kept alive until Dgeni
  // completed. In case the returned promise has been rejected, we need to manually exit the
  // process with the proper exit code because Dgeni doesn't use native promises which would
  // automatically cause the error to propagate.
  new Dgeni([apiDocsPackage]).generate().catch((e: any) => {
    console.error(e);
    process.exit(1);
  });
}
github sbb-design-systems / sbb-angular / schematics / documentation / index.ts View on Github external
// tslint:disable-next-line: no-non-null-assertion
    tsParser.options.paths!['*'] = [relative(packagePath, join(execRootPath, 'node_modules/*'))];

    // Since our base directory is the Bazel execroot, we need to make sure that Dgeni can
    // find all templates needed to output the API docs.
    templateFinder.templateFolders = [
      join(execRootPath, 'schematics/documentation/dgeni/templates/')
    ];

    // The output path for files will be computed by joining the output folder with the base path
    // from the "readFilesProcessors". Since the base path is the execroot, we can just use
    // the output path passed from Bazel (e.g. $EXECROOT/bazel-out/bin/src/docs-content)
    writeFilesProcessor.outputFolder = outputDirPath;
  });

  const docs = new Dgeni([apiDocsPackage]);
  await docs.generate().catch((e: any) => {
    console.error(e);
    process.exit(1);
  });
}
github angular / angular / aio / tools / transforms / authors-package / watchr.js View on Github external
function next(error) {
  if (error) {
    console.log(error);
  }
}

let p = Promise.resolve();

if (process.argv.indexOf('--watch-only') === -1) {
  console.log('================================================================');
  console.log('Running initial doc generation');
  console.log('----------------------------------------------------------------');
  console.log('Skip the full doc-gen by running: `yarn docs-watch --watch-only`');
  console.log('================================================================');
  const {Dgeni} = require('dgeni');
  const dgeni = new Dgeni([require('../angular.io-package')]);

  // Turn off all the potential failures for this doc-gen one-off run.
  // This enables authors to run `docs-watch` while the docs are still in an unstable state.
  const injector = dgeni.configureInjector();
  injector.get('linkInlineTagDef').failOnBadLink = false;
  injector.get('checkAnchorLinksProcessor').$enabled = false;
  injector.get('renderExamples').ignoreBrokenExamples = true;

  p = dgeni.generate();
}

p.then(() => {
  console.log('===================================================================');
  console.log('Started watching files in:');
  console.log(' - ', CONTENTS_PATH);
  console.log(' - ', API_SOURCE_PATH);
github angular / dgeni-packages / typescript / src / services / ts-host / host.spec.ts View on Github external
function setupTestDgeniInstance(configureFn?: (host: Host) => void) {
    const testPackage = mockPackage() as Package;

    if (configureFn) {
      testPackage.config((tsHost: Host) => configureFn(tsHost));
    }

    const dgeni = new Dgeni([testPackage]);
    const injector = dgeni.configureInjector();

    // Load factories from the Dgeni injector.
    host = injector.get('tsHost');
    parser = injector.get('tsParser');
  }
github nestjs / docs.nestjs.com / tools / dgeni-cli.ts View on Github external
import { Dgeni } from 'dgeni';
import { resolve } from 'path';

const argv = require('yargs').argv;
const packagePaths = argv._;

const packages = packagePaths.map(packagePath => {
  if (packagePath.indexOf('.') === 0) {
    packagePath = resolve(packagePath);
  }
  return require('../' + packagePath).default;
});

new Dgeni(packages)
  .generate()
  .then(docs => {
    console.log(`${docs.length} docs generated.`);
  })
  .catch(err => {
    console.error(err);
    process.exit(1);
  });
github graycoreio / daffodil / tools / dgeni / build.ts View on Github external
rimraf('../../dist/docs/**/*', function() {
	new Dgeni([guideDocPackage]).generate().catch(() => process.exit(1));
	new Dgeni([apiDocs]).generate().catch(() => process.exit(1));
});
github angular / dgeni-packages / typescript / src / processors / mergeParameterInfo.spec.ts View on Github external
beforeEach(() => {
    dgeni = new Dgeni([mockPackage()]);
    injector = dgeni.configureInjector();

    tsProcessor = injector.get('readTypeScriptModules');
    parseTagsProcessor = injector.get('parseTagsProcessor');
    extractTagsProcessor = injector.get('extractTagsProcessor');
    mergeParameterInfoProcessor = injector.get('mergeParameterInfo');
    tsProcessor.basePath = path.resolve(__dirname, '../mocks/readTypeScriptModules');
    tsProcessor.sourceFiles = ['methodParameters.ts'];
  });
github angular / components / tools / gulp / tasks / docs.ts View on Github external
task('api-docs', () => {
  const docs = new Dgeni([apiDocsPackage]);
  return docs.generate();
});
github rdkmaster / jigsaw / build / tools / gulp / tasks / docs.ts View on Github external
task('api-docs', () => {
  const docsPackage = require(path.resolve(__dirname, '../../dgeni'));
  const docs = new Dgeni([docsPackage]);
  return docs.generate();
});
github angular / dgeni-packages / typescript / src / processors / linkInheritedDocs.spec.ts View on Github external
beforeEach(() => {
    dgeni = new Dgeni([mockPackage()]);
    injector = dgeni.configureInjector();

    tsProcessor = injector.get('readTypeScriptModules');
    linkProcessor = injector.get('linkInheritedDocs');
    tsProcessor.basePath = path.resolve(__dirname, '../mocks/linkInheritedDocs');
    tsProcessor.sourceFiles = ['index.ts', 'deps.ts'];
  });

dgeni

Flexible JavaScript documentation generator used by both AngularJS and Angular

MIT
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis