(
Slide {slideNumber} of {numberOfSlides}
)}>
```
--------------------------------
### Example: Columns Layout in Markdown
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/md-slide-layouts.md
Demonstrates a two-column layout using '::section' delimiters within a Markdown slide. The layout is configured with a JSON object.
```md
---
{ "layout" : "columns" }
::section

::section

---
# Ghost-type Pokémon
The Ghost-type (ゴーストタイプ Gosuto taipu in Japanese) is one of the eighteen Pokémon elemental types.
```
--------------------------------
### URQL Client Setup for Spectacle
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/md/slides.md
Sets up a URQL client and provides it to the application using the Provider component. This is typically used for integrating GraphQL data fetching into your presentation.
```jsx
import { createClient, Provider } from 'urql';
const client = createClient({ url: 'https://0ufyz.sse.codesandbox.io' });
const App = () => (
);
```
--------------------------------
### Install Puppeteer Chromium
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Installs Chromium for use with Puppeteer, required for some slower checks on `create-spectacle`. This is a one-time step.
```sh
# Option 1 -- Do nothing! If you have the Mac Chrome app, you can skip this step!
# Option 2 -- Install chromium
# Option 2.a -- Normal binary
$ pnpm puppeteer:install
```
--------------------------------
### Install Puppeteer for M1/M2 Macs
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Use this command if you are on an M1 or M2 Mac to install Puppeteer. It sets an experimental environment variable.
```shell
PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM=true pnpm puppeteer:install
```
--------------------------------
### Specify port with create-spectacle
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Use the --port or -p flag to define the port number the presentation will run on. Example uses port 8080.
```shell
yarn create spectacle -p 8080 my-presentation
```
--------------------------------
### Example: Center Layout in Markdown
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/md-slide-layouts.md
Demonstrates a centered layout for a slide using a JSON configuration object in Markdown. The content is automatically centered.
```md
---
{ "layout" : "center" }

---
# 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.
```
--------------------------------
### Stepper Output Over Slide Steps
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Illustrates the rendered HTML output of the Stepper component example across different slide steps. This shows how the content changes dynamically as the user navigates through the presentation.
```html
Hello, world!
The first stepper is not active. Step: -1 Value: undefined
The second stepper is not active. Step: -1 Value: undefined
Hello, world!
The first stepper is active. Step: 0 Value: foo
The second stepper is not active. Step: -1 Value: undefined
Hello, world!
The first stepper is active. Step: 1 Value: bar
The second stepper is not active. Step: -1 Value: undefined
Hello, world!
The first stepper is active. Step: 1 Value: bar
The second stepper is active. Step: 0 Value: baz
Hello, world!
The first stepper is active. Step: 1 Value: bar
The second stepper is active. Step: 0 Value: baz
Hello, world!
The first stepper is active. Step: 1 Value: bar
The second stepper is active. Step: 1 Value: quux
```
--------------------------------
### Stepper Component Usage Example
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Demonstrates how to use the Stepper component with two instances, each rendering different content based on their active state and step values. This is useful for creating multi-step interactions within a single slide.
```jsx
Hello, world!
{(value, step, isActive) =>
isActive
? `The first stepper is active. Step: ${step} Value: ${value}`
: `The first stepper is not active. Step: ${step} Value: ${value}`
}
{(value, step, isActive) =>
isActive
? `The second stepper is active. Step: ${step} Value: ${value}`
: `The second stepper is not active. Step: ${step} Value: ${value}`
}
```
--------------------------------
### Specify HTML lang attribute with create-spectacle
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Use the --lang or -l flag to set the HTML lang attribute for your presentation. Example uses 'en' for English.
```shell
yarn create spectacle -l en my-presentation
```
--------------------------------
### ThreeUpImage Slide Layout Example
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/react-slide-layouts.md
Utilize ThreeUpImage for slides displaying three images: a primary image and two secondary images (top and bottom). Ensure all required image pane properties are provided.
```jsx
```
--------------------------------
### VerticalImage Slide Layout Example
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/react-slide-layouts.md
Use VerticalImage for slides featuring a single portrait image alongside text content. Configure image position, title, and list items.
```jsx
```
--------------------------------
### Manual Release: Build
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Build necessary files for release using pnpm. This step prepares the project for publishing.
```sh
$ pnpm run build
```
--------------------------------
### Basic create-spectacle commands
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Use these commands to initiate the Spectacle project creation process with interactive prompts. Choose the command based on your preferred package manager.
```shell
yarn create spectacle # yarn
```
```shell
npm create spectacle # npm
```
```shell
npx create spectacle # using npx
```
```shell
pnpm create spectacle # using pnpm
```
--------------------------------
### Create Spectacle Project with CLI
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/index.mdx
Use the Create Spectacle CLI to quickly set up a new Spectacle project. This command initiates the project creation process, allowing you to choose from various templates.
```bash
$ npx create-spectacle
```
--------------------------------
### Deploy Website using SSH
Source: https://github.com/formidablelabs/spectacle/blob/main/website/README.md
Deploys the website using SSH. Assumes SSH is configured for deployment.
```bash
USE_SSH=true yarn deploy
```
--------------------------------
### Create Spectacle Project
Source: https://github.com/formidablelabs/spectacle/wiki/Spectacle-Roadmap
Instantiate a new Spectacle project using package managers. Supports passing creation options via flags or interactive prompts.
```shell
yarn create spectacle
npm create spectacle
pnpm create spectacle
```
--------------------------------
### Build Static Website Content
Source: https://github.com/formidablelabs/spectacle/blob/main/website/README.md
Generates static website content into the 'build' directory for hosting.
```bash
yarn build
```
--------------------------------
### Manual Release: Versioning
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Manually version packages using pnpm and a GitHub token. Ensure the GITHUB_TOKEN environment variable is set.
```sh
$ GITHUB_TOKEN= pnpm run version
```
--------------------------------
### Manual Release: Publish
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Publish packages to npm using changesets. Requires an OTP code for verification. Be aware of potential rate limiting errors.
```sh
$ pnpm changeset publish --otp=
```
--------------------------------
### Specify project name with create-spectacle
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Provide a project name as the main argument to set the name of your Spectacle presentation directory.
```shell
yarn create spectacle my-presentation
```
--------------------------------
### Build Libraries and UMD Distributions
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Builds the project's libraries and UMD distributions. Useful for verifying the webpack build.
```sh
# Build libraries and UMD distributions.
# Really only needed to double-check the webpack build still works.
$ pnpm run build
# ... or add in a `--watch` to watch & re-run the parts of the build that changed!
$ pnpm run build --watch
```
--------------------------------
### Watch create-spectacle CLI and Test Execution
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Watches the create-spectacle code and allows testing its CLI output. Use `node packages/create-spectacle/bin/cli.js -h` to see help.
```sh
# Watch create-spectacle code and test out (in two different terminals)
$ pnpm start:create-spectacle
$ node packages/create-spectacle/bin/cli.js -h
```
--------------------------------
### Markdown Slide Set
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/one-page/index.html
Shows how to create a set of slides using Markdown, separated by '---'.
```markdown
# This is the first slide of a Markdown Slide Set
---
# This is the second slide of a Markdown Slide Set
```
--------------------------------
### Run All Checks
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Executes all quality checks and tests for the project. This command should be run regularly during development.
```sh
# Run all checks. Re-run this command for your normal workflow.
$ pnpm run check
# ... or add in a `--watch` to watch & re-run checks for only what you change!
$ pnpm run check --watch
```
--------------------------------
### Run Unit Tests
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Executes the project's unit tests. Can be run with a `--watch` flag to re-run tests on file changes.
```sh
# Tests
$ pnpm run test
$ pnpm run test --watch
```
--------------------------------
### Using Theme Values in Components
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/themes.md
Demonstrates how components can accept theme value labels (e.g., 'primary') or raw CSS values (e.g., '#f00'). The 'backgroundColor' prop is mapped to the 'colors' theme key.
```jsx
```
--------------------------------
### Specify project type with create-spectacle
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Use the --type or -t flag to choose the project structure. Supported types are 'jsx', 'tsx', or 'onepage'.
```shell
yarn create spectacle -t onepage my-presentation
```
--------------------------------
### Bypass prompts with create-spectacle flags
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/create-spectacle/README.md
Provide all necessary flags (-t, -l, -p) along with the project name to bypass interactive prompts and configure the project non-interactively.
```shell
yarn create spectacle -t jsx -l en -p 8080 my-presentation
```
--------------------------------
### Run Prettier Code Formatting Check
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Checks code formatting using Prettier. Can be run with a `--watch` flag to monitor file changes.
```sh
# Quality checks
$ pnpm run prettier
$ pnpm run prettier --watch
```
--------------------------------
### Configure webpack.config.js
Source: https://github.com/formidablelabs/spectacle/blob/main/packages/spectacle-mdx-loader/README.md
Integrate spectacle-mdx-loader into your webpack configuration to process .mdx files.
```javascript
module.exports = {
// ...
module: {
rules: [
// ...
// `.mdx` files go through babel and mdx transforming loader.
{
test: /\.mdx$/,
use: ['babel-loader', 'spectacle-mdx-loader']
}
]
}
};
```
--------------------------------
### Deploy Website without SSH
Source: https://github.com/formidablelabs/spectacle/blob/main/website/README.md
Deploys the website without using SSH. Requires specifying the GitHub username.
```bash
GIT_USER= yarn deploy
```
--------------------------------
### Run All Checks
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Execute all project checks using pnpm. This command is part of the pre-submission checklist for pull requests.
```shell
pnpm run check:ci
```
--------------------------------
### Multi-Code Layout with Descriptions
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/react-slide-layouts.md
Use SlideLayout.MultiCodeLayout for presentations with multiple code blocks, each potentially having a description. Specify the number of columns for layout.
```jsx
import { Slide, SlideLayout } from 'spectacle';
const MySlide = () => (
{};',
language: 'jsx',
description: 'Another example',
},
]}
/>
);
```
--------------------------------
### React Component Integration in MDX
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/mdx/slides.mdx
Shows how to import and use a React component within an MDX file for a Spectacle presentation. Ensure the component and its props are correctly defined.
```jsx
import Test from './test-component';
export const testProp = 50;
```
--------------------------------
### Manual Release: Dry Run Publish
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Perform a dry run of the package publish process using pnpm. This allows testing the publish command without actually uploading packages.
```sh
$ pnpm -r publish --dry-run
```
--------------------------------
### Markdown Slide with Component Props
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/one-page/index.html
Illustrates how to use the MarkdownSlide component and pass down props to all elements on the slide using `componentProps`.
```markdown
# This is a Markdown Slide - You can pass props down to all elements on the slide.
- Just use the `componentProps` prop.
```
--------------------------------
### Using Scaled Spacing in Text Component
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/themes.md
Illustrates how to use the scaled spacing values by passing the index of the value as a numeric prop to space-related properties like 'padding'.
```jsx
Hello World
```
--------------------------------
### CodePane with Highlighted Ranges
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Demonstrates using the CodePane component to display JavaScript code with specific line ranges highlighted. Ensure you import the desired theme and specify the language.
```jsx
import tomorrow from 'react-syntax-highlighter/dist/cjs/styles/prism/tomorrow';
() => (
{
`
const App = () => (
);
`
}
);
```
--------------------------------
### Simple Custom Theme Object
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/themes.md
Define a basic theme object with custom colors and font sizes. This object is passed directly to the Deck component.
```javascript
const theme = {
colors: {
primary: '#f00',
secondary: '#00f'
},
fontSizes: {
header: '64px',
paragraph: '28px'
}
};
```
--------------------------------
### Deck
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Wraps the entire presentation and manages overarching slide logic such as theme and template. It also provides props for print and export modes, controlling page size, orientation, and scaling.
```APIDOC
## Deck
### Description
Wraps the entire presentation and carries most of the overarching slide logic, like `theme` and `template` context. The last three props are for print and export mode only.
### Props
#### Main Props
- **theme** ([Styled-system theme object](./themes)) - Description: The theme for the presentation.
- **template** ([Templates](#templates)) - Description: A template to apply to all subsequent Slides.
#### Print/Export Props
- **pageSize** (PropTypes.string) - Default: `"13.66in 7.68in"` - Description: Corresponds to the size values for the CSS media print size selector. Automatically set based on the deck theme slide size for a best-fit using export to PDF mode. If you need to print your deck, supply your paper size using this prop.
- **pageOrientation** (string) - Default: `"landscape"` - Description: Either `"landscape"` or `"portrait"`.
- **printScale** (PropTypes.number) - Default: `0.959` - Description: The ratio for the selected page size, orientation, and slide size. `0.958` is the best ratio to ensure the PDF export fits the slide theme size.
#### Behavior Props
- **autoPlay** (PropTypes.bool) - Default: `false` - Description: Enables autoplay for the presentation.
- **autoPlayLoop** (PropTypes.bool) - Default: `false` - Description: Enables looping for autoplay.
- **autoPlayInterval** (PropTypes.number) - Default: `1000` - Description: The interval in milliseconds between slides during autoplay.
- **transition** ([**Transition**](./props#transition-object)) - Default: `slideTransition` - Description: The default transition effect for slides.
- **backgroundImage** (PropTypes.string) - Description: A background image for the entire presentation.
```
--------------------------------
### Markdown Slide with Animated List Items
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Create a full slide using Markdown with the `` component. The `animateListItems` prop animates the list items sequentially.
```jsx
# Use Markdown to write a slide
This is a single slide composed using Markdown.
- It uses the `animateListItems` prop so...
- it's list items...
- will animate in, one at a time.
```
--------------------------------
### Add a Changeset
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Command to add a changeset for versioning packages. This is used when your PR requires a version change for any packages in the repo.
```shell
pnpm changeset
```
--------------------------------
### Run ESLint Code Linting Check
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Performs code linting using ESLint. Can be run with a `--watch` flag to monitor file changes.
```sh
$ pnpm run lint
$ pnpm run lint --watch
```
--------------------------------
### View Uncommitted Changeset File
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
After running 'pnpm changeset', a new uncommitted file will appear in the .changeset directory. Review and adjust this file before committing.
```shell
$ git status
# ....
Untracked files:
(use "git add ..." to include in what will be committed)
.changeset/flimsy-pandas-marry.md
```
--------------------------------
### Manual Release: Push Git Tags
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Push git tags to the remote repository after a successful publish. This ensures tags are updated.
```sh
$ git push && git push --tags
```
--------------------------------
### Markdown Slide with Animated List Items
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/one-page/index.html
Demonstrates a MarkdownSlide that animates its list items one at a time using the `animateListItems` prop.
```markdown
# This is also a Markdown Slide
It uses the `animateListItems` prop.
- Its list items...
- ...will appear...
- ...one at a time.
```
--------------------------------
### CodePane with Line Numbers (JSX)
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/one-page/index.html
Demonstrates how to use the CodePane component to display JSX code with line numbers enabled.
```jsx
import { createClient, Provider } from 'urql';
const client = createClient({ url: 'https://0ufyz.sse.codesandbox.io' });
const App = () => (
);
```
--------------------------------
### Markdown Slide Set with Delimiters
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Use `` to author a series of slides using Markdown. The `---` delimiter separates content into distinct slides within the set.
```jsx
# Markdown Slide Sets
Let you write a sequence of slides using Markdown.
---
# This is the Second Slide in the Set
Using the `---` delimiter creates a new slide in the set.
Notes: The easiest way to always display up-to-date data is to set the requestPolicy to 'cache-and-network'.
```
--------------------------------
### Define Columns Layout
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/md-slide-layouts.md
Use this JSON object to define a columns layout for a slide. Each column is delimited by '::section'.
```json
{ "layout" : "columns" }
```
--------------------------------
### Slide with Presenter Notes
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Include presenter notes within a slide using the `` component. These notes are only visible in Presenter mode and do not appear on the main deck.
```jsx
Urql
A highly customizable and versatile GraphQL client
Urql is a GraphQL client that exposes a set of React components and hooks.
```
--------------------------------
### Columns Layout JSX Structure
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/md-slide-layouts.md
Illustrates the underlying JSX structure for the columns layout, which uses FlexBox to arrange sections.
```jsx
{sectionsArray}
```
--------------------------------
### Basic Markdown in a Slide
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Use the `` component to embed Markdown content within a ``. This allows for rich text formatting and structure inside individual slides.
```jsx
# Urql
A highly customizable and versatile GraphQL client
Made by Formidable
```
--------------------------------
### Slide
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
Wraps a single slide within the presentation, defining the content for a single view. It can override the Deck's transition effects with its own specified transition.
```APIDOC
## Slide
### Description
Wraps a single slide within your presentation; identifies what is contained to a single view. If a transition effect is applied to this slide, it will override the Deck-specified transition.
### Props
- **backgroundColor** (PropTypes.string) - Description: The background color for the slide.
- **backgroundImage** (PropTypes.string) - Description: A background image for the slide.
- **backgroundOpacity** (PropTypes.number) - Description: The opacity of the background image.
- **backgroundPosition** (PropTypes.string) - Description: The position of the background image.
- **backgroundRepeat** (PropTypes.string) - Description: The repeat property for the background image.
- **backgroundSize** (PropTypes.string) - Description: The size of the background image.
- **scaleRatio** (PropTypes.number) - Description: A scaling ratio for the slide content.
- **slideNum** (PropTypes.number) - Description: The slide number.
- **template** (PropTypes.func) - Description: A custom template function for the slide.
- **textColor** (PropTypes.string) - Description: The text color for the slide.
- **transition** ([**Transition**](./props#transition-object)) - Description: The transition effect for this specific slide, overriding the Deck's default.
```
--------------------------------
### Clean Tooling Caches
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Clears various caches used by the project's tooling, such as ESLint or Prettier caches.
```sh
# Clean out everything
$ yarn clean:cache
# Individually
$ yarn clean:cache:lint # eslint cache
$ yarn clean:cache:wireit # wireit task cache
$ yarn clean:cache:modules # caches in node_modules (prettier, etc.)
```
--------------------------------
### Code Slide Layout
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/react-slide-layouts.md
Use SlideLayout.Code for slides featuring a single code pane. The 'children' prop is the code content, and 'language' specifies the syntax highlighting.
```jsx
import { Slide, SlideLayout } from 'spectacle';
const MySlide = () => (
const Component = (props: componentProps): JSX.Element => {...}
);
```
--------------------------------
### Spectacle Default Template Usage
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/api-reference.md
This snippet shows how to import and use the DefaultTemplate component within a Spectacle Deck. The template can be customized with a 'color' prop.
```tsx
import { Deck, DefaultTemplate } from 'spectacle'
const Presentation = () => (
}>
{/* Your presentation here */}
)
```
--------------------------------
### Run TypeScript Type Checking
Source: https://github.com/formidablelabs/spectacle/blob/main/CONTRIBUTING.md
Checks for TypeScript type errors in the project. Can be run with a `--watch` flag to monitor file changes.
```sh
$ pnpm run types:check
$ pnpm run types:check --watch
```
--------------------------------
### CodePane without Line Numbers (Java)
Source: https://github.com/formidablelabs/spectacle/blob/main/examples/one-page/index.html
Shows how to use the CodePane component to display Java code with line numbers disabled.
```java
public class NoLineNumbers {
public static void main(String[] args) {
System.out.println("Hello");
}
}
```
--------------------------------
### Center Layout JSX Structure
Source: https://github.com/formidablelabs/spectacle/blob/main/docs/md-slide-layouts.md
Shows the JSX structure for the center layout, which uses FlexBox to center content vertically and horizontally.
```jsx