Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds documentation for Spectacle Markdown Slide Layouts #1303

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/extensions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Extensions
order: 8
sidebar_position: 8
order: 9
sidebar_position: 9
---

# Third Party Extensions
Expand Down
4 changes: 2 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: FAQ
order: 9
sidebar_position: 9
order: 10
sidebar_position: 10
---

# Frequently Asked Questions
Expand Down
2 changes: 1 addition & 1 deletion docs/slide-layouts.md → docs/jsx-slide-layouts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Slide Layouts
title: JSX Slide Layouts
order: 6
sidebar_position: 6
---
Expand Down
89 changes: 89 additions & 0 deletions docs/md-slide-layouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Markdown Slide Layouts
order: 7
sidebar_position: 7
---

# Markdown Slide Layouts

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.

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`.

:::info

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.

:::

## Columns Layout

The columns layout is used to create a row-based column layout. The columns layout is defined by the following JSON object:

```json
{ "layout" : "columns" }
```

Each column section is defined by a `::section` delimiter. The number of columns is determined by the number of `::section` annotations.

![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)

```md

--- { "layout" : "columns" }

::section

![Gastly](gastly.png)

::section

![Haunter](haunter.png)

---

# Ghost-type Pokémon

The Ghost-type (ゴーストタイプ Gosuto taipu in Japanese) is one of the eighteen Pokémon elemental types.

```

This layout has the underlying JSX structure and divides each section into an array:

```jsx
<FlexBox flexDirection="row" alignItems="start" flex={1}>
{sectionsArray}
</FlexBox>
```

## Center Layout

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:

```json
{ "layout" : "center" }
```

![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)

```md

--- { "layout" : "center" }

![Gengar](gengar.png)

---

# Gengar

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.

```

This layout has the underlying JSX structure and passes all the slide content as chidren:

```jsx
<FlexBox justifyContent="center" alignItems="center" height="100%">
{content}
</FlexBox>
```
4 changes: 2 additions & 2 deletions docs/themes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Themes
order: 7
sidebar_position: 7
order: 8
sidebar_position: 8
---

# Theme System
Expand Down
Loading