Socket
Socket
Sign inDemoInstall

dgeni-packages

Package Overview
Dependencies
16
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

dgeni-packages


Version published
Maintainers
1
Created

Changelog

Source

v0.10.0-beta.1 25th July 2014

This is a major rearchitecture in line with changing to dgeni@0.4.0

There are numerous breaking changes surrounding this release and that of dgeni 0.4.0. The most important changes are

  • Configuration is done directly on the Processors and Services using Configuration Blocks, which are defined on Packages.

  • Everything is now dependency injected. Dgeni deals with instantiating Processors and Services but if you have properties on these that reference objects that should also be instantiated by the DI system then you can either ask for them to be injected into the config block:

    myPackage.config(function(processor1, someObj) {
      processor1.someProp = someObj;
    });
    

    use the injector directly:

    myPackage.config(function(processor1, injector) {
      processor1.someProp = injector.invoke(someObjFactory);
    });
    

    or use the getInjectables() helper service:

    myPackage.config(function(processor1, getInjectables) {
      processor1.someProp = getInjectables([someObjFactory, someOtherObjFactory]);
    });
    
  • All real processors have changed their names from dash-case to camelCase. This is because it is easier for their names to be valid JavaScript identifiers.

The most significant commits are:

  • fix(utils/code): encode HTML entities 13b99152
  • feat(base/debugDumpProcessor): add new processor 4c126792
  • feat(dgeni package): add initial package for documenting dgeni configurations 2bfa92b2
  • refact(parseExamplesProcessor): use Map() for example.files d926879a
  • fix(ngdoc/module tag-def): module is the first segment of the relative path 649f3051
  • fix(jsdoc/description tag-def): capture non-tag specific description ed68438d
  • feat(base/createDocMessage): add new service db11bc44
  • fix(*): doc.file is now doc.fileInfo.filePath fb600502
  • fix(ngdoc/collectPartialNamesProcessor): compute-id was renamed to computeIdProcessor 0158fb3b
  • fix(ngdoc/apiDocs): compute-path was renamed to computePathProcessor 9396f8c3
  • fix(ngdoc/apiDocsProcessor): compute-id was renamed to computeIdProcessor a83d7fc9
  • feat(ngdoc package): add getTypeClass service addebf63
  • refact(base/code): rename to encodeCodeBlock 2ae134ff
  • feat(getTypeClass): add new service 9c49ff9d
  • fix(ngdocFileReader): must have an explicit name 9c5dd397
  • test(nunjucks/templateEngine): templateEngine now relies on templateFinder 0269acf5
  • fix(nunjucks/marked custom tag): add service name for DI injection 9069c24f
  • refact(trimIndentation): convert to DI service 3ab6c9ed
  • fix(nunjucks/templateEngine): get the templateFolders from the templateFinder 8760aa7f
  • fix(inlineTagProcessor): inline tag definitions are optional 380dd474
  • fix(computePathProcessor): let writeFileProcessor deal with outputFolder 4057deb8
  • fix(jsdoc fileReader): file-readers need explicit names cad6d043
  • fix(jsdoc package): pseudo processors need to use $runBefore, etc. 5d32020f
  • fix(renderDocsProcessor): extra and helpers and optional 6bc1f16a
  • fix(readFilesProcessor): resolve include and exclude paths correctly f7ea5f78
  • refact(computePathProcessor): read outputFolder config from writeFilesProcessor 828b48c3
  • feat(api-docs): allow packageName to be specified as a tag 83c7e1fa
  • fix(jsdoc package): add trimWhitespaceTransform to package 75f52df1
  • refact(templateFinder): now call getFinder() to get the actual function e8c015d9
  • refact(jsdoc transforms): convert to DI services 5e92ff46
  • feat(ngdocs/moduleMap): add new service to support apiDocsProcessor et al 19a37a27
  • fix(runnableExample inline-tag): examples is now a Map d1857779
  • test(tag-defs): split out tests into separate files 9be421f7
  • fix(jsdoc package): jsdocFileReader should be loaded as a service 0c92271c
  • refact(ngdoc/tag-defs): convert to DI injectables d8512597
  • refact(ngdoc/link inline tag): convert to DI injectable 77e51df3
  • refact(ngdoc/code tag): convert to DI injectable 1d23cd4e
  • refact(ngdoc/code filter): convert to DI injectable 8c871b3d
  • feat(getLinkInfo): add new service 32aa8427
  • refact(partialNameMap): rename and convert to DI service 49acc949
  • feat(getPartialNames): add new service c6326268
  • feat(parseCodeName): add new service e02fe91c
  • refact(base/services): move code and trimIndentation to be DI services 00d17816
  • refact(examples service): move to its own service (as part of no-config update) 16d7819e
  • refact(renderDocsProcessor): templateEngine now has a getRenderer() method 4f50737b
  • refact(jsdoc): convert transforms to services 6dc5417f
  • refact(extractTagsProcessor): move computation into smaller functions fa1821c1
  • refact(tagExtractor): move into the extractTagsProcessor 49e51da4
  • refact(tagParser): move into the parseTagsProcessor efba4e9b
  • feat(read-files): add path exclusion and update to no-config 6853d759
  • refact(*): update to use new processor configuration style c54fd8d6
  • refact(*): use new dgeni Packages 128c2e61

Readme

Source

Dgeni Packages

This repository contains a collection of dgeni packages that can be used by the dgeni documentation generator to create documentation from source code.

Out of the box there are the following packages:

  • base - The minimal set of processors to get started with Dgeni
  • jsdoc - Tag parsing and extracting
  • nunjucks - The nunjucks template rendering engine. No longer in jsdoc - you must add this explicitly to your config or you will get Error: No provider for "templateEngine"! (Resolving: templateEngine)
  • ngdoc - The angular.js specific tag-defs, processors and templates. This loads the jsdoc and nunjucks packages for you.
  • examples - Processors to support the runnable examples feature in the angular.js docs site.

base Package

Processors

  • debugDumpProcessor - dump the current state of the docs array to a file (disabled by default)
  • readFilesProcessor - used to load up documents from files. This processor can be configured to use a set of file readers. There are file readers in the jsdoc and ngdoc packages.
  • renderDocsProcessor - render the documents into a property (doc.renderedContent) using a templateEngine, which must be provided separately - see nunjucks package.
  • unescapeCommentsProcessor - unescape comment markers that would break the jsdoc comment style, e.g. */
  • writeFilesProcessor - write the docs to disk

Services

  • createDocMessage - a helper for creating nice messages about documents (useful in logging and errors)
  • encodeDocBlock - convert a block of code into HTML
  • templateFinder - search folders using patterns to find a template that matches a given document.
  • trimIndentation - "intelligently" trim whitespace indentation from the start of each line of a block of text.

The template used to render the doc is computed by the templateFinder, which uses the first match from a set of patterns in a set of folders, provided in the configuration. This allows a lot of control to provide generic templates for most situations and specific templates for exceptional cases.

Here is an example of some standard template patterns:

templateFinder.templatePatterns = [
  '${ doc.template }',
  '${doc.area}/${ doc.id }.${ doc.docType }.template.html',
  '${doc.area}/${ doc.id }.template.html',
  '${doc.area}/${ doc.docType }.template.html',
  '${ doc.id }.${ doc.docType }.template.html',
  '${ doc.id }.template.html',
  '${ doc.docType }.template.html'
]

nunjucks Package

This package provides a nunjucks driven implementation of the templateEngine required by the base package renderDocsPocessor. The "nunjucks" JavaScript template tool-kit to generates HTML based on the data in each document. We have nunjucks templates, tags and filters that can render links and text as markdown and will highlight code.

Services

  • nunjucks-template-engine - provide a templateEngine that uses the Nunjucks template library to render the documents into text, such as HTML or JS, based on templates.

jsdoc Package

### File Readers:

  • jsdoc - can read documents from jsdoc style comments in source code files.

Processors

  • codeNameProcessor - infer the name of the document from the code following the document in the source file.
  • computePathProcessor - infer the path to the document, used for writing the file and for navigation to the document in a web app.
  • parseTagsProcessor - use a tagParser to parses the jsdoc tags in the document content.
  • extractTagsProcessor - use a tagExtractor to extract information from the parsed tags.
  • inlineTagsProcessor - Search the docs for inline tags that need to have content injected

Tag Definitions

The jsdoc package contains definitions for a number of standard jsdoc tags including: name, memberof, param, property, returns, module, description, usage, animations, constructor, class, classdesc, global, namespace, method, type and kind.

Services

This package provides a number of tagTransform services that are used in tag Definitions to transform the value of the tag from the string in the comment to something more meaningful in the doc.

  • extractNameTransform - extract a name from a tag
  • extractTypeTransform - extract a type from a tag
  • trimWhitespaceTransform - trim whitespace from before and after the tag value
  • unknownTagTransform - add an error to the tag if it is unknown
  • wholeTagTransform - Use the whole tag as the value rather than using a tag property

Templates

This package does not provide any templates nor a templateEngine to render templates (use the nunjucks package to add this).

ngdoc Package

The ngdoc Package depends upon the jsdoc and nunjucks packages.

File Readers

  • ngdoc - can pull a single document from an ngdoc content file.

Processors

  • apiDocsProcessor -

This processor runs computations that are specifically related to docs for API components. It does the following:

  • Computes the package name for the module (eg angular or angular-sanitize)
  • Collects up all documents that belong to the module
  • Attaches them to the module doc in the components property
  • Computes the URL path to the document in the docs app and the outputPath to the final output file
  • It relates documents about angular services to their corresponding provider document.

apiDocsProcessor has the following configuration options available (listed with the default values set):

apiDocsProcessor.apiDocsPath = undefined; // This is a required property that you must set
apiDocsProcessor.outputPathTemplate = '${area}/${module}/${docType}/${name}.html';
apiDocsProcessor.apiPathTemplate = '${area}/${module}/${docType}/${name}';
apiDocsProcessor.moduleOutputPathTemplate = '${area}/${name}/index.html';
apiDocsProcessor.modulePathTemplate = '${area}/${name}';
});
  • generateComponentGroupsProcessor - Generate documents for each group of components (by type) within a module

  • computeIdProcessor - Compute the id property of the doc based on the tags and other meta-data

  • computePathProcessor - Compute the path and outputPath for docs that do not already have them

  • filterNgdocsProcessor - For AngularJS we are only interested in documents that contain the @ngdoc tag. This processor removes docs that do not contain this tag.

  • collectPartialNames - Add all the docs to the partialNameMap

Services

  • getLinkInfo()
  • getPartialNames()
  • gettypeClass()
  • moduleMap
  • parseCodeName()
  • patialNameMap

Templates

This package provides a set of templates for generating an HTML file for each document: api, directive, error, filter function, input, module, object, overview, provider, service, type and a number to support rendering of the runnable examples.

You should be aware that because of the overlap in syntax between Nunjucks bindings and AngularJS bindings, the ngdoc package changes the default Nunjucks binding tags:

`` templateEngine.config.tags = { variableStart: '{$', variableEnd: '$}' };


## `examples` Package

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

### Processors

* `parseExamplesProcessor` -
Parse the `<example>` tags from the content and add them to the `examples` service
* `generateExamplesProcessor` -
Add new docs to the docs collection for each example in the `examples` service that will be rendered
as files that can be run in the browser, for example as live in-place demos of the examples or for
e2e testing.

### Services

* examples - a hash map holding each example by name

Keywords

FAQs

Last updated on 25 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc