Skip to content

Commit

Permalink
follow the MDN's definition
Browse files Browse the repository at this point in the history
  • Loading branch information
sator-imaging authored Mar 24, 2024
1 parent 9cd3e62 commit ec6c00c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .docfx/template/ManagedReference.extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.postTransform = function (model) {
if (!dumpDeprecatedOnce
&& model.children?.length > 0
&& model.children[0].children?.length > 0
&& model.children[0].children[0].isObsolete
&& model.children[0].children[0].isDeprecated
) {
dumpDeprecatedOnce = true;
console.log(JSON.stringify(model));
Expand Down Expand Up @@ -57,12 +57,12 @@ function updateTypeModelData(model) {
if (model.attributes) {
for (const attr of model.attributes) {
if (attr.type == 'System.ObsoleteAttribute') {
model.isObsolete = true;
model.isDeprecated = false;
model.isDeprecated = true;
model.isObsolete = false;
// check whether error option is set
if (attr.arguments) {
if (attr.arguments.length == 2) {
model.isDeprecated = attr.arguments[1].value;
model.isObsolete = attr.arguments[1].value;
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions .docfx/template/partials/class.header.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

{{!STMG swap order: summary and syntax code & deprecate flag}}
{{#syntax.content.0.value}}
<div class="codewrapper {{#isObsolete}}obsolete{{/isObsolete}} {{#isDeprecated}}deprecated{{/isDeprecated}}">
<div class="codewrapper {{#isDeprecated}}deprecated{{/isDeprecated}} {{#isObsolete}}obsolete{{/isObsolete}}">
<pre><code class="lang-csharp hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{/syntax.content.0.value}}
Expand Down Expand Up @@ -149,19 +149,19 @@

{{!STMG deprecate flag}}
<dt id="{{id}}">
{{#isDeprecated}}
{{#isObsolete}}
<code style='white-space: pre-line;'><del>{{syntax.content.0.value}}</del></code>
<span class="badge rounded-pill bg-danger">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{#isObsolete}}
<span class="badge rounded-pill bg-danger">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
{{#isDeprecated}}
<code style='white-space: pre-line;'>{{syntax.content.0.value}}</code>
<span class="badge rounded-pill bg-warning">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
<span class="badge rounded-pill bg-warning">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{syntax.content.0.value}}
{{/isObsolete}}
{{/isDeprecated}}
{{/isDeprecated}}
{{/isObsolete}}
</dt>

<dd>{{{summary}}}</dd>
Expand Down
22 changes: 11 additions & 11 deletions .docfx/template/partials/class.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
{{!STMG use h2 if separatePage & deprecate flag}}
{{#_splitReference}}<h2 id="{{id}}" data-uid="{{uid}}">{{/_splitReference}}
{{^_splitReference}}<h3 id="{{id}}" data-uid="{{uid}}">{{/_splitReference}}
{{#isDeprecated}}
{{#isObsolete}}
<del>{{name.0.value}}</del>
<span class="badge rounded-pill bg-danger">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{#isObsolete}}
<span class="badge rounded-pill bg-danger">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
{{#isDeprecated}}
{{name.0.value}}
<span class="badge rounded-pill bg-warning">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
<span class="badge rounded-pill bg-warning">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{name.0.value}}
{{/isObsolete}}
{{/isDeprecated}}
{{/isDeprecated}}
{{/isObsolete}}
{{#sourceurl}}<a class="header-action link-secondary" title="View source" href="{{sourceurl}}"><i class="bi bi-code-slash"></i></a>{{/sourceurl}}
{{#_splitReference}}</h2>{{/_splitReference}}
{{^_splitReference}}</h3>{{/_splitReference}}

{{!STMG swap order: summary and syntax code & deprecate flag}}
{{#syntax}}
<div class="codewrapper {{#isObsolete}}obsolete{{/isObsolete}} {{#isDeprecated}}deprecated{{/isDeprecated}}">
<div class="codewrapper {{#isDeprecated}}deprecated{{/isDeprecated}} {{#isObsolete}}obsolete{{/isObsolete}}">
<pre><code class="lang-csharp hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{/syntax}}
Expand Down
28 changes: 14 additions & 14 deletions .docfx/template/partials/titleBadge.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@

{{!STMG global namespace is empty}}
{{#name.0.value}}
{{#isDeprecated}}
{{#isObsolete}}
<del>{{name.0.value}}</del>
{{/isDeprecated}}
{{^isDeprecated}}
{{/isObsolete}}
{{^isObsolete}}
{{name.0.value}}
{{/isDeprecated}}
{{/isObsolete}}
{{/name.0.value}}
{{^name.0.value}}
<code>global::</code>
{{/name.0.value}}

{{#isDeprecated}}
<span class="badge rounded-pill bg-danger">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{#isObsolete}}
<span class="badge rounded-pill bg-warning">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
{{#isObsolete}}
<span class="badge rounded-pill bg-danger">Obsolete</span>
{{/isObsolete}}
{{^isObsolete}}
{{#isDeprecated}}
<span class="badge rounded-pill bg-warning">Deprecated</span>
{{/isDeprecated}}
{{^isDeprecated}}
{{#inPackage}}
<span class="badge rounded-pill bg-info">Package</span>
{{/inPackage}}
Expand Down Expand Up @@ -70,5 +70,5 @@
{{#inTypeAlias}}
<span class="badge rounded-pill bg-info">Type Alias</span>
{{/inTypeAlias}}
{{/isObsolete}}
{{/isDeprecated}}
{{/isDeprecated}}
{{/isObsolete}}
18 changes: 9 additions & 9 deletions .docfx/template/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ body[data-yaml-mime=ManagedReference] article dl.jumplist dd>*:first-child {

/** obsolete and deprecated */

.codewrapper.obsolete {
.codewrapper.deprecated {
__margin-top: 20px !important;
}

.codewrapper.obsolete::before {
content: "Obsolete";
.codewrapper.deprecated::before {
content: "Deprecated";
}

.codewrapper.obsolete.deprecated::before {
content: "Deprecated";
.codewrapper.deprecated.obsolete::before {
content: "Obsolete";
}

.codewrapper.obsolete::before {
.codewrapper.deprecated::before {
display: block;
position: absolute;
z-index: 310;
Expand All @@ -195,16 +195,16 @@ body[data-yaml-mime=ManagedReference] article dl.jumplist dd>*:first-child {
background: #f5f5f5;
}

.codewrapper.obsolete>pre>code {
.codewrapper.deprecated>pre>code {
background: #f5f5f5;
}

article h1+.facts+.codewrapper.obsolete::before {
article h1+.facts+.codewrapper.deprecated::before {
color: #000000;
background: var(--bs-warning-bg-subtle);
}

article h1+.facts+.codewrapper.obsolete>pre>code {
article h1+.facts+.codewrapper.deprecated>pre>code {
background: var(--bs-warning-bg-subtle);
}

Expand Down

0 comments on commit ec6c00c

Please sign in to comment.