Skip to content

Commit

Permalink
docs: add operator flag to operator functions (#6563)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakovljevic-mladen committed Oct 6, 2021
1 parent d837ee7 commit 861aa92
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs_app/src/styles/2-modules/_label.scss
Expand Up @@ -56,6 +56,10 @@ label.raised, .api-header label {
&.impure-pipe {
background-color: $brightred;
}

&.operator {
background-color: $brightred;
}
}

&.api-type-label {
Expand All @@ -69,4 +73,4 @@ label.raised, .api-header label {

}
}
}
}
1 change: 1 addition & 0 deletions docs_app/tools/transforms/angular-base-package/index.js
Expand Up @@ -36,6 +36,7 @@ module.exports = new Package('angular-base', [
.processor(require('./processors/fixInternalDocumentLinks'))
.processor(require('./processors/copyContentAssets'))
.processor(require('./processors/renderLinkInfo'))
.processor(require('./processors/checkOperator'))

// overrides base packageInfo and returns the one for the 'angular/angular' repo.
.factory('packageInfo', function () {
Expand Down
@@ -0,0 +1,11 @@
module.exports = function checkOperator() {
return {
$runAfter: ['generateApiListDoc'],
$runBefore: ['renderDocsProcessor'],
$process(docs) {
docs.forEach((doc) => {
doc.isOperator = !!(doc.originalModule && doc.originalModule.startsWith('internal/operators'));
});
},
};
};
1 change: 1 addition & 0 deletions docs_app/tools/transforms/templates/api/base.template.html
Expand Up @@ -26,6 +26,7 @@ <h1>{$ doc.name $}</h1>
{% if doc.experimental !== undefined %}<label class="api-status-label experimental">experimental</label>{% endif %}
{% if doc.stable !== undefined %}<label class="api-status-label stable">stable</label>{% endif %}
{% if doc.pipeOptions.pure === 'false' %}<label class="api-status-label impure-pipe">impure</label>{% endif %}
{% if doc.isOperator %}<label class="api-status-label operator">operator</label>{% endif %}
</header>
<aio-toc class="embedded"></aio-toc>

Expand Down

0 comments on commit 861aa92

Please sign in to comment.