Skip to content

Commit 60e2032

Browse files
committed
up
1 parent 2cce8a2 commit 60e2032

File tree

4 files changed

+202
-7
lines changed

4 files changed

+202
-7
lines changed

content/2.essentials/1.markdown-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Each title and subtitle creates an anchor and shows up automatically in the tabl
3737

3838
## Text Formatting
3939

40-
Nuxt UI Pro supports most markdown formatting options.
40+
Nuxt UI Pro supports most Markdown formatting options.
4141

4242
| Style | How to use | Result |
4343
|--------|--------------|------------|

content/2.essentials/2.code-blocks.md

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,44 @@ export default defineAppConfig({
102102

103103
::
104104

105+
#### Highlight Line
106+
107+
To highlight lines of code, add `{}` around the line numbers you want to highlight.
108+
109+
::code-preview{class="[&>div]:*:my-0 [&>div]:*:w-full"}
110+
111+
```ts [nuxt.config.ts]{4-5}
112+
export default defineAppConfig({
113+
ui: {
114+
icons: {
115+
copy: 'i-lucide-copy',
116+
copyCheck: 'i-lucide-copy-check'
117+
}
118+
}
119+
})
120+
```
121+
122+
#code
123+
124+
````mdc
125+
```ts [nuxt.config.ts]{4-5}
126+
export default defineAppConfig({
127+
ui: {
128+
icons: {
129+
copy: 'i-lucide-copy',
130+
copyCheck: 'i-lucide-copy-check'
131+
}
132+
}
133+
})
134+
```
135+
````
136+
137+
::
138+
139+
105140
## Advanced
106141

107-
### Code Group
142+
### CodeGroup
108143

109144
Wrap your code-blocks around a `code-group` component to group them together in a tabbed interface.
110145

@@ -160,7 +195,7 @@ bun add @nuxt/ui-pro@next
160195
Like the `ProsePre` component, the `CodeGroup` handles filenames, icons and copy button.
161196
::
162197

163-
### Code Tree
198+
### CodeTree
164199

165200
Wrap your code-blocks with a `code-tree` component in any particular order to display a tree view of your files.
166201

@@ -323,3 +358,101 @@ Check out the [deployment documentation](https://nuxt.com/docs/getting-started/d
323358
::note{to="https://ui3.nuxt.dev/getting-started/typography#codetree" target="_blank"}
324359
Learn more about the `code-tree` component.
325360
::
361+
362+
### `CodePreview`
363+
364+
To display a code block with he's preview, use the `code-preview` component. Write the code to be previewed in a the `default` slot and the actual code in the `code` slot.
365+
366+
::code-preview{class="[&>div]:*:my-0 [&>div]:*:w-full" label="Preview"}
367+
368+
::code-preview{class="[&>div]:*:my-0"}
369+
`inline code`
370+
371+
#code
372+
373+
```mdc
374+
`inline code`
375+
```
376+
377+
::
378+
379+
#code
380+
381+
````mdc
382+
::code-preview
383+
`inline code`
384+
385+
#code
386+
```mdc
387+
`inline code`
388+
```
389+
::
390+
````
391+
392+
::
393+
394+
### `CodeCollapse`
395+
396+
Use the `code-collapse` component to display a long code block in a collapsible format.
397+
398+
::code-preview{class="[&>div]:*:my-0 [&>div]:*:w-full"}
399+
400+
::code-collapse{class="[&>div]:my-0"}
401+
402+
```css [main.css]
403+
@import "tailwindcss";
404+
@import "@nuxt/ui-pro";
405+
406+
@theme {
407+
--font-sans: 'Public Sans', sans-serif;
408+
409+
--breakpoint-3xl: 1920px;
410+
411+
--color-green-50: #EFFDF5;
412+
--color-green-100: #D9FBE8;
413+
--color-green-200: #B3F5D1;
414+
--color-green-300: #75EDAE;
415+
--color-green-400: #00DC82;
416+
--color-green-500: #00C16A;
417+
--color-green-600: #00A155;
418+
--color-green-700: #007F45;
419+
--color-green-800: #016538;
420+
--color-green-900: #0A5331;
421+
--color-green-950: #052E16;
422+
}
423+
```
424+
425+
::
426+
427+
#code
428+
429+
````mdc
430+
::code-collapse
431+
432+
```css [main.css]
433+
@import "tailwindcss";
434+
@import "@nuxt/ui-pro";
435+
436+
@theme {
437+
--font-sans: 'Public Sans', sans-serif;
438+
439+
--breakpoint-3xl: 1920px;
440+
441+
--color-green-50: #EFFDF5;
442+
--color-green-100: #D9FBE8;
443+
--color-green-200: #B3F5D1;
444+
--color-green-300: #75EDAE;
445+
--color-green-400: #00DC82;
446+
--color-green-500: #00C16A;
447+
--color-green-600: #00A155;
448+
--color-green-700: #007F45;
449+
--color-green-800: #016538;
450+
--color-green-900: #0A5331;
451+
--color-green-950: #052E16;
452+
}
453+
```
454+
455+
::
456+
````
457+
458+
::

content/2.essentials/3.images-embeds.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Images and Embeds
3+
description: Add image, video, and other HTML elements
4+
---
5+
6+
## Image
7+
8+
### Using Markdown
9+
10+
::code-preview
11+
![Nuxt Social Image](https://nuxt.com/new-social.jpg)
12+
13+
#code
14+
15+
```mdc
16+
![Nuxt Social Image](https://nuxt.com/new-social.jpg)
17+
```
18+
19+
::
20+
21+
Or with your local images
22+
23+
::code-preview
24+
![Social Card](/social-card.png)
25+
26+
#code
27+
28+
```mdc
29+
![Social Card](/social-card.png)
30+
```
31+
32+
::
33+
34+
::note
35+
If [`@nuxt/image`](https://image.nuxt.com/get-started/installation) is installed, the `<NuxtImg>` component will be used instead of the native `img` tag.
36+
::
37+
38+
### Using Embeds
39+
40+
To get more customizability with images, you can also use embeds to add images
41+
42+
::code-preview
43+
<img src="https://nuxt.com/new-social.jpg" alt="Nuxt Social Image" height="150">
44+
45+
#code
46+
47+
```mdc
48+
<img src="https://nuxt.com/new-social.jpg" alt="Nuxt Social Image" height="150">
49+
```
50+
51+
::
52+
53+
## Embeds and HTML elements
54+
55+
You can also use embeds to add videos, iframes, etc.
56+
57+
::code-preview{class="[&>div]:*:w-full"}
58+
<iframe width="100%" height="100%" src="https://www.youtube-nocookie.com/embed/_eQxomah-nA?si=pDSzchUBDKb2NQu7" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="aspect-ratio: 16/9;" class="rounded-[calc(var(--ui-radius)*1.5)]"></iframe>
59+
60+
#code
61+
62+
```mdc
63+
<iframe width="100%" height="100%" src="https://www.youtube-nocookie.com/embed/_eQxomah-nA?si=pDSzchUBDKb2NQu7" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="aspect-ratio: 16/9;" class="rounded-[calc(var(--ui-radius)*1.5)]"></iframe>
64+
```
65+
66+
::

0 commit comments

Comments
 (0)