angular/dgeni

Angular2 Typescript Project w/ Dgeni

Opened this issue · 12 comments

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.

@colinkahn, did you get anywhere with this? Typedoc doesn't support TypeScript 2 (TypeStrong/typedoc#234), so were kind of stuck.

I would also like to know if there is some way we can use dgeni with angular2. However, i would be extremely happy it can be incorporated with angular-cli.

I intend to work on a turn-key solution for A2 projects later this year (or
early next year) if you can wait that long.

On 6 October 2016 at 08:16, Yogesh Surendran notifications@github.com
wrote:

I would also like to know if there is some way we can use dgeni with
angular2. However, i would be extremely happy it can be incorporated with
angular-cli.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#150 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAA9J-Lvc4SOL8y5iD5SuobSRUFSAVo6ks5qxKBfgaJpZM4IrCk_
.

If you could generalize for vanilla TS projects also, we would be very grateful.

@petebacondarwin, Waiting should not be a problem. My extjs to angular2 rewrite project is in final stage of Proposal/POC state and would kickstarted by end of this month.

If i have an alternate for jsduck documentation that works well with Angular2. I am happy with any solution that u provide.

Thanks for your consideration. Appreciate your efforts.

DSoa commented

@petebacondarwin, any update on your turn-key solution for Angular2? Dgeni is quite intimidating and it would be great to have a Angular2-aware implementation to work with.

Thanks.

@DSoa - recently @jelbourn did some work to generate docs for Angular Material 2 using dgeni (https://github.com/angular/material2/tree/master/tools/dgeni). He has provided some feedback that we need to work back into dgeni-packages to help here. Keep watching...

@petebacondarwin / @jelbourn Any update on this? I'm not happy with the results that Compodoc or TypeDoc provide, and I'd like to do something similar to the material docs.

We still have not productionized a turn-key solution for documenting Angular apps/libraries via dgeni.
But the work in the Angular components (aka Material) project is a good starting place: https://github.com/angular/components/tree/master/tools/dgeni as linked above.

@petebacondarwin That was the approach I was taking, but I don't really want to go down the Bazel route and there are a lot of pieces of the Dgeni package which are provided by Bazel. I'll take another crack at it I suppose and see if I can get more traction this time haha. Thanks.

Feel free to email me directly if you want to chat about any aspect of it.