mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(docs-infra): inline example in description (#59908)
fixes #59905 PR Close #59908
This commit is contained in:
committed by
Andrew Scott
parent
4a5c3df824
commit
0d88463a66
@@ -43,6 +43,7 @@ const MD_CTYPE_MAP: {[key in FileType]: string} = {
|
||||
export function interpolateCodeExamples(entries: DocEntry[]): void {
|
||||
for (const entry of entries) {
|
||||
entry.rawComment = replaceExample(entry.rawComment);
|
||||
entry.description = replaceExample(entry.description);
|
||||
|
||||
for (const jsdocTag of entry.jsdocTags) {
|
||||
jsdocTag.comment = replaceExample(jsdocTag.comment);
|
||||
|
||||
@@ -15,7 +15,7 @@ const tsMdBlock = (code: string) => '```angular-ts\n' + code + '\n```';
|
||||
const htmlMdBlock = (code: string) => '```angular-html\n' + code + '\n```';
|
||||
|
||||
const entriesBuilder = (comment: string): DocEntry[] => [
|
||||
{jsdocTags: [], rawComment: comment} as unknown as DocEntry,
|
||||
{jsdocTags: [], rawComment: comment, description: ''} as unknown as DocEntry,
|
||||
];
|
||||
|
||||
const getComment = (entries: DocEntry[]) => entries[0].rawComment;
|
||||
@@ -35,6 +35,7 @@ describe('interpolate_code_examples', () => {
|
||||
},
|
||||
],
|
||||
rawComment: `{@example dummy/jsdocs_raw.ts region='function'}`,
|
||||
description: `{@example dummy/jsdocs_raw.ts region='function'}`,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user