Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Angular2 Typescript Project w/ Dgeni #150

@colinkahn

Description

@colinkahn

Hi,

Is there a simple example of Dgeni (similar to https://github.com/petebacondarwin/dgeni-example) that shows how you'd use it with an Angular 2 application using TypeScript?

Currently I have this:

var Package = require('dgeni').Package;
var jsdocPackage = require('dgeni-packages/jsdoc');
var nunjucksPackage = require('dgeni-packages/nunjucks');
var typescriptPackage = require('dgeni-packages/typescript');
var path = require('canonical-path');

// Define the dgeni package for generating the docs
module.exports = new Package('hex-angular-docs', [
  jsdocPackage,
  nunjucksPackage,
  typescriptPackage
])

// Configure the log service
.config(function(log) {
  log.level = 'silly';
})

.config(function (readTypeScriptModules, readFilesProcessor, templateFinder) {
  readTypeScriptModules.basePath = path.resolve(__dirname, '../../src/client');
  readTypeScriptModules.sourceFiles = [
    'button/index.ts'
  ];

  // Specify the base path used when resolving relative paths to source and output files
  readFilesProcessor.basePath = path.resolve(__dirname, '../../src/client');

  // Specify collections of source files that should contain the documentation to extract
  readFilesProcessor.sourceFiles = [
    {
      include: 'app/**/*.md',
      basePath: 'app'
    }
  ];

  templateFinder.templatePatterns.unshift('common.template.html');
})

// Configure file writing
.config(function(writeFilesProcessor) {
  writeFilesProcessor.outputFolder  = 'docs';
})

Which I've pieced together from various examples. While I've gotten over the hurdle of it throwing errors, it isn't actually generating any documentation.

Any help is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions