├── .eslintrc.js ├── .gitignore ├── .npmignore ├── .travis.yml ├── .vscode └── launch.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_fr_FR.md ├── README_zh_CN.md ├── ROADMAP.md ├── assets ├── README.md ├── dgeni-logo-150x100.png ├── dgeni-logo-600x400.png └── dgeni-logo.svg ├── docs ├── dgeni-docs.js ├── en_GB │ └── guide │ │ ├── 01 - Getting Started │ │ ├── 01 - What is Dgeni.md │ │ ├── 02 - Why Dgeni.md │ │ ├── 03 - Who Uses Dgeni.md │ │ ├── 04 - Installation.md │ │ └── 05 - Simple Dgeni Example.md │ │ ├── 02 - Architecture │ │ ├── 01 - Conceptual Overview.md │ │ ├── 02 - Dgeni Processors.md │ │ ├── 03 - Dgeni Packages.md │ │ ├── 04 - File Reader Processor.md │ │ ├── 05 - Tag Parsing and Extracting.md │ │ └── 06 - Further Processing.md │ │ └── 03 - Using Dgeni │ │ ├── 01 - Configuration.md │ │ ├── 02 - Standard Packages │ │ ├── 01 - JSDoc Package.md │ │ ├── 02 - NGDoc Package.md │ │ └── 03 - Examples Package.md │ │ └── 03 - Customizing │ │ ├── 01 - Custom Packages.md │ │ ├── 02 - Processors.md │ │ ├── 03 - File Readers.md │ │ ├── 04 - Tag Definitions.md │ │ └── 05 - Templates.md ├── fr_FR │ └── guide │ │ ├── 01 - Mise en route │ │ ├── 01 - Qu est ce que Dgeni.md │ │ ├── 02 - Pourquoi Dgeni.md │ │ ├── 03 - Qui utilise Dgeni.md │ │ ├── 04 - Installation.md │ │ └── 05 - Exemple simple de Dgeni.md │ │ ├── 02 - Architecture │ │ ├── 01 - Vue d ensemble du concept.md │ │ ├── 02 - Processeurs de Dgeni.md │ │ ├── 03 - Packages de Dgeni.md │ │ ├── 04 - Processeur de lecture de fichier.md │ │ ├── 05 - Extraction et analyse des balises.md │ │ ├── 06 - Traitement complémentaire.md │ │ └── 06 - Traitement complémentaire.md │ │ └── 03 - Utilisation de Dgeni │ │ ├── 01 - Configuration.md │ │ ├── 02 - Packages Standards │ │ ├── 01 - Package JSDoc.md │ │ ├── 02 - Package NGDoc.md │ │ └── 03 - Exemples de Package.md │ │ └── 03 - Personnalisation │ │ ├── 01 - Personnaliser les Packages.md │ │ ├── 02 - Processeurs.md │ │ ├── 03 - Lecteurs de fichier.md │ │ ├── 04 - Définitions de balise.md │ │ ├── 04 - Définitions de balise.md │ │ └── 05 - Templates.md └── templates │ └── common.template.html ├── package.json ├── src ├── Dgeni.spec.ts ├── Dgeni.ts ├── DocCollection.ts ├── Document.ts ├── Injector.ts ├── Module.ts ├── Package.spec.ts ├── Package.ts ├── Processor.ts ├── gen-docs.ts ├── index.ts ├── legacyPackages │ ├── processorValidation.spec.ts │ └── processorValidation.ts ├── mocks │ └── log.ts ├── packages │ ├── docDiffLogger.spec.ts │ ├── docDiffLogger.ts │ ├── trackDocLogger.spec.ts │ └── trackDocLogger.ts └── util │ ├── dependency-sort.spec.ts │ ├── dependency-sort.ts │ ├── getInjectables.spec.ts │ ├── getInjectables.ts │ ├── log.spec.ts │ └── log.ts ├── tsconfig.json ├── tslint.json └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "rules": { 3 | "indent": [ 4 | 2, 5 | 2 6 | ], 7 | "quotes": [ 8 | 2, 9 | "single" 10 | ], 11 | "linebreak-style": [ 12 | 2, 13 | "unix" 14 | ], 15 | "semi": [ 16 | 2, 17 | "always" 18 | ] 19 | }, 20 | "env": { 21 | "node": true, 22 | "jasmine": true 23 | }, 24 | "extends": "eslint:recommended" 25 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | *.DS_Store 10 | 11 | pids 12 | logs 13 | results 14 | 15 | npm-debug.log 16 | node_modules 17 | 18 | .agignore 19 | 20 | coverage 21 | .idea/ 22 | 23 | docs/build 24 | lib -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | assets 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6" 4 | - "7" 5 | 6 | before_script: 7 | - yarn 8 | 9 | script: 10 | - yarn test -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible Node.js debug attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Mocha Tests", 11 | "cwd": "${workspaceRoot}", 12 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha", 13 | "windows": { 14 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha.cmd" 15 | }, 16 | "runtimeArgs": [ 17 | "-u", 18 | "tdd", 19 | "--timeout", 20 | "999999", 21 | "--colors", 22 | "${workspaceRoot}/dist" 23 | ], 24 | "internalConsoleOptions": "openOnSessionStart" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # ChangeLog 2 | 3 | ## 0.4.14 5 March 2021 4 | 5 | Chore release - updating dependencies 6 | 7 | ## 0.4.13 11 January 2021 8 | 9 | fix(Dgeni): do not print stack trace on error unless debugging (a3c870d) 10 | 11 | ## 0.4.12 14 March 2019 12 | 13 | Chore release - updating dependencies 14 | 15 | ## 0.4.11 17 December 2018 16 | 17 | Chore release - updating TypeScript dependency 18 | 19 | ## 0.4.10 14 August 2018 20 | 21 | Chore release - updating dependencies 22 | 23 | ## 0.4.9 15 June 2017 24 | 25 | Chore release 26 | 27 | ## 0.4.8 15 June 2017 28 | 29 | * fix(processor): add missing fields to Processor type definition b4ed72f0 30 | 31 | 32 | ## 0.4.7 15 February 2017 33 | 34 | * fix(mocks): ensure mock logger is available in the published package ca43a807 35 | 36 | 37 | ## v0.4.6 (14th February 2017) 38 | 39 | * fix(Dgeni): ensure that the typings are exposed correctly a0fc03c9 40 | 41 | ## v0.4.5 (14th February 2017) 42 | 43 | False start! 44 | 45 | ## v0.4.4 (13th February 2017) 46 | 47 | Minor docs and chores updates; in particular the `@types/mocha` dependency was moved 48 | to devDependencies to prevent unwanted leakage into client projects. 49 | 50 | 51 | ## v0.4.3 (12th February 2017) 52 | 53 | Various docs and refactorings including a complete rewrite in typescript, 54 | which enables API typings for TypeScript users. 55 | 56 | ## v0.4.2 (6th January 2016) 57 | 58 | Node dependency update - dgeni now cleanly support node 4 and 5 (and so npm 3) 59 | 60 | ## v0.4.1 (4th October 2014) 61 | 62 | Minor Bug Fix 63 | 64 | * fix(Package): allow use of `npm link` with dgeni 6698fe9f 65 | 66 | 67 | ## v0.4.0 (10th September 2014) 68 | 69 | **Major New Release** 70 | 71 | This is a major re-architecting from v0.3.0 of how Dgeni uses Dependency Injection and configuration. 72 | 73 | This version of Dgeni is compatible with dgeni-packages v0.10.0 74 | 75 | * Dgeni is now configured by **Packages**, which can depend on other **Packages**. You create an 76 | instance of `Dgeni`, passing in the **Packages** that are to be loaded. 77 | 78 | * **Packages** contain **Services**, **Processors** and **Config Blocks**, which are all 79 | instantiated or invoked by the DI system. 80 | 81 | * Dgeni specific properties on **Processors** are now prefixed with a `$`. E.g. `$process()`, 82 | `$runBefore`, `$runAfter`. 83 | 84 | * **Processors** themselves are special instances of DI **Services**. In the previous versions 85 | of dgeni the **process()** method was being invoked by the DI system instead. Now since the 86 | processor itself is created by a factory function that can be injected with **Services**, much 87 | more can be done to configure the **Processor** before the `$process(docs)` method is called. 88 | 89 | * **Processors** can now be "validated" using [validatejs.org](validatejs.org) constraints, 90 | specified in the `processor.$validate` property. 91 | 92 | * **Processors** can now be disabled by setting `processor.$enabled = false`. 93 | 94 | * **Services** and **Processors** with the same name will override previously registered ones, say 95 | from a Package dependency. This enables custom **Packages** to provide alternate components 96 | and makes mocking much easier in tests. 97 | 98 | * New injectable helper services have been provided: `dgeni`, `log`, `getInjectables`. 99 | 100 | * Each instance of `Dgeni` now exposes a `configureInjector()` method, which returns the configured 101 | dgeni DI injector. This is useful in unit testing to easily get access to the **Services** and 102 | **Processors** to be tested. 103 | 104 | * Now use the injectable `log` service in your **Processors** and **Services** instead of requiring 105 | `winston`. This also means that it is easier to replace the logger implementation both in the future 106 | and for testing. Dgeni provides a "mock" logger at `dgeni/lib/mocks/log`, which you can require to 107 | override the standard winston logger. 108 | 109 | * Test coverage of the source files is now at 100%. 110 | 111 | 112 | ## v0.4.0-rc.2 (10th September 2014) 113 | 114 | Minor refactoring 115 | 116 | * chore(tests): move tests into lib folder 607037fe 117 | 118 | 119 | ## v0.4.0-rc.1 (6th September 2014) 120 | 121 | Minor refactoring 122 | 123 | * fix(Dgeni): handle validation and processor errors better b452b472 124 | 125 | ## v0.4.0-beta.4 (1st September 2014) 126 | 127 | Minor refactoring and fixes 128 | 129 | * feat(Dgeni): add `configureInjector` method 6a37dada 130 | * fix(gen-docs.js): remove unnecessary reference to base package b7d7185e 131 | * feat(gen-docs): add log option to CLI 062ca137 132 | * fix(gen-docs.js): `startsWith()` is not ES5 compatible 22e11630 133 | 134 | 135 | ## v0.4.0-beta.3 (12th August 2014) 136 | 137 | Minor refactoring 138 | 139 | * refact(Dgeni): remove dependency on 'es6-shim' and `Map` a8fa07eb 140 | 141 | 142 | ## v0.4.0-beta.2 (7th August 2014) 143 | 144 | Minor bug fixes 145 | 146 | * fix(Dgeni): require Package not package fc2be818 147 | * fix(Dgeni): do not modify `package.dependencies` property 61449389 148 | 149 | 150 | ## v0.4.0-beta.1 (25th July 2014) 151 | 152 | This is a major re-architecting of how Dgeni uses Dependency Injection and configuration. 153 | 154 | This version of Dgeni is compatible with dgeni-packages@^0.10.0 155 | 156 | * Dgeni is now configured by **Packages**, which can depend on other **Packages**. 157 | * **Packages** contain **Services**, **Processors** and **Config Blocks**, which are all 158 | instantiated or invoked by the DI system. 159 | * **Processors** themselves are special instances of DI **Service** rather than the 160 | **process()** being invoked by the DI system. 161 | * Dgeni specific properties on **Processors** are now prefixed with a `$`. E.g. `$process()`, 162 | `$runBefore`, `$runAfter`. 163 | * **Processors** can now be "validated" using [validatejs.org](validatejs.org) constraints, 164 | specified in the `processor.$validate` property. 165 | * **Processors** can now be disabled by setting `processor.$enabled = false`. 166 | * **Processors** with the same name will override previously registered **Processors**, say 167 | from a Package dependency. 168 | * New injectable helper services have been provided: `dgeni`, `log`, `getInjectables`. 169 | * Use injectable `log` service in your Processors and Services instead of requiring `winston`. 170 | * Test coverage of the source files is now at 100%. 171 | 172 | The most significant commits are listed below: 173 | 174 | * fix(Dgeni): allow config blocks to change $enabled on a Processor d231c244 175 | * feat(Dgeni): allow processors to be disabled by setting `$enabled: false` d390fcd3 176 | * feat(Dgeni): allow config blocks to make changes to processor order 604fcbfb 177 | * feat(Dgeni): add package info to processors to help with error reporting 81184052 178 | * fix(Dgeni): processors with the same name should override previous ones ff7ec049 179 | * feat(getInjectables): add new shared service 6d9cef0a 180 | * test(mock/log): add simple mock log service for testing 51a8dc92 181 | * feat(Package): allow processors and service to override their name a9584fd2 182 | * test(Dgeni): add tests to improve code coverage 7b4a757b 183 | * feat(Package): allow processors to be defined as an object a75e9181 184 | * feat(Dgeni): add new (no config - DI based) Dgeni e8d30958 185 | * feat(Package): add Package type 87cbf122 186 | * feat(log): add wrapper around winston c303a9a6 187 | * refact(*): remove previous Dgeni implementation 1cf67e2d 188 | 189 | ## v0.3.0 (11th April 2014) 190 | 191 | This is a "Spring Clean" release 192 | 193 | * Configuration, utilities and dependencies that were only used by separate Dgeni packages have 194 | been moved to those repositories. 195 | * There is an initial set of "guide" documents to read at 196 | https://github.com/angular/dgeni/tree/master/docs/en_GB/guide. 197 | * The API has been cleaned up to make it easier to use Dgeni without having to look inside. 198 | 199 | **New Stuff** 200 | 201 | * feat(doc-processor): processors can declare injectable exports cfd19f08 202 | 203 | **Breaking Changes** 204 | 205 | * refactor(index): provide a cleaner API surface 3c78776d 206 | * refact(doc-processor): move pseudo processors to dgeni-packages c198f651 207 | 208 | 209 | ## v0.2.2 (6th March 2014) 210 | 211 | **Bug fixes** 212 | 213 | * fix(doc-processor): pass docs to next processor following a failure 67997e8e 214 | 215 | 216 | ## v0.2.1 (5th March 2014) 217 | 218 | **Bug fixes** 219 | 220 | * fix(doc-processor): handle errors thrown in processors better 221 | 222 | ## v0.2.0 (28th February 2014) 223 | 224 | **New Features** 225 | 226 | * extractTagFactory (lib/extract-tags.js) is moved to the dgeni-packages project. 227 | 228 | **BREAKING CHANGE** 229 | 230 | * The extractTagsFactory is now moved to the dgeni-packages 231 | project, because it is specific to the way that tags are parsed and extracted 232 | in that project. If you rely on this then you should add dgeni-packages 233 | as a dependency to your project. 234 | 235 | ## v0.1.1 (24th February 2014) 236 | 237 | **Bug fixes** 238 | 239 | * allow defaultFn to return falsy values [3b2e098dc92b](https://github.com/angular/dgeni/commit/3b2e098dc92b7f9766aaf03f2d7815c6fb4862e3) 240 | 241 | ## v0.1.0 (20th February 2014) 242 | 243 | * Initial version to support AngularJS documentation generation. 244 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Dgeni 2 | While dgeni is amazing we need help keeping it going and make it better that it already is. Here's how you can help! 3 | 4 | - [Code of Conduct](#code-of-conduct) 5 | - [Getting Started](#getting-started) 6 | - [Making Changes](#making-changes) 7 | - [Coding Conventions](#coding-conventions) 8 | - [Submission Guidelines](#submission-guidelines) 9 | - [Additional Resources](#additional-resources) 10 | 11 | 12 | ## Code of Conduct 13 | Help us keep dgeni open and inclusive. Please read and follow our [Code of Conduct][coc]. 14 | 15 | 16 | ## Getting Started 17 | 18 | 1. Fork the repository 19 | 2. Create a topic branch off `master` 20 | 2. Run the tests 21 | 1. `npm install` 22 | 2. `npm test` 23 | 3. Good to go! Head over to the [Roadmap](roadmap) to see what is coming up. 24 | Or submit a [feature request or bug](issues). 25 | 26 | [The dgeni project alone is not that useful - we probably need to provide information about getting 27 | dgeni-packages and dgeni-example then linking them with npm for development.] 28 | 29 | ## Found a bug? 30 | 31 | Please open an [issue in Github](issues) for the relevant project. Problems with specific processors are more 32 | likely to be related to issues in the [dgeni-packages project](dgeni-packages). 33 | 34 | If you are feeling confident then you could submit a Pull Request with a fix. See [Making Changes](#making-changes) below. 35 | 36 | ##Making Changes 37 | 38 | Before you make a change to dgeni, check that there is not already a pull request in the pipeline. 39 | If the change is reasonably large then it is best to discuss it in a [GitHub Issue](issue) to ensure 40 | that you hard work will not be wasted. 41 | 42 | Any changes to dgeni must follow our coding conventions, be accompanied by appropriate unit tests and documentation. You must also sign our Contributor License Agreement. 43 | 44 | 45 | ### Coding Conventions 46 | 47 | To ensure consistency throughout the source code, keep these rules in mind as you are working: 48 | 49 | * All features or bug fixes **must be tested** by one or more unit tests. 50 | * All public API methods **must be documented**. 51 | * We generally follow the rules contained in [Google's JavaScript Style Guide][js-style-guide]: 52 | * Wrap all code at **100 characters**. 53 | 54 | 55 | ### Signing the CLA 56 | 57 | Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code 58 | changes to be accepted, the CLA must be signed. It's a quick process, we promise! 59 | 60 | * For individuals we have a [simple click-through form][individual-cla]. 61 | * For corporations we'll need you to 62 | [print, sign and one of scan+email, fax or mail the form][corporate-cla]. 63 | 64 | ### Git Commit Guidelines 65 | 66 | We have very precise rules over how our git commit messages can be formatted. This leads to **more 67 | readable messages** that are easy to follow when looking through the **project history**. But also, 68 | we use the git commit messages to generate the [CHANGELOG](changelog). 69 | 70 | #### Commit Message Format 71 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special 72 | format that includes a **type**, a **scope** and a **subject**: 73 | 74 | ``` 75 | (): 76 | 77 | 78 | 79 |