Skip to content

Commit 82f5e7c

Browse files
feat: markdoc bucket for Lingo.dev CLI (#1186)
1 parent 15b479d commit 82f5e7c

11 files changed

Lines changed: 1249 additions & 0 deletions

File tree

.changeset/markdoc-support.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@lingo.dev/_spec": minor
3+
"lingo.dev": minor
4+
---
5+
6+
Add Markdoc support
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Introduction to Markdoc
3+
description: A comprehensive demonstration of Markdoc features and syntax
4+
author: Documentation Team
5+
version: 1.0
6+
---
7+
8+
# Introduction to Markdoc
9+
10+
Welcome to this **Markdoc demonstration** document. This file showcases various Markdoc features and syntax.
11+
12+
{% callout type="note" %}
13+
This is a sample document demonstrating Markdoc capabilities.
14+
{% /callout %}
15+
16+
## Basic Formatting
17+
18+
Markdoc supports standard Markdown features:
19+
20+
1. Ordered lists
21+
2. Unordered lists
22+
3. Text formatting like *italics* and **bold**
23+
24+
### Emphasis and Inline Code
25+
26+
You can emphasize text with various styles:
27+
28+
- Regular text
29+
- *Italic text*
30+
- **Bold text**
31+
- `inline code`
32+
33+
{% callout type="warning" %}
34+
Remember to test your documents before publishing.
35+
{% /callout %}
36+
37+
## Custom Tags {% #tags .section-highlight %}
38+
39+
Markdoc extends Markdown with custom tags:
40+
41+
{% table %}
42+
* Feature
43+
* Description
44+
---
45+
* Tags
46+
* Custom components using {% icon name="tag" /%} syntax
47+
---
48+
* Variables
49+
* Dynamic content with {% $variableName %}
50+
---
51+
* Attributes
52+
* IDs and classes for styling
53+
{% /table %}
54+
55+
### Code Examples
56+
57+
Here's a sample code block:
58+
59+
```javascript
60+
function greet(name) {
61+
return `Hello, ${name}!`;
62+
}
63+
64+
console.log(greet('World'));
65+
```
66+
67+
{% if $showExample %}
68+
This conditional content only appears when the variable is set.
69+
{% /if %}
70+
71+
### Configuration {% .code-section %}
72+
73+
Example configuration file:
74+
75+
```json
76+
{
77+
"version": 1.0,
78+
"settings": {
79+
"enabled": true,
80+
"options": ["option1", "option2"]
81+
}
82+
}
83+
```
84+
85+
## Document Structure
86+
87+
Good documentation follows clear organization:
88+
89+
{% list %}
90+
1. **Clear headings**: Use hierarchical structure
91+
2. **Descriptive titles**: Make sections easy to find
92+
3. **Examples**: Include practical demonstrations
93+
4. **Consistency**: Maintain uniform formatting
94+
{% /list %}
95+
96+
## Advanced Syntax
97+
98+
{% tabs %}
99+
{% tab title="Variables" %}
100+
Markdoc supports variables for dynamic content using the syntax {% $variableName %}.
101+
{% /tab %}
102+
103+
{% tab title="Conditionals" %}
104+
Use conditional tags to show or hide content based on variables.
105+
{% /tab %}
106+
107+
{% tab title="Attributes" %}
108+
Add IDs and classes to elements for styling and anchoring.
109+
{% /tab %}
110+
{% /tabs %}
111+
112+
## Common Patterns
113+
114+
{% accordion %}
115+
{% item title="How do I use variables?" %}
116+
Variables are inserted using the {% $variableName %} syntax and can be defined in your configuration.
117+
{% /item %}
118+
119+
{% item title="What are custom tags?" %}
120+
Custom tags extend Markdoc with component functionality using {% tagName /%} or {% tagName %}...{% /tagName %} syntax.
121+
{% /item %}
122+
123+
{% item title="Can I nest tags?" %}
124+
Yes, tags can be nested within other tags to create complex layouts.
125+
{% /item %}
126+
{% /accordion %}
127+
128+
## Sample Data
129+
130+
{% stats %}
131+
- **{% $itemCount %}** items in collection
132+
- **{% $pageCount %}** pages of documentation
133+
- **{% $updateTime %}** last updated
134+
{% /stats %}
135+
136+
---
137+
138+
*This is a demonstration document* showing various {% link href="/docs" %}Markdoc features{% /link %} in action.
139+
140+
**Need help?** Refer to the official documentation for detailed information.
141+
142+
{% badge color="blue" %}Example{% /badge %} This document demonstrates typical Markdoc usage patterns.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: Introducción a Markdoc
3+
description: Una demostración completa de las características y sintaxis de Markdoc
4+
author: Equipo de Documentación
5+
---
6+
7+
# Introducción a Markdoc
8+
9+
Bienvenido a este **documento de demostración de Markdoc** . Este archivo muestra varias características y sintaxis de Markdoc.
10+
11+
{% callout type="note" %}
12+
Este es un documento de muestra que demuestra las capacidades de Markdoc.
13+
{% /callout %}
14+
15+
## Formato básico
16+
17+
Markdoc admite funciones estándar de Markdown:
18+
19+
1. Listas ordenadas
20+
1. Listas no ordenadas
21+
1. Formato de texto como *cursiva* y **negrita**
22+
23+
### Énfasis y código en línea
24+
25+
Puedes enfatizar texto con varios estilos:
26+
27+
- Texto normal
28+
- *Texto en cursiva*
29+
- **Texto en negrita**
30+
- `inline code`
31+
32+
{% callout type="warning" %}
33+
Recuerda probar tus documentos antes de publicarlos.
34+
{% /callout %}
35+
36+
## Etiquetas personalizadas {% #tags .section-highlight %}
37+
38+
Markdoc extiende Markdown con etiquetas personalizadas:
39+
40+
{% table %}
41+
- Característica
42+
- Descripción
43+
---
44+
- Etiquetas
45+
- Componentes personalizados usando {% icon name="tag" /%} sintaxis
46+
---
47+
- Variables
48+
- Contenido dinámico con {% $variableName %}
49+
---
50+
- Atributos
51+
- IDs y clases para estilización
52+
{% /table %}
53+
54+
### Ejemplos de código
55+
56+
Aquí hay un bloque de código de ejemplo:
57+
58+
```javascript
59+
function greet(name) {
60+
return `Hello, ${name}!`;
61+
}
62+
63+
console.log(greet('World'));
64+
```
65+
66+
{% if $showExample %}
67+
Este contenido condicional solo aparece cuando la variable está configurada.
68+
{% /if %}
69+
70+
### Configuración {% .code-section %}
71+
72+
Archivo de configuración de ejemplo:
73+
74+
```json
75+
{
76+
"version": 1.0,
77+
"settings": {
78+
"enabled": true,
79+
"options": ["option1", "option2"]
80+
}
81+
}
82+
```
83+
84+
## Estructura del documento
85+
86+
La buena documentación sigue una organización clara:
87+
88+
{% list %}
89+
1. **Encabezados claros**: Utiliza estructura jerárquica
90+
1. **Títulos descriptivos**: Facilita la búsqueda de secciones
91+
1. **Ejemplos**: Incluye demostraciones prácticas
92+
1. **Consistencia**: Mantiene un formato uniforme
93+
{% /list %}
94+
95+
## Sintaxis avanzada
96+
97+
{% tabs %}
98+
{% tab title="Variables" %}
99+
Markdoc admite variables para contenido dinámico usando la sintaxis {% $variableName %}.
100+
{% /tab %}
101+
102+
{% tab title="Conditionals" %}
103+
Utiliza etiquetas condicionales para mostrar u ocultar contenido basado en variables.
104+
{% /tab %}
105+
106+
{% tab title="Attributes" %}
107+
Añade IDs y clases a los elementos para estilizar y anclar.
108+
{% /tab %}
109+
{% /tabs %}
110+
111+
## Patrones comunes
112+
113+
{% accordion %}
114+
{% item title="How do I use variables?" %}
115+
Las variables se insertan usando la sintaxis {% $variableName %} y pueden definirse en tu configuración.
116+
{% /item %}
117+
118+
{% item title="What are custom tags?" %}
119+
Las etiquetas personalizadas extienden Markdoc con funcionalidad de componentes usando la sintaxis {% tagName /%} o {% tagName %}...{% /tagName %}.
120+
{% /item %}
121+
122+
{% item title="Can I nest tags?" %}
123+
Sí, las etiquetas pueden anidarse dentro de otras etiquetas para crear diseños complejos.
124+
{% /item %}
125+
{% /accordion %}
126+
127+
## Datos de muestra
128+
129+
{% stats %}
130+
- **{% $itemCount %}** elementos en colección
131+
- **{% $pageCount %}** páginas de documentación
132+
- **{% $updateTime %}** última actualización
133+
{% /stats %}
134+
135+
---
136+
137+
*Este es un documento de demostración* que muestra varias {% link href="/docs" %}características de Markdoc{% /link %} en acción.
138+
139+
**¿Necesitas ayuda?** Consulta la documentación oficial para información detallada.
140+
141+
{% badge color="blue" %}Ejemplo{% /badge %} Este documento demuestra patrones de uso típicos de Markdoc.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": 1.8,
3+
"locale": {
4+
"source": "en",
5+
"targets": [
6+
"es"
7+
]
8+
},
9+
"buckets": {
10+
"markdoc": {
11+
"include": [
12+
"./[locale]/example.markdoc"
13+
]
14+
}
15+
},
16+
"$schema": "https://lingo.dev/schema/i18n.json"
17+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
version: 1
2+
checksums:
3+
829674e11a9003549b66978e9b9c259a:
4+
heading-0: e19079d431e6b75a7d74e9c35639ea5a
5+
paragraph-0: 6757b797fc6d8c5ec5628f2619274e28
6+
paragraph-1: cc37b30c1aca11f64dc096264761368e
7+
paragraph-2: 50e2b92b9e711ae7758f8edcc1767102
8+
paragraph-3: 7bc573b304cf3a3414dd60f85eea4e36
9+
heading-1: 80779abd23399c676227609057093235
10+
paragraph-4: dfd87f4dde3d3e12fa6781966432465f
11+
item-0: ad9b7460be42c194e4771cf5281d5fd0
12+
item-1: 7d67473952061a571de034013964c5b6
13+
item-2: 91cffca4db2b901a3a0310ca2ab17ed9
14+
item-3: 56b97b82cc030c511847d1850af088a0
15+
item-4: 05dc0a811ee5b04941c826293471367d
16+
item-5: b1701133f7e62467e354a5fc526ea951
17+
heading-2: ff6e4ea57280ef5a42ebbe2cf9e3273b
18+
paragraph-5: 3e11ad608af106c15eed82d0e5d07712
19+
item-6: 2b1ab56131399aab1842fc3a81dd170e
20+
item-7: 8aedf70e351d5e5bb41ad66ad5ad18d8
21+
item-8: 1d0eccad0413a69da0d45c481aa754e9
22+
paragraph-6: e2a208aa62fd61821848519fa2abc211
23+
heading-3: 2761eb3f80a7da53d2cd899f33641e98
24+
paragraph-7: f341db1f3167bd074937f4399c3a1158
25+
th-0: 58f5f3f37862b6312a2f20ec1a1fd0e8
26+
th-1: e17686a22ffad04cc7bb70524ed4478b
27+
td-0: 97813c8ae67d69575fd04e35a88aed0c
28+
td-1: 117451569b718867c43b26d9ee3c4e8f
29+
td-2: e801c1eaca53c3aa702b747ed750fdd1
30+
td-3: ffd3eec5497af36d7b4e4185bad1313a
31+
td-4: 03d20ebc4966301ceba02199a24e02dc
32+
td-5: 86d0ae6fea0fbb119722ed3841f8385a
33+
td-6: 6d26991f040628f6002efa192bebb9c2
34+
heading-4: c8b45e4d54115ec279a2a6bde4b8a725
35+
paragraph-8: 933c68ed0598328263d1146641d0ab2c
36+
fence-0: ffdb698812040ead47e2039dfa22d9d7
37+
paragraph-9: fe471cd364c38cc79a7638b4a5ffb528
38+
heading-5: 4cbc75f1ae6830a190eb70628c4e4b54
39+
paragraph-10: bc6097c6af86133a3972bdb7a5343dd2
40+
fence-1: 31a1aab989ce9935c98e672182bffbbe
41+
heading-6: fe53e9de958685ab7c70d0a973c0a146
42+
paragraph-11: 69f77475eb830f1aa357f45db29f809e
43+
item-9: 90f2650aad06503472c46ce2612b9bc8
44+
item-10: a392737d0507463d40d1a8ff7502607c
45+
item-11: 7ed6e23ffae34636a417daf72b3a5b6b
46+
item-12: 0f93e7285aafb5c9929b29973f047026
47+
item-13: 9dacb7c56bc894e4bcad39f41265e3a0
48+
item-14: 496e1d7de5d7ff53f1af813a2ba46d7f
49+
item-15: 1bd4ec30282cfc0bdf7d5f3559990a1c
50+
item-16: 46c9eec1392a8d9f33170569e342bf7b
51+
heading-7: aa8d69ad456402762aeb915a67cfa698
52+
paragraph-12: 275eb44389d498dab93e38ed2889e5d9
53+
paragraph-13: f05f450fffcb17520c441ab9789f40ce
54+
paragraph-14: 915fe5ce4ded772d7844df222ebd9d3e
55+
paragraph-15: 3fae115ccac303b7cd908b49b8509217
56+
heading-8: 2fdf7c243436eba4bd1fe5ebd605ab96
57+
paragraph-16: fc0f77d45ad1e1764d2793706eb8a049
58+
paragraph-17: 6b4340d30988a714d34f0df9b3e18889
59+
paragraph-18: a59d117938ed65f303209da2b23ad35a
60+
paragraph-19: 28e8b27fb60b305a9caac04d8a92a038
61+
tagName-0: 0421db688c4d19bb542014733d553a43
62+
paragraph-20: 83951ea4c30a9b5057ff046e3a0bfc07
63+
paragraph-21: 8d2152d9e84fff4b3cd98d1fb305be8f
64+
heading-9: 6fe6489310962f6bc8ad13279106568b
65+
item-17: 0539fa4e65545d8a334abf6e0aee57ab
66+
item-18: a41ccc6f28eec377fb19a95b0b6db7a8
67+
item-19: 45aa24cef8a5d9b037d898917a862563
68+
paragraph-22: 59bf7b09d603b846c2cdd63cd878f20a
69+
paragraph-23: 9e30a94d9122095ac52a52ed2a864a26
70+
paragraph-24: 3b28910e425d79f9fd23ada6d6f33bff
71+
paragraph-25: 05d9c0fe6c099b1e20ebdb2320a28257
72+
paragraph-26: 04e7322f2d3ffb2d73ff2f64b71637c8
73+
paragraph-27: 65ef9814c2d07fd3d54d9f7bee1bba6c
74+
badge-0: c2d5d8760d96802e1b9a7bac290b1cfc
75+
paragraph-28: df1f854bcdb047d98a68cd39704a8981
76+
fm-attr-title: e19079d431e6b75a7d74e9c35639ea5a
77+
fm-attr-description: 82574f93a40b35a16a4c9fc5c2ab58cf
78+
fm-attr-author: a51ec27845d1fc7cf13c810f0e2d42ab

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
"@lingo.dev/_react": "workspace:*",
142142
"@lingo.dev/_sdk": "workspace:*",
143143
"@lingo.dev/_spec": "workspace:*",
144+
"@markdoc/markdoc": "^0.5.4",
144145
"@modelcontextprotocol/sdk": "^1.5.0",
145146
"@openrouter/ai-sdk-provider": "^0.7.1",
146147
"@paralleldrive/cuid2": "^2.2.2",

0 commit comments

Comments
 (0)