@tenphi/cookbook 0.20.5 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/component-styles.md +14 -9
- package/docs/configuration.md +1 -1
- package/docs/custom-components.md +1 -3
- package/docs/es/index.md +13 -15
- package/docs/index.md +32 -24
- package/docs/ja/index.md +13 -15
- package/docs/migration.md +22 -0
- package/docs/ru/index.md +13 -15
- package/docs/theme-and-components.md +6 -7
- package/docs/zh/index.md +13 -15
- package/package.json +3 -3
package/docs/component-styles.md
CHANGED
|
@@ -192,7 +192,7 @@ it stays complete when a surface changes.
|
|
|
192
192
|
#### Search
|
|
193
193
|
|
|
194
194
|
* `Search`: `Status`, `Dialog`, `CloseIcon`, `OpenDialog`, `EnteredDialog`, `Backdrop`, `EnteredBackdrop`, `Frame`, `Container`, `Close`, `HoverClose`, `ActiveClose`
|
|
195
|
-
* `SearchResults`: `UI`, `Form`, `Drawer`, `Input`, `Clear`, `Results`, `Result`, `ResultLink`, `SearchIcon`, `ClearIcon`, `SuppressedClear`, `Message`, `List`, `Title`, `Excerpt`, `NestedResult`, `Match`, `More`, `HoverMore`
|
|
195
|
+
* `SearchResults`: `UI`, `Form`, `Field`, `EngineControls`, `Drawer`, `Input`, `Clear`, `Results`, `Result`, `ResultLink`, `SearchIcon`, `ClearIcon`, `SuppressedClear`, `Message`, `List`, `Title`, `Excerpt`, `NestedResult`, `Match`, `More`, `HoverMore`
|
|
196
196
|
|
|
197
197
|
<!-- component-anatomy:end -->
|
|
198
198
|
|
|
@@ -232,11 +232,10 @@ same.
|
|
|
232
232
|
|
|
233
233
|
Register custom names and their partial Tasty objects in `theme.customStyles`.
|
|
234
234
|
Built-in names belong in `theme.styles` and reject misspelled sub-elements.
|
|
235
|
-
Custom names can also target a matching user-authored `data-tasty-anatomy` attribute.
|
|
236
235
|
The name must match the string passed to `defineComponent()` or
|
|
237
|
-
`resolveComponentStyles()
|
|
236
|
+
`resolveComponentStyles()`. A production
|
|
238
237
|
build warns when a configured custom name has no matching component style
|
|
239
|
-
resolver
|
|
238
|
+
resolver.
|
|
240
239
|
|
|
241
240
|
The default renderer runs Tasty in Astro extract mode. Direct components and
|
|
242
241
|
the remaining document/vendor bridge styles are collected into shared static
|
|
@@ -352,7 +351,8 @@ theme: {
|
|
|
352
351
|
`Document` owns resets, base typography, generic controls, responsive media,
|
|
353
352
|
and accessibility utilities. `MainPane` and `MainContent` own the content
|
|
354
353
|
layout. `Markdown` owns prose, lists, links, quotations, and disclosure
|
|
355
|
-
anatomy. `Search` owns the dialog; `SearchResults` owns the
|
|
354
|
+
anatomy. `Search` owns the dialog; `SearchResults` owns the search field and
|
|
355
|
+
Pagefind results UI.
|
|
356
356
|
`MarkdownAlert` styles rendered alert blockquotes; `Card`, `Callout`, and
|
|
357
357
|
`Steps` style Cookbook components.
|
|
358
358
|
|
|
@@ -393,7 +393,12 @@ it cannot access its parent's origin. Configure its size with
|
|
|
393
393
|
using that directive, authored previews must use style blocks rather than style
|
|
394
394
|
attributes.
|
|
395
395
|
|
|
396
|
-
Search uses an owned, keyboard-accessible dialog
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
396
|
+
Search uses an owned, keyboard-accessible dialog and server-rendered input so
|
|
397
|
+
the first opening can focus the field immediately on mobile. Pagefind's indexing
|
|
398
|
+
and results UI load lazily. Customize the field with `SearchResults.Field`,
|
|
399
|
+
`Input`, and `Clear`; `EngineControls` hides Pagefind's duplicate controls.
|
|
400
|
+
Closing waits for the dialog's fade transition, with reduced motion respected.
|
|
401
|
+
The fullscreen mobile dialog has no dimmed or blurred backdrop; the backdrop
|
|
402
|
+
transition applies only to wider layouts.
|
|
403
|
+
The Pagefind sizing adapter prevents inline layout declarations and is checked
|
|
404
|
+
against the pinned UI version during builds.
|
package/docs/configuration.md
CHANGED
|
@@ -262,9 +262,7 @@ useGlobalStyles(
|
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
`defineComponent` and `resolveComponentStyles` read the same `theme.customStyles`
|
|
265
|
-
configuration; user configuration contains only the properties to change.
|
|
266
|
-
`data-tasty-anatomy` attribute. That attribute remains available for older
|
|
267
|
-
components using the compatibility bridge described above.
|
|
265
|
+
configuration; user configuration contains only the properties to change. Each custom style name must match a call to one of these helpers.
|
|
268
266
|
|
|
269
267
|
## Linting custom styles
|
|
270
268
|
|
package/docs/es/index.md
CHANGED
|
@@ -6,7 +6,7 @@ seo:
|
|
|
6
6
|
title: Cookbook — documentación junto al código y adaptada a tu producto
|
|
7
7
|
hero:
|
|
8
8
|
title: Documentación que permanece junto al código.
|
|
9
|
-
tagline:
|
|
9
|
+
tagline: Cookbook es un kit de herramientas de documentación para Astro. Convierte el Markdown de tu repositorio o un paquete npm publicado en un sitio estático con búsqueda, y adapta los colores, la tipografía y los componentes a tu producto.
|
|
10
10
|
image:
|
|
11
11
|
html: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14" fill="currentColor"/><path fill="#fff" d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"/><path fill="#fff" d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"/></svg>'
|
|
12
12
|
actions:
|
|
@@ -20,6 +20,18 @@ sidebar:
|
|
|
20
20
|
label: Introducción
|
|
21
21
|
order: 1
|
|
22
22
|
---
|
|
23
|
+
## Qué incluye
|
|
24
|
+
|
|
25
|
+
* **Usa la documentación que ya tienes.** Lee Markdown, MDX y recursos locales directamente desde tu repositorio, o genera el sitio a partir de un paquete npm fijado por versión e integridad. [Fuentes de contenido](../content-sources.md).
|
|
26
|
+
* **Genera una referencia de API.** Convierte una especificación OpenAPI local en un resumen con búsqueda y una página por operación, con parámetros, cuerpos de petición, respuestas y ejemplos. [Referencias OpenAPI](../content-sources.md#openapi-references).
|
|
27
|
+
* **Búsqueda integrada.** Pagefind indexa las páginas y los encabezados localmente, con un atajo de teclado y recursos de búsqueda que se cargan cuando hacen falta. [Búsqueda](../site-navigation.md#search).
|
|
28
|
+
* **Navegación para documentación que crece.** Organiza secciones con pestañas y barras laterales agrupadas, añade índices de página y enlaces anterior/siguiente, y ofrece un menú de navegación móvil. [Búsqueda y navegación](../site-navigation.md).
|
|
29
|
+
* **Componentes para documentación técnica.** Usa pestañas, avisos, tarjetas, pasos, grupos de código, código resaltado con controles de copia y ejemplos interactivos aislados en MDX. [Componentes de contenido](../authoring.mdx).
|
|
30
|
+
* **Un tema adaptado a tu producto.** Configura colores de marca, paletas semánticas, fuentes, tipografía y partes de componentes con [Tasty](../upstream/tasty/README.md) y [Glaze](../upstream/glaze/README.md). Los modos claro, oscuro y de alto contraste reciben CSS estático generado durante la compilación. [Tema y componentes](../theme-and-components.md).
|
|
31
|
+
* **Idiomas y versiones.** Ofrece páginas traducidas y documentación versionada, con selectores que llevan a la página equivalente cuando existe. [Idiomas y versiones](../site-navigation.md#contents-languages-and-versions).
|
|
32
|
+
* **Comprobaciones antes de publicar.** Detecta enlaces rotos, recursos ausentes, rutas duplicadas y navegación inválida con errores que señalan el archivo de origen. Publica HTML prerenderizado en cualquier alojamiento estático. [Comprobaciones de calidad](../quality-checks.md).
|
|
33
|
+
* **Páginas listas para compartir y leer.** Publica URL canónicas, vistas previas para redes sociales, mapas del sitio, Markdown descargable y un índice `llms.txt` para agentes de programación. [Metadatos de publicación](../publishing.md).
|
|
34
|
+
|
|
23
35
|
## Empieza con tu repositorio
|
|
24
36
|
|
|
25
37
|
Ejecuta estos comandos en un proyecto que ya tenga un archivo `README.md` o un directorio `docs/`:
|
|
@@ -36,20 +48,6 @@ Cookbook lee los archivos donde ya están. También puedes [crear un sitio nuevo
|
|
|
36
48
|
|
|
37
49
|
Esta página procede de [docs/es/index.md](https://github.com/tenphi/cookbook/blob/main/docs/es/index.md). Una pequeña [aplicación Astro](https://github.com/tenphi/cookbook/tree/main/apps/reference) genera el sitio directamente desde el directorio `docs/` del repositorio. La navegación, la búsqueda, los controles de código, los enlaces de edición y las fechas de Git están disponibles para cualquier sitio Cookbook.
|
|
38
50
|
|
|
39
|
-
## Contenido y diseño a tu manera
|
|
40
|
-
|
|
41
|
-
### Conserva los archivos en su lugar
|
|
42
|
-
|
|
43
|
-
Usa los archivos Markdown y recursos locales de un repositorio sin copiarlos a un árbol de contenido de Astro. Cookbook también puede leer especificaciones OpenAPI o la documentación de un paquete npm fijado por versión e integridad. [Explora las fuentes de contenido](../content-sources.md).
|
|
44
|
-
|
|
45
|
-
### Adapta el aspecto del sitio
|
|
46
|
-
|
|
47
|
-
Empieza con un color de marca y configura paletas semánticas, fuentes, tipografía y partes de componentes mediante [Tasty](../upstream/tasty/README.md) y [Glaze](../upstream/glaze/README.md). Las personalizaciones parciales de `theme.styles` se combinan con los valores predeterminados de Cookbook antes de extraer el CSS. El navegador recibe CSS estático. [Explora el tema](../theme-and-components.md).
|
|
48
|
-
|
|
49
|
-
### Detecta problemas antes de publicar
|
|
50
|
-
|
|
51
|
-
Los enlaces rotos, recursos ausentes, rutas duplicadas y errores de navegación detienen la validación con mensajes que indican el archivo de origen. El resultado es HTML prerenderizado con búsqueda local, listo para cualquier alojamiento estático. [Consulta el flujo de validación](../quality-checks.md).
|
|
52
|
-
|
|
53
51
|
## Explora la guía
|
|
54
52
|
|
|
55
53
|
* [Primeros pasos](./getting-started.md) explica cómo empezar con repositorios, paquetes npm y proyectos Astro existentes.
|
package/docs/index.md
CHANGED
|
@@ -6,7 +6,7 @@ seo:
|
|
|
6
6
|
title: Cookbook — docs that stay with the code and fit your product
|
|
7
7
|
hero:
|
|
8
8
|
title: Documentation that stays with the code.
|
|
9
|
-
tagline:
|
|
9
|
+
tagline: Cookbook is an Astro documentation toolkit. Turn your repository Markdown or a published npm package into a searchable static site, with colors, typography, and components that fit your product.
|
|
10
10
|
image:
|
|
11
11
|
html: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14" fill="currentColor"/><path fill="#fff" d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"/><path fill="#fff" d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"/></svg>'
|
|
12
12
|
actions:
|
|
@@ -20,6 +20,37 @@ sidebar:
|
|
|
20
20
|
label: Overview
|
|
21
21
|
order: 1
|
|
22
22
|
---
|
|
23
|
+
## What you get
|
|
24
|
+
|
|
25
|
+
* **Use the docs you already have.** Read Markdown, MDX, and local assets
|
|
26
|
+
directly from your repository, or build from an npm package locked to an exact
|
|
27
|
+
version and integrity. [Content sources](./content-sources.md).
|
|
28
|
+
* **Generate an API reference.** Turn a local OpenAPI spec into a searchable
|
|
29
|
+
overview and a page for each operation, with parameters, request bodies,
|
|
30
|
+
responses, and examples. [OpenAPI references](./content-sources.md#openapi-references).
|
|
31
|
+
* **Search built in.** Pagefind indexes your pages and headings locally, with a
|
|
32
|
+
keyboard shortcut and search assets that load when needed.
|
|
33
|
+
[Search](./site-navigation.md#search).
|
|
34
|
+
* **Navigation for growing docs.** Organize sections with tabs and grouped
|
|
35
|
+
sidebars, add page contents and previous/next links, and give mobile readers a
|
|
36
|
+
navigation drawer. [Search and navigation](./site-navigation.md).
|
|
37
|
+
* **Components for technical writing.** Use tabs, callouts, cards, steps, code
|
|
38
|
+
groups, highlighted code with copy controls, and sandboxed interactive
|
|
39
|
+
previews in MDX. [Authoring components](./authoring.mdx).
|
|
40
|
+
* **A theme that fits your product.** Configure brand colors, semantic palettes,
|
|
41
|
+
fonts, typography, and individual component parts through [Tasty](./upstream/tasty/README.md) and [Glaze](./upstream/glaze/README.md).
|
|
42
|
+
Light, dark, and high-contrast appearances receive static CSS generated at
|
|
43
|
+
build time. [Theme and components](./theme-and-components.md).
|
|
44
|
+
* **Languages and versions.** Offer translated pages and versioned docs, with
|
|
45
|
+
selectors that take readers to the equivalent page when available.
|
|
46
|
+
[Languages and versions](./site-navigation.md#contents-languages-and-versions).
|
|
47
|
+
* **Checks before you ship.** Catch broken links, missing assets, duplicate
|
|
48
|
+
routes, and invalid navigation with errors that point to the source. Publish
|
|
49
|
+
prerendered HTML to any static host. [Quality checks](./quality-checks.md).
|
|
50
|
+
* **Pages ready to share and read.** Publish canonical URLs, social previews,
|
|
51
|
+
sitemaps, downloadable Markdown, and an `llms.txt` index for coding agents.
|
|
52
|
+
[Publishing metadata](./publishing.md).
|
|
53
|
+
|
|
23
54
|
## Start with your repository
|
|
24
55
|
|
|
25
56
|
Run this from a project that already has a `README.md` or `docs/` directory:
|
|
@@ -46,29 +77,6 @@ Use the language selector in the header to read this page and the getting-starte
|
|
|
46
77
|
guide in Spanish, Russian, Japanese, or Simplified Chinese. Other guides remain
|
|
47
78
|
in English for now.
|
|
48
79
|
|
|
49
|
-
## Content and design on your terms
|
|
50
|
-
|
|
51
|
-
### Keep the source where it belongs
|
|
52
|
-
|
|
53
|
-
Use a repository's Markdown and local assets without copying them into an Astro
|
|
54
|
-
content tree. Cookbook can also read OpenAPI specs or the documentation inside an
|
|
55
|
-
npm artifact pinned to its exact version and integrity.
|
|
56
|
-
[Explore content sources](./content-sources.md).
|
|
57
|
-
|
|
58
|
-
### Shape the site through configuration
|
|
59
|
-
|
|
60
|
-
Start with a brand color, then configure semantic palettes, fonts, typography,
|
|
61
|
-
and named component parts through [Tasty](./upstream/tasty/README.md) and
|
|
62
|
-
[Glaze](./upstream/glaze/README.md). Partial `theme.styles` overrides merge with
|
|
63
|
-
Cookbook's defaults before CSS extraction, so the browser receives static CSS.
|
|
64
|
-
[Explore the theme](./theme-and-components.md).
|
|
65
|
-
|
|
66
|
-
### Catch drift before publishing
|
|
67
|
-
|
|
68
|
-
Broken links, missing assets, duplicate routes, and invalid navigation fail with
|
|
69
|
-
source-aware errors. The result is prerendered HTML with local search, ready for
|
|
70
|
-
any static host. [See the validation workflow](./quality-checks.md).
|
|
71
|
-
|
|
72
80
|
## Explore the guide
|
|
73
81
|
|
|
74
82
|
* [Getting started](./getting-started.md) covers repositories, npm packages, and
|
package/docs/ja/index.md
CHANGED
|
@@ -6,7 +6,7 @@ seo:
|
|
|
6
6
|
title: Cookbook — コードとともに保ち、製品に合わせて整えるドキュメント
|
|
7
7
|
hero:
|
|
8
8
|
title: コードと同じ場所にあるドキュメント。
|
|
9
|
-
tagline:
|
|
9
|
+
tagline: Cookbook は Astro 向けのドキュメントツールキットです。リポジトリの Markdown や公開済み npm パッケージを、検索できる静的サイトに変換し、色、タイポグラフィ、コンポーネントを製品に合わせて調整できます。
|
|
10
10
|
image:
|
|
11
11
|
html: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14" fill="currentColor"/><path fill="#fff" d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"/><path fill="#fff" d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"/></svg>'
|
|
12
12
|
actions:
|
|
@@ -20,6 +20,18 @@ sidebar:
|
|
|
20
20
|
label: 概要
|
|
21
21
|
order: 1
|
|
22
22
|
---
|
|
23
|
+
## 主な機能
|
|
24
|
+
|
|
25
|
+
* **既存のドキュメントをそのまま利用。** Markdown、MDX、ローカルアセットをリポジトリから直接読み込むか、バージョンと整合性を固定した npm パッケージからサイトを構築できます。[コンテンツソース](../content-sources.md)。
|
|
26
|
+
* **API リファレンスを生成。** ローカルの OpenAPI 仕様から、検索可能な概要と操作ごとのページを作成します。パラメータ、リクエストボディ、レスポンス、例を掲載できます。[OpenAPI リファレンス](../content-sources.md#openapi-references)。
|
|
27
|
+
* **検索を標準搭載。** Pagefind がページと見出しをローカルで索引化します。キーボードショートカットで検索を開き、検索用アセットは必要なときに読み込まれます。[検索](../site-navigation.md#search)。
|
|
28
|
+
* **ドキュメントの成長に対応するナビゲーション。** タブやグループ化したサイドバーでセクションを整理し、ページ内目次、前後のページへのリンク、モバイル用のナビゲーションドロワーを提供できます。[検索とナビゲーション](../site-navigation.md)。
|
|
29
|
+
* **技術文書用のコンポーネント。** MDX でタブ、注意書き、カード、手順、コードグループ、コピー操作付きのコードハイライト、隔離された対話的プレビューを使えます。[執筆用コンポーネント](../authoring.mdx)。
|
|
30
|
+
* **製品に合ったテーマ。** [Tasty](../upstream/tasty/README.md) と [Glaze](../upstream/glaze/README.md) でブランドカラー、セマンティックなパレット、フォント、タイポグラフィ、コンポーネントの各パーツを設定できます。ライト、ダーク、高コントラストの各表示には、ビルド時に生成した静的 CSS が配信されます。[テーマとコンポーネント](../theme-and-components.md)。
|
|
31
|
+
* **言語とバージョン。** 翻訳ページやバージョン別のドキュメントを提供できます。切り替え先に対応するページがあれば、そのページへ移動します。[言語とバージョン](../site-navigation.md#contents-languages-and-versions)。
|
|
32
|
+
* **公開前の検証。** リンク切れ、アセットの欠落、重複したルート、無効なナビゲーションを、ソースの場所を示すエラーで検出します。事前生成した HTML は任意の静的ホストに公開できます。[品質チェック](../quality-checks.md)。
|
|
33
|
+
* **共有しやすく、読み取りやすいページ。** 正規 URL、ソーシャルプレビュー、サイトマップ、ダウンロード用 Markdown、コーディングエージェント向けの `llms.txt` 索引を公開できます。[公開メタデータ](../publishing.md)。
|
|
34
|
+
|
|
23
35
|
## リポジトリから始める
|
|
24
36
|
|
|
25
37
|
`README.md` または `docs/` ディレクトリがあるプロジェクトで、次を実行します。
|
|
@@ -36,20 +48,6 @@ Cookbook はファイルを現在の場所から読み込みます。[新しい
|
|
|
36
48
|
|
|
37
49
|
このページの原稿は [docs/ja/index.md](https://github.com/tenphi/cookbook/blob/main/docs/ja/index.md) にあります。小さな [Astro アプリ](https://github.com/tenphi/cookbook/tree/main/apps/reference) が、リポジトリの `docs/` ディレクトリを直接読み込んでサイトを構築します。ナビゲーション、検索、コード操作、編集リンク、Git の更新日時は、どの Cookbook サイトでも利用できます。
|
|
38
50
|
|
|
39
|
-
## コンテンツもデザインも自由に
|
|
40
|
-
|
|
41
|
-
### ソースファイルをそのまま使う
|
|
42
|
-
|
|
43
|
-
リポジトリの Markdown とローカルアセットを、Astro のコンテンツツリーへコピーせずに利用できます。OpenAPI 仕様や、バージョンと整合性を固定した npm パッケージ内のドキュメントも読み込めます。[コンテンツソースを見る](../content-sources.md)。
|
|
44
|
-
|
|
45
|
-
### 製品に合わせて外観を整える
|
|
46
|
-
|
|
47
|
-
ブランドカラーから始め、[Tasty](../upstream/tasty/README.md) と [Glaze](../upstream/glaze/README.md) でセマンティックなパレット、フォント、タイポグラフィ、コンポーネントの名前付きパーツを設定できます。`theme.styles` の部分的な上書きは、CSS の抽出前に Cookbook の既定値と統合されます。ブラウザには静的な CSS が届きます。[テーマを見る](../theme-and-components.md)。
|
|
48
|
-
|
|
49
|
-
### 公開前に問題を検出する
|
|
50
|
-
|
|
51
|
-
リンク切れ、アセットの欠落、重複したルート、無効なナビゲーションは、原因となるソースファイルを示すエラーになります。出力はローカル検索を備えた事前生成 HTML で、どの静的ホストにも配置できます。[検証の流れを見る](../quality-checks.md)。
|
|
52
|
-
|
|
53
51
|
## ガイドを探す
|
|
54
52
|
|
|
55
53
|
* [はじめに](./getting-started.md):リポジトリ、npm パッケージ、既存の Astro プロジェクト。
|
package/docs/migration.md
CHANGED
|
@@ -38,6 +38,28 @@ upgrade the site's Cookbook runtime or package-manager dependencies. Commit the
|
|
|
38
38
|
documentation lock separately when intentionally updating imported content.
|
|
39
39
|
Local Markdown needs no lock update.
|
|
40
40
|
|
|
41
|
+
## Upcoming theme API cleanup
|
|
42
|
+
|
|
43
|
+
Use canonical Glaze palette names throughout configuration and color
|
|
44
|
+
references. Replace `theme.palette.textSoft` with `theme.palette["text-soft"]`
|
|
45
|
+
and update any `base`, `target`, `bg`, or `fg` references to `"text-soft"`.
|
|
46
|
+
Camel-case palette names now fail validation.
|
|
47
|
+
|
|
48
|
+
The `colors` returned by `resolveColorTheme()` and `resolveDocsTheme()` also
|
|
49
|
+
use canonical names: `surface-2`, `surface-3`, `text-soft`, `accent-text`,
|
|
50
|
+
`accent-surface`, and `accent-surface-text`. Update property access to bracket
|
|
51
|
+
notation, for example `theme.colors["accent-text"]`.
|
|
52
|
+
|
|
53
|
+
Configure `theme.tokens` with `$name` keys, such as `$radius`. The old `--name`
|
|
54
|
+
configuration keys now fail validation; the emitted CSS custom properties
|
|
55
|
+
still use `--name`.
|
|
56
|
+
|
|
57
|
+
Custom styles no longer target `data-tasty-anatomy` attributes automatically.
|
|
58
|
+
For a custom component, use `defineComponent(name, options)`. For custom global
|
|
59
|
+
rules, pass `resolveComponentStyles(name, baseStyles)` to `useGlobalStyles()`.
|
|
60
|
+
Both merge `theme.customStyles[name]` into the complete base styles during
|
|
61
|
+
server rendering. See [custom components](./custom-components.md).
|
|
62
|
+
|
|
41
63
|
## 0.19.x to 0.20
|
|
42
64
|
|
|
43
65
|
Cookbook 0.20 generates a themed social preview image when a site has no
|
package/docs/ru/index.md
CHANGED
|
@@ -6,7 +6,7 @@ seo:
|
|
|
6
6
|
title: Cookbook — документация рядом с кодом и в стиле вашего продукта
|
|
7
7
|
hero:
|
|
8
8
|
title: Документация рядом с кодом.
|
|
9
|
-
tagline:
|
|
9
|
+
tagline: Cookbook — инструментарий для документации на Astro. Превратите Markdown-файлы репозитория или опубликованный npm-пакет в статический сайт с поиском и настройте цвета, типографику и компоненты под свой продукт.
|
|
10
10
|
image:
|
|
11
11
|
html: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14" fill="currentColor"/><path fill="#fff" d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"/><path fill="#fff" d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"/></svg>'
|
|
12
12
|
actions:
|
|
@@ -20,6 +20,18 @@ sidebar:
|
|
|
20
20
|
label: Обзор
|
|
21
21
|
order: 1
|
|
22
22
|
---
|
|
23
|
+
## Что вы получаете
|
|
24
|
+
|
|
25
|
+
* **Документация из существующих файлов.** Читайте Markdown, MDX и локальные ресурсы прямо из репозитория или собирайте сайт из npm-пакета, зафиксированного по версии и контрольной сумме. [Источники контента](../content-sources.md).
|
|
26
|
+
* **Генерация справочника API.** Превратите локальную спецификацию OpenAPI в обзор с поиском и отдельную страницу для каждой операции с параметрами, телами запросов, ответами и примерами. [Справочники OpenAPI](../content-sources.md#openapi-references).
|
|
27
|
+
* **Встроенный поиск.** Pagefind локально индексирует страницы и заголовки. Поиск открывается сочетанием клавиш, а его ресурсы загружаются по мере необходимости. [Поиск](../site-navigation.md#search).
|
|
28
|
+
* **Навигация для растущей документации.** Организуйте разделы с помощью вкладок и групп в боковой панели, добавьте оглавления и ссылки на предыдущую и следующую страницы, используйте выдвижное меню на мобильных устройствах. [Поиск и навигация](../site-navigation.md).
|
|
29
|
+
* **Компоненты для технических материалов.** Используйте вкладки, примечания, карточки, шаги, группы кода, подсветку с кнопками копирования и изолированные интерактивные примеры в MDX. [Компоненты для подготовки материалов](../authoring.mdx).
|
|
30
|
+
* **Тема в стиле вашего продукта.** Настройте фирменные цвета, семантические палитры, шрифты, типографику и части компонентов через [Tasty](../upstream/tasty/README.md) и [Glaze](../upstream/glaze/README.md). Светлый, тёмный и высококонтрастный режимы получают статический CSS, созданный при сборке. [Тема и компоненты](../theme-and-components.md).
|
|
31
|
+
* **Языки и версии.** Публикуйте переводы и версии документации. Переключатели открывают соответствующую страницу, если она существует. [Языки и версии](../site-navigation.md#contents-languages-and-versions).
|
|
32
|
+
* **Проверки перед публикацией.** Находите неработающие ссылки, отсутствующие ресурсы, дублирующиеся маршруты и неверную навигацию с указанием исходного файла. Размещайте заранее созданный HTML на любом статическом хостинге. [Проверки качества](../quality-checks.md).
|
|
33
|
+
* **Страницы для распространения и чтения.** Публикуйте канонические URL, превью для социальных сетей, карты сайта, Markdown для скачивания и индекс `llms.txt` для агентов программирования. [Метаданные публикации](../publishing.md).
|
|
34
|
+
|
|
23
35
|
## Начните со своего репозитория
|
|
24
36
|
|
|
25
37
|
Выполните эти команды в проекте, где уже есть `README.md` или каталог `docs/`:
|
|
@@ -36,20 +48,6 @@ Cookbook читает файлы на их текущем месте. Вы та
|
|
|
36
48
|
|
|
37
49
|
Текущая страница находится в [docs/ru/index.md](https://github.com/tenphi/cookbook/blob/main/docs/ru/index.md). Небольшое [приложение Astro](https://github.com/tenphi/cookbook/tree/main/apps/reference) собирает сайт прямо из каталога `docs/` в репозитории. Навигация, поиск, элементы управления кодом, ссылки на редактирование и даты из Git доступны любому сайту Cookbook.
|
|
38
50
|
|
|
39
|
-
## Ваши материалы и оформление
|
|
40
|
-
|
|
41
|
-
### Храните исходные файлы там, где им место
|
|
42
|
-
|
|
43
|
-
Используйте Markdown-файлы и локальные ресурсы репозитория без копирования в дерево контента Astro. Cookbook также умеет читать спецификации OpenAPI и документацию npm-пакета, зафиксированного по версии и контрольной сумме. [Подробнее об источниках контента](../content-sources.md).
|
|
44
|
-
|
|
45
|
-
### Настройте сайт под свой продукт
|
|
46
|
-
|
|
47
|
-
Начните с фирменного цвета, затем настройте семантические палитры, шрифты, типографику и именованные части компонентов с помощью [Tasty](../upstream/tasty/README.md) и [Glaze](../upstream/glaze/README.md). Частичные переопределения `theme.styles` объединяются со стандартными стилями Cookbook до извлечения CSS. В браузер отправляется статический CSS. [Подробнее о теме](../theme-and-components.md).
|
|
48
|
-
|
|
49
|
-
### Находите ошибки до публикации
|
|
50
|
-
|
|
51
|
-
Неработающие ссылки, отсутствующие ресурсы, дублирующиеся маршруты и неверная навигация вызывают ошибки с указанием исходного файла. Результат — предварительно созданный HTML с локальным поиском, готовый для любого статического хостинга. [Посмотрите порядок проверки](../quality-checks.md).
|
|
52
|
-
|
|
53
51
|
## Изучите руководство
|
|
54
52
|
|
|
55
53
|
* [Начало работы](./getting-started.md): репозитории, npm-пакеты и существующие проекты Astro.
|
|
@@ -84,7 +84,7 @@ theme: {
|
|
|
84
84
|
saturation: 0,
|
|
85
85
|
contrast: { wcag: [7, 10] }
|
|
86
86
|
},
|
|
87
|
-
|
|
87
|
+
"text-soft": {
|
|
88
88
|
base: "surface",
|
|
89
89
|
tone: [25, 10],
|
|
90
90
|
saturation: 0.05,
|
|
@@ -101,7 +101,7 @@ the second applies to high contrast. Use absolute tones for reading text:
|
|
|
101
101
|
`text` starts at tone 0 and `heading` at tone 4, giving headings only a slight
|
|
102
102
|
reduction in contrast. Glaze applies its tone boundaries in normal mode, so
|
|
103
103
|
body text is not pure black, then inverts the tones for dark mode. High-contrast
|
|
104
|
-
mode uses the full range. `
|
|
104
|
+
mode uses the full range. `text-soft` is reserved for secondary text.
|
|
105
105
|
`heading` follows an explicitly configured `text` declaration unless it has
|
|
106
106
|
its own declaration, preserving existing custom palettes.
|
|
107
107
|
Contrast requirements are minimum safeguards: Glaze preserves the authored
|
|
@@ -168,8 +168,8 @@ high-contrast modes. Configuration diagnostics and rendering use the same graph.
|
|
|
168
168
|
Missing references and cycles fail with the color name; layered configurations
|
|
169
169
|
resolve references after merging.
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Palette names use lowercase letters, digits, and hyphens, such as `text-soft`.
|
|
172
|
+
The names `current`, `constructor`, and `prototype` are reserved.
|
|
173
173
|
Declaring a built-in name intentionally overrides that role; use a project
|
|
174
174
|
prefix for additional roles to avoid future naming collisions.
|
|
175
175
|
|
|
@@ -218,7 +218,7 @@ directly to Tasty `#name` tokens. `COOKBOOK_PALETTE_NAMES`, exported from
|
|
|
218
218
|
| Area | Roles |
|
|
219
219
|
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
220
220
|
| Surfaces | `surface`, `header`, `overlay`, `surface-2`, `surface-3`, `surface-2-hover`, `surface-2-pressed`, `surface-3-hover`, `surface-3-pressed` |
|
|
221
|
-
| Reading | `text`, `heading`, `text-soft
|
|
221
|
+
| Reading | `text`, `heading`, `text-soft`, `text-muted`, `sidebar-text` |
|
|
222
222
|
| Brand and focus | `accent-text`, `accent-surface`, `accent-surface-text`, `accent-surface-subtle`, `accent-surface-2-subtle`, `logo-surface`, `logo-mark`, `focus` |
|
|
223
223
|
| Borders and effects | `border`, `border-strong`, `shadow`, `clear` |
|
|
224
224
|
| Status | `info`, `success`, `warning`, `danger`, each with `-text` and `-surface` variants |
|
|
@@ -258,8 +258,7 @@ check does not replace keyboard, screen-reader, and rendered-page testing.
|
|
|
258
258
|
|
|
259
259
|
Token names follow Tasty's
|
|
260
260
|
[token and unit syntax](./upstream/tasty/docs/dsl.md#built-in-units): `$name`
|
|
261
|
-
becomes the CSS custom property `--name`.
|
|
262
|
-
accepted for compatibility.
|
|
261
|
+
becomes the CSS custom property `--name`. Configure tokens with `$name` keys.
|
|
263
262
|
|
|
264
263
|
```ts
|
|
265
264
|
theme: {
|
package/docs/zh/index.md
CHANGED
|
@@ -6,7 +6,7 @@ seo:
|
|
|
6
6
|
title: Cookbook — 与代码保持同步、契合产品风格的文档
|
|
7
7
|
hero:
|
|
8
8
|
title: 与代码放在一起的文档。
|
|
9
|
-
tagline:
|
|
9
|
+
tagline: Cookbook 是一套 Astro 文档工具。将仓库中的 Markdown 或已发布的 npm 包转换为可搜索的静态站点,再根据产品调整颜色、字体排版和组件。
|
|
10
10
|
image:
|
|
11
11
|
html: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14" fill="currentColor"/><path fill="#fff" d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"/><path fill="#fff" d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"/></svg>'
|
|
12
12
|
actions:
|
|
@@ -20,6 +20,18 @@ sidebar:
|
|
|
20
20
|
label: 概览
|
|
21
21
|
order: 1
|
|
22
22
|
---
|
|
23
|
+
## 主要功能
|
|
24
|
+
|
|
25
|
+
* **直接使用现有文档。** 从仓库读取 Markdown、MDX 和本地资源,或使用已锁定版本和完整性校验值的 npm 包构建站点。[内容来源](../content-sources.md)。
|
|
26
|
+
* **生成 API 参考。** 将本地 OpenAPI 规范转换为可搜索的概览和每个操作的独立页面,展示参数、请求体、响应和示例。[OpenAPI 参考](../content-sources.md#openapi-references)。
|
|
27
|
+
* **内置搜索。** Pagefind 在本地为页面和标题建立索引,支持键盘快捷键,搜索资源按需加载。[搜索](../site-navigation.md#search)。
|
|
28
|
+
* **适应文档增长的导航。** 使用标签页和分组侧边栏组织章节,提供页内目录、上一页和下一页链接,以及移动端抽屉导航。[搜索与导航](../site-navigation.md)。
|
|
29
|
+
* **技术写作组件。** 在 MDX 中使用标签页、提示框、卡片、步骤、代码组、带复制功能的代码高亮,以及隔离运行的交互预览。[内容编写组件](../authoring.mdx)。
|
|
30
|
+
* **契合产品的主题。** 通过 [Tasty](../upstream/tasty/README.md) 和 [Glaze](../upstream/glaze/README.md) 配置品牌颜色、语义色板、字体、排版和组件的各个部分。浅色、深色和高对比度模式都使用构建时生成的静态 CSS。[主题与组件](../theme-and-components.md)。
|
|
31
|
+
* **语言与版本。** 提供翻译页面和不同版本的文档;切换时,如果存在对应页面,就会直接打开该页面。[语言与版本](../site-navigation.md#contents-languages-and-versions)。
|
|
32
|
+
* **发布前检查。** 检测无效链接、缺失资源、重复路由和错误的导航配置,并指出源文件位置。将预渲染 HTML 部署到任意静态托管服务。[质量检查](../quality-checks.md)。
|
|
33
|
+
* **便于分享和读取的页面。** 发布规范网址、社交预览、站点地图、可下载的 Markdown,以及供编程智能体使用的 `llms.txt` 索引。[发布元数据](../publishing.md)。
|
|
34
|
+
|
|
23
35
|
## 从你的仓库开始
|
|
24
36
|
|
|
25
37
|
在已有 `README.md` 或 `docs/` 目录的项目中运行:
|
|
@@ -36,20 +48,6 @@ Cookbook 会直接读取原位置的文件。你也可以[创建新站点](./get
|
|
|
36
48
|
|
|
37
49
|
你正在阅读的页面来自 [docs/zh/index.md](https://github.com/tenphi/cookbook/blob/main/docs/zh/index.md)。一个小型 [Astro 应用](https://github.com/tenphi/cookbook/tree/main/apps/reference) 直接从仓库根目录的 `docs/` 构建站点。导航、搜索、代码操作、编辑链接和 Git 更新时间都可用于任何 Cookbook 站点。
|
|
38
50
|
|
|
39
|
-
## 内容与设计由你决定
|
|
40
|
-
|
|
41
|
-
### 让源文件留在原处
|
|
42
|
-
|
|
43
|
-
直接使用仓库中的 Markdown 和本地资源,无须复制到 Astro 内容目录。Cookbook 还可以读取 OpenAPI 规范,或读取已锁定版本和完整性校验值的 npm 包中的文档。[了解内容来源](../content-sources.md)。
|
|
44
|
-
|
|
45
|
-
### 调整站点外观
|
|
46
|
-
|
|
47
|
-
从品牌颜色入手,再通过 [Tasty](../upstream/tasty/README.md) 和 [Glaze](../upstream/glaze/README.md) 配置语义色板、字体、排版以及组件的命名部分。`theme.styles` 中的局部覆盖会在提取 CSS 前与 Cookbook 的默认样式合并,浏览器只会收到静态 CSS。[了解主题](../theme-and-components.md)。
|
|
48
|
-
|
|
49
|
-
### 在发布前发现问题
|
|
50
|
-
|
|
51
|
-
无效链接、缺失资源、重复路由和错误的导航配置会产生包含源文件位置的错误。生成结果是带有本地搜索功能的预渲染 HTML,可部署到任意静态托管服务。[查看验证流程](../quality-checks.md)。
|
|
52
|
-
|
|
53
51
|
## 浏览指南
|
|
54
52
|
|
|
55
53
|
* [入门](./getting-started.md):仓库、npm 包和现有 Astro 项目的使用方法。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/cookbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Repository-native static documentation for Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"author": "Andrey Yamanov",
|
|
69
69
|
"license": "MIT",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@tenphi/docs": "0.
|
|
72
|
-
"@tenphi/renderer": "0.
|
|
71
|
+
"@tenphi/docs": "0.21.1",
|
|
72
|
+
"@tenphi/renderer": "0.21.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"astro": "^7.3.2"
|