Skip to content

Commit bf67a21

Browse files
authored
docs: strikethrough deprecated methods on api index (#2067)
1 parent a001ac5 commit bf67a21

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

docs/api/ApiIndex.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ onUnmounted(() => window.removeEventListener('keydown', apiSearchFocusHandler));
101101
</h3>
102102
<ul>
103103
<li v-for="h of item.headers" :key="h.anchor">
104-
<a :href="item.link + '#' + slugify(h.anchor)">{{ h.text }}</a>
104+
<a
105+
:href="item.link + '#' + slugify(h.anchor)"
106+
:class="{ deprecated: h.deprecated }"
107+
>{{ h.text }}</a
108+
>
105109
</li>
106110
</ul>
107111
</div>
@@ -166,6 +170,10 @@ h3 {
166170
transition: color 0.5s;
167171
}
168172

173+
.api-groups ul a.deprecated {
174+
text-decoration: line-through;
175+
}
176+
169177
.dark .api-groups ul a {
170178
font-weight: 400;
171179
}

docs/api/api-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
export interface APIHeader {
77
anchor: string;
88
text: string;
9+
deprecated: boolean;
910
}
1011

1112
/**

scripts/apidoc/apiDocsWriter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export function writeApiSearchIndex(pages: ModuleSummary[]): void {
203203
headers: module.methods.map((method) => ({
204204
anchor: method.name,
205205
text: method.name,
206+
deprecated: !!method.deprecated,
206207
})),
207208
})),
208209
},

0 commit comments

Comments
 (0)