/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
docs/components/CodeSnippet.astro
24 строки
640 B
Paweł Kuna
Generate SCSS and JS docs snippets from source markers (#2798)
05 авг 2026, 19:44
Не верифицирован
05 авг 2026, 19:44
9c4dc73
Код
Авторство
О чём код?
--- // Highlighted code block with a copy button — used by CodeDocs. import Icon from '@ui/Icon.astro' import { highlightCode } from '@shared/lib/code-example' interface Props { /** The code to display. */ code: string /** Shiki language used for highlighting. */ lang: string } const { code, lang } = Astro.props const highlighted = await highlightCode(code, lang) --- <div class="position-relative"> <a class="btn btn-icon btn-dark position-absolute m-2 top-0 end-0 z-3" data-clipboard-text={code}> <Icon name="clipboard" /> <Icon name="check" class="d-none" /> </a> <Fragment set:html={highlighted} /> </div>