question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular2 Typescript Project w/ Dgeni

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
petebacondarwincommented, Oct 6, 2016

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 https://github.com/angular/dgeni/issues/150#issuecomment-251885262, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA9J-Lvc4SOL8y5iD5SuobSRUFSAVo6ks5qxKBfgaJpZM4IrCk_ .

2reactions
clavecodercommented, Oct 6, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documenting your Angular app using Dgeni in 10 easy steps
Easily bring someone new into the project; Easily understand each other's code more clearly; Document business rules and complex algorythms ...
Read more >
dgeni - npm
Flexible JavaScript documentation generator used by both AngularJS and Angular. Latest version: 0.4.14, last published: 2 years ago.
Read more >
Angular2 Documentation Generator - typescript - Stack Overflow
The documentation covers everything you might expect from good docs, compodocs can identify angular2 modules/classes/services/annotations etc.
Read more >
How to setup an Angular 2 project with Typescript support.
So how do we set up an Angular 2 project with TypeScript support? First we will need npm, which can be installed by...
Read more >
Documenting Angular apps: TypeDoc, CompoDoc and ...
It is then processed by a utility called Dgeni. Documenting TypeScript with TypeDoc. Angular 2+ is way different than AngularJS. What's more, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found