Skip to content

Commit 74c18f4

Browse files
Adds documentation for Spectacle Markdown Slide Layouts (#1303)
* Add base for MD layout options docs * Update markdown-layout-containers.md * Rename slide layout docs. * Update md-slide-layouts.md
1 parent 17092eb commit 74c18f4

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

docs/extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Extensions
3-
order: 8
4-
sidebar_position: 8
3+
order: 9
4+
sidebar_position: 9
55
---
66

77
# Third Party Extensions

docs/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: FAQ
3-
order: 9
4-
sidebar_position: 9
3+
order: 10
4+
sidebar_position: 10
55
---
66

77
# Frequently Asked Questions

docs/slide-layouts.md renamed to docs/jsx-slide-layouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Slide Layouts
2+
title: JSX Slide Layouts
33
order: 6
44
sidebar_position: 6
55
---

docs/md-slide-layouts.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Markdown Slide Layouts
3+
order: 7
4+
sidebar_position: 7
5+
---
6+
7+
# Markdown Slide Layouts
8+
9+
Spectacle supports a number of layout containers for use in your Markdown slides. These containers are designed to enable more complex layouts previously not doable in Markdown without the usage of importing JSX elements into MDX.
10+
11+
Spectacle uses `---` (three dashes) to delimit each slide in a Markdown file. Spectacle adds supports for a JSON-based configuration object with the slide delimiter in your Markdown file. This configuration object is used to define the layout of the slide. Currently, two types of layouts are support are `center` and `columns`.
12+
13+
:::info
14+
15+
Markdown-annotated slide layouts is available only with `.md` files. This feature is not available with `.mdx` files where you can use JSX-based layout primitives.
16+
17+
:::
18+
19+
## Columns Layout
20+
21+
The columns layout is used to create a row-based column layout. The columns layout is defined by the following JSON object:
22+
23+
```json
24+
{ "layout" : "columns" }
25+
```
26+
27+
Each column section is defined by a `::section` delimiter. The number of columns is determined by the number of `::section` annotations.
28+
29+
![Column Layout Example](https://res.cloudinary.com/formidablelabs/image/upload/c_scale,w_600/v1700171469/spectacle-assets/Screenshot_2023-11-16_at_3.49.29_PM.png)
30+
31+
```md
32+
33+
--- { "layout" : "columns" }
34+
35+
::section
36+
37+
![Gastly](gastly.png)
38+
39+
::section
40+
41+
![Haunter](haunter.png)
42+
43+
---
44+
45+
# Ghost-type Pokémon
46+
47+
The Ghost-type (ゴーストタイプ Gosuto taipu in Japanese) is one of the eighteen Pokémon elemental types.
48+
49+
```
50+
51+
This layout has the underlying JSX structure and divides each section into an array:
52+
53+
```jsx
54+
<FlexBox flexDirection="row" alignItems="start" flex={1}>
55+
{sectionsArray}
56+
</FlexBox>
57+
```
58+
59+
## Center Layout
60+
61+
The center layout is used to create a single column layout with the content centered. The center layout is defined by the following JSON object:
62+
63+
```json
64+
{ "layout" : "center" }
65+
```
66+
67+
![Center Layout Example](https://res.cloudinary.com/formidablelabs/image/upload/c_scale,w_600/v1700171467/spectacle-assets/Screenshot_2023-11-16_at_3.46.39_PM.png)
68+
69+
```md
70+
71+
--- { "layout" : "center" }
72+
73+
![Gengar](gengar.png)
74+
75+
---
76+
77+
# Gengar
78+
79+
Gengar is a dark purple, bipedal Pokémon with a roundish body. It has red eyes and a wide mouth that is usually curled into a sinister grin. Multiple spikes cover its back, and it has large pointed ears. Its arms and legs are short with three digits on both its hands and feet. It also has a stubby tail.
80+
81+
```
82+
83+
This layout has the underlying JSX structure and passes all the slide content as chidren:
84+
85+
```jsx
86+
<FlexBox justifyContent="center" alignItems="center" height="100%">
87+
{content}
88+
</FlexBox>
89+
```

docs/themes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Themes
3-
order: 7
4-
sidebar_position: 7
3+
order: 8
4+
sidebar_position: 8
55
---
66

77
# Theme System

0 commit comments

Comments
 (0)