/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
adev/shared-docs/pipeline/shared/marked/test/renderer-context.mts
33 строки
1 KB
Matthieu Riegler
docs(docs-infra): prevent heading from linking symbols
15 янв 2026, 19:59
15 янв 2026, 19:59
a792315
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {initHighlighter} from '../../shiki.mjs'; import {RendererContext} from '../renderer.mjs'; /** * Shared renderer context that can be used in tests. * By default we don't set a highlighter because it is async to initialize. * * Use the separate async function `setHighlighter` to initialize the highlighter */ export const rendererContext: RendererContext = { markdownFilePath: '', highlighter: null!, apiEntries: { CommonModule: {moduleName: 'angular/common'}, bootstrapApplication: {moduleName: 'angular/platform-browser'}, ApplicationRef: {moduleName: 'angular/core'}, Router: {moduleName: 'angular/router'}, }, headerIds: new Map<string, number>(), disableAutoLinking: false, }; export async function setHighlighter() { rendererContext.highlighter = await initHighlighter(); }