feat(aio): support annotating JSON files with doc-regions
This change allows the example writer to add doc-region annotations to files that do not allow comments. This is done by creating a clone of the file and adding `.annotated` to the file name. This new file can contain inline `// ...` comments that can be used to annotate the doc regions. Example: **package.json** ``` { "name": "angular.io", "version": "0.0.0", "main": "index.js", "repository": "git@github.com:angular/angular.git", "author": "Angular", "license": "MIT", "private": true, } ```` **package.json.annotated** ``` { "name": "angular.io", // #docregion version "version": "0.0.0", // #enddocregion "main": "index.js", "repository": "git@github.com:angular/angular.git", "author": "Angular", "license": "MIT", "private": true, } ```` This region can then be referenced in examples just like any other doc region: ``` {@example 'package.json' region="version"} ```
This commit is contained in:

committed by
Igor Minar

parent
bee567afad
commit
3f8d5ac478
@ -19,7 +19,8 @@ regionParserImpl.regionMatchers = {
|
||||
html: html,
|
||||
css: blockC,
|
||||
yaml: inlineHash,
|
||||
jade: inlineCOnly
|
||||
jade: inlineCOnly,
|
||||
'json.annotated': inlineC
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user