Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17e98ac

Browse files
chore(docs): bring in all templates from dgeni-packages
1 parent 752c989 commit 17e98ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+444
-31
lines changed

docs/config/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ module.exports = new Package('angularjs', [
6565

6666

6767
.config(function(templateFinder, renderDocsProcessor, gitData) {
68-
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates'));
68+
// We are completely overwriting the folders
69+
templateFinder.templateFolders.length = 0;
70+
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/examples'));
71+
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/ngdoc'));
72+
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/git'));
73+
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/app'));
6974
renderDocsProcessor.extraData.git = gitData;
7075
})
7176

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<html lang="en"{% if doc.example['ng-csp'] %} ng-csp{% endif %}>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Example - {$ doc.id $}</title>
6+
{% for stylesheet in doc.stylesheets %}<link href="{$ stylesheet.path $}" rel="stylesheet" type="text/css">
7+
{% endfor %}
8+
9+
{% for script in doc.scripts %}<script src="{$ script.path $}"></script>
10+
{% endfor %}
11+
12+
{% if doc.example.fixBase -%}
13+
<script type="text/javascript">
14+
angular.element(document.getElementsByTagName('head')).append(angular.element('<base href="' + window.location.pathname + '" />'));
15+
</script>
16+
{%- endif %}
17+
</head>
18+
<body {% if not doc.example['ng-app-included'] %}ng-app="{$ doc.example.module $}"{% endif %}>
19+
{$ doc.fileContents $}
20+
</body>
21+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "{$ doc.example.id $}",
3+
"files": [
4+
"index-production.html"
5+
{%- for file in doc.files %},
6+
"{$ file $}"{% endfor %}
7+
]
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
describe("{$ doc.description $}", function() {
2+
var rootEl;
3+
beforeEach(function() {
4+
rootEl = browser.rootEl;{% if doc['ng-app-included'] %}
5+
browser.rootEl = '[ng-app]';{% endif %}
6+
browser.get("{$ doc.basePath $}{$ doc.example.deployments[doc.deployment.name].outputPath $}");
7+
});
8+
{% if doc['ng-app-included'] %}afterEach(function() { browser.rootEl = rootEl; });{% endif %}
9+
{$ doc.innerTest $}
10+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{# Be aware that we need these extra new lines here or marked will not realise that the <div>
2+
is HTML and wrap each line in a <p> - thus breaking the HTML #}
3+
4+
5+
<div class="runnable-example"
6+
path="{$ doc.example.deployments.default.path $}"
7+
{%- for attrName, attrValue in doc.example.attributes %}
8+
{$ attrName $}="{$ attrValue $}"{% endfor %}>
9+
10+
{% for fileName, file in doc.example.files %}
11+
<div class="runnable-example-file" {% for attrName, attrValue in file.attributes %}
12+
{$ attrName $}="{$ attrValue $}"{% endfor %}>
13+
{% code -%}
14+
{$ file.fileContents $}
15+
{%- endcode %}
16+
</div>
17+
{% endfor %}
18+
19+
<iframe class="runnable-example-frame" src="{$ doc.example.deployments.default.outputPath $}" name="{$ doc.example.id $}"></iframe>
20+
</div>
21+
22+
23+
{# Be aware that we need these extra new lines here or marked will not realise that the <div>
24+
above is HTML and wrap each line in a <p> - thus breaking the HTML #}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(function(angular) {
2+
'use strict';
3+
{$ doc.fileContents $}
4+
})(window.angular);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{$ doc.fileContents $}

docs/config/templates/api/api.template.html renamed to docs/config/templates/git/api/api.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1 class="api-profile-header-heading">{$ doc.name $}</h1>
2828
<h2 id="known-issues">Known Issues</h2>
2929
{% for issue in doc.knownIssues -%}
3030
<div class="known-issue">
31-
{$ issue | marked $} {% if not loop.last %}<hr>{% endif %}
31+
{$ issue | marked $}
3232
</div>
3333
{% endfor -%}
3434
{% endif %}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<a href='https://github.com/angular/angular.js/edit/{$ git.version.branch $}/{$ doc.fileInfo.projectRelativePath $}?message=docs({$ (doc.area != "api") and (doc.area + "%2F") or "" $}{$ doc.name $})%3A%20describe%20your%20change...{$ (doc.area == "api") and ("#L" + doc.startingLine) or "" $}' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>
2+
3+
{% block content %}
4+
{% endblock %}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{% extends "base.template.html" %}
2+
3+
{% block content %}
4+
5+
{% block header %}
6+
<header class="api-profile-header">
7+
<h1 class="api-profile-header-heading">{$ doc.name $}</h1>
8+
<ol class="api-profile-header-structure naked-list step-list">
9+
{% block related_components %}{% endblock %}
10+
<li>
11+
- {$ doc.docType $} in module {$ doc.moduleDoc.id | link(doc.moduleDoc.name, doc.moduleDoc) $}
12+
</li>
13+
</ol>
14+
</header>
15+
{% endblock %}
16+
17+
{% block description %}
18+
<div class="api-profile-description">
19+
{$ doc.description | marked $}
20+
</div>
21+
{% endblock %}
22+
23+
{% if doc.knownIssues %}
24+
<h2 id="known-issues">Known Issues</h2>
25+
{% for issue in doc.knownIssues -%}
26+
<div class="known-issue">
27+
{$ issue | marked $}
28+
</div>
29+
{% endfor -%}
30+
{% endif %}
31+
32+
{% if doc.deprecated %}
33+
<fieldset class="deprecated">
34+
<legend>Deprecated API</legend>
35+
{$ doc.deprecated| marked $}
36+
</fieldset>
37+
{% endif %}
38+
39+
<div>
40+
{% block dependencies %}
41+
{%- if doc.requires %}
42+
<h2 id="dependencies">Dependencies</h2>
43+
<ul>
44+
{% for require in doc.requires %}<li>{$ require | link $}</li>{% endfor %}
45+
</ul>
46+
{% endif -%}
47+
{% endblock %}
48+
49+
{% block additional %}
50+
{% endblock %}
51+
52+
{% block examples %}
53+
{%- if doc.examples %}
54+
<h2 id="example">Example</h2>
55+
{%- for example in doc.examples -%}
56+
{$ example | marked $}
57+
{%- endfor -%}
58+
{% endif -%}
59+
{% endblock %}
60+
</div>
61+
62+
{% endblock %}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% block content %}
2+
<h1>
3+
{%- if doc.title -%}
4+
{$ doc.title $}
5+
{%- elif doc.moduleName -%}
6+
{$ doc.groupType | title $} components in {$ doc.moduleName | code $}
7+
{%- else -%}
8+
Pages
9+
{%- endif -%}
10+
</h1>
11+
12+
{$ doc.description | marked $}
13+
14+
<div class="component-breakdown">
15+
<div>
16+
<table class="definition-table">
17+
<tr>
18+
<th>Name</th>
19+
<th>Description</th>
20+
</tr>
21+
{% for page in doc.components %}
22+
<tr>
23+
<td>{$ page.id | link(page.name, page) $}</td>
24+
<td>{$ page.description | firstParagraph | marked $}</td>
25+
</tr>
26+
{% endfor %}
27+
</table>
28+
</div>
29+
</div>
30+
31+
{% endblock %}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{% import "lib/macros.html" as lib -%}
2+
{% extends "api/api.template.html" %}
3+
4+
{% block additional %}
5+
<h2>Directive Info</h2>
6+
<ul>
7+
{% if doc.scope %}<li>This directive creates new scope.</li>{% endif %}
8+
<li>This directive executes at priority level {$ doc.priority $}.</li>
9+
{% if doc.multiElement %}<li>This directive can be used as {@link $compile#-multielement- multiElement}</li>{% endif %}
10+
</ul>
11+
12+
{% block usage %}
13+
<h2 id="usage">Usage</h2>
14+
<div class="usage">
15+
{% if doc.usage %}
16+
{$ doc.usage | marked $}
17+
{% else %}
18+
<ul>
19+
{% if doc.restrict.element %}
20+
<li>as element:
21+
{% if doc.name.indexOf('ng') == 0 -%}
22+
(This directive can be used as custom element, but be aware of <a href="guide/ie">IE restrictions</a>).
23+
{%- endif %}
24+
{% code %}
25+
<{$ doc.name | dashCase $}
26+
{%- for param in doc.params %}
27+
{$ lib.directiveParam(param.alias or param.name, param.type, '="', '"') $}
28+
{%- endfor %}>
29+
...
30+
</{$ doc.name | dashCase $}>
31+
{% endcode %}
32+
</li>
33+
{% endif -%}
34+
35+
{%- if doc.restrict.attribute -%}
36+
<li>as attribute:
37+
{% code %}
38+
<{$ doc.element $}
39+
{%- for param in doc.params %}
40+
{$ lib.directiveParam(param.name, param.type, '="', '"') $}
41+
{%- endfor %}>
42+
...
43+
</{$ doc.element $}>
44+
{% endcode %}
45+
</li>
46+
{% endif -%}
47+
48+
{%- if doc.restrict.cssClass -%}
49+
<li>as CSS class:
50+
{% code %}
51+
{% set sep = joiner(' ') %}
52+
<{$ doc.element $} class="
53+
{%- for param in doc.params -%}
54+
{$ sep() $}{$ lib.directiveParam(param.name, param.type, ': ', ';') $}
55+
{%- endfor %}"> ... </{$ doc.element $}>
56+
{% endcode %}
57+
</li>
58+
{% endif -%}
59+
60+
{%- endif %}
61+
</div>
62+
{% endblock -%}
63+
64+
{%- if doc.animations %}
65+
<h2 id="animations">Animations</h2>
66+
{$ doc.animations | marked $}
67+
{$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.
68+
{%- endif -%}
69+
70+
{% include "lib/params.template.html" %}
71+
{% include "lib/events.template.html" %}
72+
{% endblock %}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% import "lib/macros.html" as lib -%}
2+
{% extends "api/api.template.html" %}
3+
4+
{% block additional %}
5+
<h2>Usage</h2>
6+
<h3>In HTML Template Binding</h3>
7+
{% if doc.usage %}
8+
{$ doc.usage | code $}
9+
{% else %}
10+
{% code -%}
11+
{{ {$ doc.name $}_expression | {$ doc.name $}
12+
{%- for param in doc.params %}{% if not loop.first %} : {$ param.name $}{% endif %}{% endfor -%}
13+
}}
14+
{%- endcode %}
15+
{% endif %}
16+
17+
<h3>In JavaScript</h3>
18+
{% code -%}
19+
{%- set sep = joiner(', ') -%}
20+
$filter('{$ doc.name $}')({% for param in doc.params %}{$ sep() $}{$ param.name $}{% endfor -%})
21+
{%- endcode %}
22+
23+
{% include "lib/params.template.html" %}
24+
{% include "lib/this.template.html" %}
25+
{% include "lib/returns.template.html" %}
26+
{% endblock %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "api/object.template.html" %}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% import "lib/macros.html" as lib -%}
2+
{% extends "api/directive.template.html" %}
3+
4+
{% block usage %}
5+
<h2>Usage</h2>
6+
{% code %}
7+
<input type="{$ doc.inputType $}"
8+
{%- for param in doc.params %}
9+
{$ lib.directiveParam(param.alias or param.name, param.type, '="', '"') $}
10+
{%- endfor %}>
11+
{% endcode %}
12+
{% endblock %}

0 commit comments

Comments
 (0)