1
1
# Dgeni Packages
2
2
3
- This repository contains a collection of dgeni packages that can be used by the dgeni documentation
3
+ This repository contains a collection of Dgeni packages that can be used by the Dgeni documentation
4
4
generator to create documentation from source code.
5
5
6
6
@@ -14,6 +14,7 @@ Out of the box there are the following packages:
14
14
* ngdoc - The angular.js specific tag-defs, processors and templates. This loads the jsdoc and
15
15
nunjucks packages for you.
16
16
* examples - Processors to support the runnable examples feature in the angular.js docs site.
17
+ * dgeni - Support for documenting Dgeni packages
17
18
18
19
## ` base ` Package
19
20
@@ -22,11 +23,13 @@ Out of the box there are the following packages:
22
23
* ` debugDumpProcessor ` - dump the current state of the docs array to a file (disabled by default)
23
24
* ` readFilesProcessor ` - used to load up documents from files. This processor can be configured to use a
24
25
set of ** file readers** . There are file readers in the ` jsdoc ` and ` ngdoc ` packages.
26
+ * ` computePathsProcessor ` - Computes the ` path ` and ` outputPath ` for documents using templates or helper
27
+ functions, on a per docType basis.
25
28
* ` renderDocsProcessor ` - render the documents into a property (` doc.renderedContent ` ) using a
26
29
` templateEngine ` , which must be provided separately - see ` nunjucks ` package.
27
30
* ` unescapeCommentsProcessor ` - unescape comment markers that would break the jsdoc comment style,
28
31
e.g. ` */ `
29
- * ` writeFilesProcessor ` - write the docs to disk
32
+ * ` writeFilesProcessor ` - write the docs that have an ` outputPath ` to disk
30
33
31
34
### Services
32
35
@@ -79,8 +82,6 @@ to render the documents into text, such as HTML or JS, based on templates.
79
82
80
83
* ` codeNameProcessor ` - infer the name of the document from the code following the document in the source
81
84
file.
82
- * ` computePathProcessor ` - infer the path to the document, used for writing the file and for navigation
83
- to the document in a web app.
84
85
* ` parseTagsProcessor ` - use a ` tagParser ` to parses the jsdoc tags in the document content.
85
86
* ` extractTagsProcessor ` - use a ` tagExtractor ` to extract information from the parsed tags.
86
87
* ` inlineTagsProcessor ` - Search the docs for inline tags that need to have content injected
@@ -92,10 +93,10 @@ The `jsdoc` package contains definitions for a number of standard jsdoc tags inc
92
93
` animations ` , ` constructor ` , ` class ` , ` classdesc ` , ` global ` , ` namespace ` , ` method ` , ` type ` and
93
94
` kind ` .
94
95
95
- ### Services
96
+ ### Services (Tag Transformations)
96
97
97
- This package provides a number of tagTransform services that are used in tag Definitions to transform
98
- the value of the tag from the string in the comment to something more meaningful in the doc.
98
+ This package provides a number of ** Transform ** services that are used in ** Tag Definitions** to transform
99
+ the value of the tag from the string in the tag description to something more meaningful in the doc.
99
100
100
101
* ` extractNameTransform ` - extract a name from a tag
101
102
* ` extractTypeTransform ` - extract a type from a tag
@@ -108,6 +109,11 @@ the value of the tag from the string in the comment to something more meaningful
108
109
** This package does not provide any templates nor a ` templateEngine ` to render templates (use the
109
110
` nunjucks ` package to add this).**
110
111
112
+ ### Tag Definitions
113
+
114
+ This package provides a minimal implementation of tags from the JSDoc project. They extract the name
115
+ and type from the tag description accordingly but do not fully implement all the JSDoc tag functionality.
116
+
111
117
## ` ngdoc ` Package
112
118
113
119
The ` ngdoc ` Package depends upon the ` jsdoc ` and ` nunjucks ` packages.
@@ -144,25 +150,34 @@ Generate documents for each group of components (by type) within a module
144
150
* ` computeIdProcessor ` -
145
151
Compute the id property of the doc based on the tags and other meta-data
146
152
147
- * ` computePathProcessor ` -
148
- Compute the path and outputPath for docs that do not already have them
149
-
150
153
* ` filterNgdocsProcessor ` -
151
154
For AngularJS we are only interested in documents that contain the @ngdoc tag. This processor
152
155
removes docs that do not contain this tag.
153
156
154
157
* ` collectPartialNames ` -
155
- Add all the docs to the partialNameMap
158
+ Add all the docs to the ` partialNameMap `
159
+
160
+
161
+ ### Tag Definitions
162
+
163
+ This package modifies and adds new tag definitions on top of those provided by the ` jsdoc ` package.
164
+
165
+
166
+ ### Inline Tag Definitions
167
+
168
+ * ` link ` - Process inline link tags (of the form {@link some/uri Some Title}), replacing them with
169
+ HTML anchors
156
170
157
171
158
172
### Services
159
173
160
- * ` getLinkInfo() `
161
- * ` getPartialNames() `
162
- * ` gettypeClass() `
163
- * ` moduleMap `
164
- * ` parseCodeName() `
165
- * ` patialNameMap `
174
+ * ` getLinkInfo() ` - Get link information to a document that matches the given url
175
+ * ` getPartialNames() ` - Get a list of all the partial code names that can be made from the provided
176
+ set of parts
177
+ * ` getTypeClass() ` - Get a CSS class string for the given type string
178
+ * ` moduleMap ` - A collection of modules keyed on the module name
179
+ * ` parseCodeName() ` - Parse the code name into parts
180
+ * ` partialNameMap ` - A map of partial names to docs
166
181
167
182
168
183
### Templates
@@ -181,10 +196,39 @@ templateEngine.config.tags = {
181
196
};
182
197
```
183
198
199
+ ### Rendering Filters
200
+
201
+ * ` code ` - Render a span of text as code
202
+ * ` link ` - Render a HTML anchor link
203
+ * ` typeClass ` - Render a CSS class for a given type
204
+
205
+ ### Rendering Tags
206
+
207
+ * ` code ` - Render a block of code
208
+
209
+
184
210
## ` examples ` Package
185
211
186
212
This package is a mix-in that provides functionality for working with examples in the docs.
187
213
214
+ Inside your docs you can markup inline-examples such as:
215
+
216
+ ```
217
+ Some text before the example
218
+
219
+ <example name="example-name">
220
+ <file name="index.html">
221
+ <div>The main HTML for the example</div>
222
+ </file>
223
+ <file name="app.js">
224
+ // Some JavaScript code to be included in the example
225
+ </file>
226
+ </example>
227
+
228
+ Some text after the example
229
+ ```
230
+
231
+
188
232
### Processors
189
233
190
234
* ` parseExamplesProcessor ` -
@@ -193,8 +237,15 @@ Parse the `<example>` tags from the content and add them to the `examples` servi
193
237
Add new docs to the docs collection for each example in the ` examples ` service that will be rendered
194
238
as files that can be run in the browser, for example as live in-place demos of the examples or for
195
239
e2e testing.
240
+ * ` generateProtractorTests ` - Generate a protractor test files from the e2e tests in the examples
241
+
242
+ ### Inline Tag Definitions
243
+
244
+ * ` runnableExample ` - Inject the specified runnable example into the doc
245
+
196
246
197
247
### Services
198
248
199
- * examples - a hash map holding each example by name
249
+ * ` exampleMap ` - a hash map holding each example by id, which is a unique id generated from the name
250
+ of the example
200
251
0 commit comments