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

Commit bb98d66

Browse files
docs(README): update with info about latest refactorings
1 parent 2e895f7 commit bb98d66

File tree

2 files changed

+69
-56
lines changed

2 files changed

+69
-56
lines changed

README.md

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dgeni Packages
22

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
44
generator to create documentation from source code.
55

66

@@ -14,6 +14,7 @@ Out of the box there are the following packages:
1414
* ngdoc - The angular.js specific tag-defs, processors and templates. This loads the jsdoc and
1515
nunjucks packages for you.
1616
* examples - Processors to support the runnable examples feature in the angular.js docs site.
17+
* dgeni - Support for documenting Dgeni packages
1718

1819
## `base` Package
1920

@@ -22,11 +23,13 @@ Out of the box there are the following packages:
2223
* `debugDumpProcessor` - dump the current state of the docs array to a file (disabled by default)
2324
* `readFilesProcessor` - used to load up documents from files. This processor can be configured to use a
2425
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.
2528
* `renderDocsProcessor` - render the documents into a property (`doc.renderedContent`) using a
2629
`templateEngine`, which must be provided separately - see `nunjucks` package.
2730
* `unescapeCommentsProcessor` - unescape comment markers that would break the jsdoc comment style,
2831
e.g. `*/`
29-
* `writeFilesProcessor` - write the docs to disk
32+
* `writeFilesProcessor` - write the docs that have an `outputPath` to disk
3033

3134
### Services
3235

@@ -79,8 +82,6 @@ to render the documents into text, such as HTML or JS, based on templates.
7982

8083
* `codeNameProcessor` - infer the name of the document from the code following the document in the source
8184
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.
8485
* `parseTagsProcessor` - use a `tagParser` to parses the jsdoc tags in the document content.
8586
* `extractTagsProcessor` - use a `tagExtractor` to extract information from the parsed tags.
8687
* `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
9293
`animations`, `constructor`, `class`, `classdesc`, `global`, `namespace`, `method`, `type` and
9394
`kind`.
9495

95-
### Services
96+
### Services (Tag Transformations)
9697

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.
99100

100101
* `extractNameTransform` - extract a name from a tag
101102
* `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
108109
**This package does not provide any templates nor a `templateEngine` to render templates (use the
109110
`nunjucks` package to add this).**
110111

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+
111117
## `ngdoc` Package
112118

113119
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
144150
* `computeIdProcessor` -
145151
Compute the id property of the doc based on the tags and other meta-data
146152

147-
* `computePathProcessor` -
148-
Compute the path and outputPath for docs that do not already have them
149-
150153
* `filterNgdocsProcessor` -
151154
For AngularJS we are only interested in documents that contain the @ngdoc tag. This processor
152155
removes docs that do not contain this tag.
153156

154157
* `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
156170

157171

158172
### Services
159173

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
166181

167182

168183
### Templates
@@ -181,10 +196,39 @@ templateEngine.config.tags = {
181196
};
182197
```
183198

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+
184210
## `examples` Package
185211

186212
This package is a mix-in that provides functionality for working with examples in the docs.
187213

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+
188232
### Processors
189233

190234
* `parseExamplesProcessor` -
@@ -193,8 +237,15 @@ Parse the `<example>` tags from the content and add them to the `examples` servi
193237
Add new docs to the docs collection for each example in the `examples` service that will be rendered
194238
as files that can be run in the browser, for example as live in-place demos of the examples or for
195239
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+
196246

197247
### Services
198248

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
200251

examples/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)