diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 74e92d193..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "presets": ["@babel/preset-env", "@babel/preset-react"],
- "plugins": [
- "@babel/plugin-proposal-object-rest-spread",
- "@babel/plugin-proposal-class-properties",
- "babel-plugin-emotion"
- ],
- "env": {
- "esm": {
- "presets": [
- ["@babel/preset-env", { "modules": false }],
- "@babel/preset-react"
- ]
- }
- }
-}
diff --git a/.babelrc.build.js b/.babelrc.build.js
new file mode 100644
index 000000000..9fda3f491
--- /dev/null
+++ b/.babelrc.build.js
@@ -0,0 +1,7 @@
+/**
+ * Configurations used for building core library files.
+ */
+module.exports = {
+ extends: './.babelrc.js',
+ ignore: ['/__snapshots__/', /^.*(.test.)[j|t]sx?$/]
+};
diff --git a/.babelrc.js b/.babelrc.js
new file mode 100644
index 000000000..146e7a9cf
--- /dev/null
+++ b/.babelrc.js
@@ -0,0 +1,22 @@
+/**
+ * General configuration.
+ */
+module.exports = {
+ presets: [
+ '@babel/preset-typescript',
+ ['@babel/preset-env', { modules: false }],
+ ['@babel/preset-react', { runtime: 'automatic' }]
+ ],
+ plugins: [
+ '@babel/plugin-proposal-object-rest-spread',
+ '@babel/plugin-proposal-class-properties'
+ ],
+ env: {
+ cjs: {
+ presets: ['@babel/preset-env', '@babel/preset-react']
+ },
+ test: {
+ presets: ['@babel/preset-env', '@babel/preset-react']
+ }
+ }
+};
diff --git a/.changeset/config.json b/.changeset/config.json
new file mode 100644
index 000000000..a42ae819c
--- /dev/null
+++ b/.changeset/config.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
+ "changelog": [
+ "@svitejs/changesets-changelog-github-compact",
+ {
+ "repo": "FormidableLabs/spectacle"
+ }
+ ],
+ "access": "public",
+ "baseBranch": "main"
+}
diff --git a/.eslintignore b/.eslintignore
index 22a3224b2..1b1a7874c 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,6 @@
-dist/
-lib/
-node_modules/*
+dist
+lib
+es
+node_modules
+coverage
+.wireit
diff --git a/.eslintrc b/.eslintrc
index e660aeff7..55c24f64d 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,63 +1,51 @@
-{
- "root": true,
- "parser": "babel-eslint",
- "extends": [
- "formidable/configurations/es6-react",
- "prettier",
- "prettier/react"
- ],
- "env": {
- "browser": true,
- "commonjs": true,
- "es6": true,
- "node": true,
- "jest": true
- },
- "globals": {
- "expect": true
- },
- "parserOptions": {
- "ecmaVersion": 6,
- "sourceType": "module",
- "ecmaFeatures": {
- "jsx": true,
- "generators": true,
- "experimentalObjectRestSpread": true
- }
- },
- "rules": {
- "quotes": [
- "error",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "comma-dangle": "off",
- "indent": "off",
- "space-before-function-paren": "off",
- "react/jsx-indent-props": "off",
- "max-len": "off",
- "no-magic-numbers": "off",
- "func-style": "off",
- "arrow-parens": "off",
- "no-use-before-define": "off",
- "no-undef": ["error", { "typeof": true }],
- "react/jsx-filename-extension": "off",
- "react/require-extension": "off",
- "react/no-multi-comp": "off",
- "react/prop-types": "warn",
- "react/sort-comp": "warn",
- "react/sort-prop-types": "warn",
- "react/jsx-handler-names": "off",
- "react/no-find-dom-node": "off",
- "no-invalid-this": "off",
- "complexity": "off",
- "no-unused-vars": [
- "error",
- {
- "argsIgnorePattern": "^_+$"
- }
- ]
- }
-}
+{
+ "root": true,
+ "parser": "@typescript-eslint/parser",
+ "extends": [
+ "plugin:react/recommended",
+ "plugin:react-hooks/recommended",
+ "prettier"
+ ],
+ "plugins": ["prettier", "react", "react-hooks", "@typescript-eslint"],
+ "env": {
+ "browser": true,
+ "commonjs": true,
+ "es6": true,
+ "node": true,
+ "jest": true
+ },
+ "settings": {
+ "react": {
+ "version": "detect"
+ }
+ },
+ "globals": {
+ "expect": true
+ },
+ "parserOptions": {
+ "ecmaVersion": 6,
+ "sourceType": "module",
+ "ecmaFeatures": {
+ "jsx": true,
+ "generators": true,
+ "experimentalObjectRestSpread": true
+ }
+ },
+ "rules": {
+ "react/jsx-uses-react": "off",
+ "react/react-in-jsx-scope": "off",
+ "react/prop-types": "off",
+ "prettier/prettier": ["error"],
+ "quotes": ["error", "single", { "allowTemplateLiterals": true }],
+ "no-unused-vars": "off",
+ "@typescript-eslint/no-unused-vars": ["error"]
+ },
+ "overrides": [
+ {
+ "files": ["*.ts", "*.tsx"],
+ "rules": {
+ "react/prop-types": "off"
+ }
+ }
+ ]
+}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 3dc22656f..a74f6279b 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -5,41 +5,48 @@ about: Create a report to help us improve
### Prerequisites
-**Feel free to delete this section if you have checked off all of the following.**
+
-- [ ] I've searched open [issues](https://www.github.com/FormidableLabs/spectacle/issues) to make sure I'm not opening a duplicate issue
-- [ ] This issue not specific to `spectacle-boilerplate` (those issues should be opened [here](https://github.com/FormidableLabs/spectacle-boilerplate/issues/new)).
-- [ ] I have read through the [docs](https://formidable.com/open-source/spectacle/docs/) before asking a question
+- [ ] I have searched the open [issues](https://www.github.com/FormidableLabs/spectacle/issues) to make sure I'm not opening a duplicate issue
+- [ ] I have read through the [docs](https://www.formidable.com/open-source/spectacle/docs) before asking a question
- [ ] I am using the latest version of Spectacle
### Describe Your Environment
-What version of Spectacle are you using? (can be found by running `npm list spectacle`)
+**What version of Spectacle are you using?** (can be found by running `npm list --depth 0 spectacle`)
-What version of React are you using? (can be found by running `npm list react`)
+**What version of React are you using?** (can be found by running `npm list --depth 0 react`)
-What browser are you using?
+**What browser are you using?** (e.g., Chrome 105.0.5195.102, Safari 16.0)
-What machine are you on?
+**What platform are you on?** (e.g., Windows, macOS, iOS, Android)
### Describe the Problem
+
+
**Expected behavior:** [What you expect to happen]
**Actual behavior:** [What actually happens]
### Additional Information
-Any additional information, configuration or data that might be necessary to reproduce the issue.
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index b22ad2ab1..510abf4df 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -5,18 +5,18 @@ about: Suggest an idea for this project
### Description
-Including the problem you want to address, use cases, benefits, and/or goals.
+
### Proposal
-How do you propose we implement this change?
+
### Links / References
-Any resources you want to point to for reference or more information.
+
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 71d4ed1a1..13cedc00f 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -5,14 +5,14 @@ about: Ask a question about using Spectacle.
### Question
-What question do you have about using Spectacle?
+
### Background Info/Attempts
-Any background information that might help us answer your questions, or a code snippet or link to a code example if you have an implementation question.
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index be23bb1d3..70c7c2501 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,6 +1,6 @@
@@ -12,7 +12,7 @@ Fixes # (issue)
#### Type of Change
-Please delete options that are not relevant.
+
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
@@ -21,16 +21,15 @@ Please delete options that are not relevant.
### How Has This Been Tested?
-Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
+
### Checklist: (Feel free to delete this section upon completion)
-- [ ] My code follows the style guidelines of this project (I have run `yarn prettier-fix && yarn lint`)
-- [ ] I have added tests that prove my fix is effective or that my feature works
-- [ ] New and existing unit tests pass locally with my changes (I have run `yarn test`)
+- [ ] I have included a [changeset](../CONTRIBUTING.md#changesets) if this change will require a version change to one of the packages.
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
+- [ ] I have run `pnpm run check:ci` and all checks pass
+- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules
-- [ ] I have updated type definitions in `index.d.ts` for any breaking API changes
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 000000000..d0099e882
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,64 @@
+name: CI
+
+# Runs build and test on:
+# every push that has a change in a file not in the docs folder
+# every pull request with main branch as the base that has a change
+# in a file not in the docs folder
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+ name: Check and build codebase
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [14.x, 16.x, 18.x]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ # Wireit cache
+ - uses: google/wireit@setup-github-actions-caching/v1
+
+ - uses: pnpm/action-setup@v2.2.2
+ with:
+ version: 7
+
+ - name: Get pnpm store directory
+ id: pnpm-cache
+ run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ # If you hare having issues post-merge with wireit improperly caching,
+ # comment this out, push a commit, then re-comment.
+ # - name: Clear all caches
+ # run: pnpm clean:cache
+
+ - name: Build Code and Examples ${{ matrix.node-version }}
+ run: pnpm run build
+
+ # We build in-source files like `examples/one-page/index.html`.
+ # This check ensures we don't build changes that need committing.
+ - name: Check generated in-source files
+ run: git diff --no-ext-diff --quiet --exit-code
+
+ - name: Check Code ${{ matrix.node-version }}
+ run: pnpm run check:ci
diff --git a/.github/workflows/create-spectacle.yml b/.github/workflows/create-spectacle.yml
new file mode 100644
index 000000000..982502bea
--- /dev/null
+++ b/.github/workflows/create-spectacle.yml
@@ -0,0 +1,77 @@
+name: create-spectacle
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - ".github/workflows/create-spectacle.yml"
+ - "packages/create-spectacle/**"
+ pull_request:
+ branches:
+ - main
+ paths:
+ - ".github/workflows/create-spectacle.yml"
+ - "packages/create-spectacle/**"
+
+jobs:
+ build:
+ name: Create, build, and install
+ timeout-minutes: 5
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18.x]
+ create-type: ['jsx', 'tsx', 'onepage']
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ # Wireit cache
+ - uses: google/wireit@setup-github-actions-caching/v1
+
+ - uses: pnpm/action-setup@v2.2.2
+ with:
+ version: 7
+
+ - name: Get pnpm store directory
+ id: pnpm-cache
+ run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build create-spectacle
+ run: pnpm run --filter ./packages/create-spectacle build
+
+ # Create, build, isntall a full example.
+ # Then, start a background dev server.
+ - name: Create example - ${{ matrix.create-type }}
+ working-directory: ./packages/create-spectacle
+ run: pnpm run examples:${{ matrix.create-type }}:create
+
+ - name: Install example - ${{ matrix.create-type }}
+ working-directory: ./packages/create-spectacle
+ run: pnpm run examples:${{ matrix.create-type }}:install
+
+ - name: Build example - ${{ matrix.create-type }}
+ working-directory: ./packages/create-spectacle
+ run: pnpm run examples:${{ matrix.create-type }}:build
+
+ # Wait until the dev server is full up and running and then test.
+ - name: Start and test example - ${{ matrix.create-type }}
+ working-directory: ./packages/create-spectacle
+ run: |
+ pnpm run examples:${{ matrix.create-type }}:start & \
+ pnpm exec wait-on http-get://localhost:3000 && \
+ pnpm run examples:test
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 000000000..f256f91a9
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,87 @@
+name: Deploy Website
+
+on:
+ push:
+ paths:
+ - '.github/workflows/docs.yml'
+ - 'docs/**'
+ - 'website/**'
+ pull_request:
+ branches:
+ - main
+ paths:
+ - '.github/workflows/docs.yml'
+ - 'docs/**'
+ - 'website/**'
+
+jobs:
+ deploy-website:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: AWS CLI version
+ run: "aws --version"
+
+ - uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ # Wireit cache
+ - uses: google/wireit@setup-github-actions-caching/v1
+
+ - uses: pnpm/action-setup@v2.2.2
+ with:
+ version: 7
+
+ - name: Get pnpm store directory
+ id: pnpm-cache
+ run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build the website
+ working-directory: ./website
+ run: pnpm build
+
+ # Use `gh` tool to infer more information about the pull request.
+ # The underlying issue here is pushes to a non-mergeable/main target branch
+ # don't have the PR number easily available.
+ # https://stackoverflow.com/a/70102700
+ - name: Get pull request info
+ id: pr_info
+ run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")"
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Deploy docs (staging)
+ if: github.ref != 'refs/heads/main'
+ working-directory: ./website
+ run: pnpm deploy:stage
+ env:
+ # GH actions have a PR merge commit that _isn't_ our actual commits.
+ # Manually infer correct branch and sha for pull requests.
+ FORMIDEPLOY_GIT_SHA: ${{ github.event.pull_request.head.sha }}
+ FORMIDEPLOY_PULL_REQUEST: ${{ steps.pr_info.outputs.pull_request_number }}
+ GITHUB_DEPLOYMENT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
+ SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
+
+ - name: Deploy docs (production)
+ if: github.ref == 'refs/heads/main'
+ working-directory: ./website
+ run: pnpm deploy:prod
+ env:
+ GITHUB_DEPLOYMENT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000..643cb04b8
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,58 @@
+name: Spectacle Release Workflow
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Use Node.js
+ uses: actions/setup-node@v1
+ with:
+ node-version: 18.x
+
+ # Wireit cache
+ - uses: google/wireit@setup-github-actions-caching/v1
+
+ - uses: pnpm/action-setup@v2.2.2
+ with:
+ version: 7
+
+ - name: Get pnpm store directory
+ id: pnpm-cache
+ run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build packages
+ run: pnpm run build
+
+ - name: PR or Publish
+ id: changesets
+ uses: changesets/action@v1
+ with:
+ # Note: Our `package.json:scripts.version` currently doesn't have `--fix-lockfile` for
+ # `pnpm install` because of a PNPM bug of some kind.
+ # https://github.com/FormidableLabs/spectacle/issues/1156
+ version: pnpm run version
+ publish: pnpm changeset publish
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 53d28d112..d3cc3d0e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,46 @@
-node_modules
+# dependencies
+/node_modules
+/**/node_modules
package-lock.json
+
+# testing
+/coverage
+test/screenshots
+
+# production
+/dist
+/tmp
+/docs/tmp
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+\.hg
+.idea
+.vscode
+.nova
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+*.log
+
+# build
+.wireit
+.eslintcache
+coverage
+Procfile
+build
dist
lib
es
-*.log
-.DS_Store
-.vscode
+bin
+.puppeteer
+.examples
+
+# Pack-ing artifacts
+packages/**/package
+**/*.tgz
diff --git a/.npmignore b/.npmignore
index 410139a2b..12f55c4a3 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,11 +1,7 @@
-/*
-/dist/*
-!/dist/spectacle*
-/dist/*.map
-!/es
-!/lib
-!/src
-!/docs
+*
+!/dist/spectacle*.js
+!/es/**/*.js
+!/lib/**/*.js
__snapshots__
__mocks__
*.test.js
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 000000000..519f90d57
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,5 @@
+strict-peer-dependencies=false
+prefer-workspace-packages=true
+
+# Docusaurus has some phantom dependencies, so specifically hoist those.
+public-hoist-pattern[]=@docusaurus/theme-classic
diff --git a/.prettierignore b/.prettierignore
index aa5c6df5d..68cf25d9a 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,7 +1,19 @@
-package-lock.json
+yarn.lock
package.json
+tsconfig.json
node_modules
-dist
es
lib
-example/assets
+dist
+docs
+bin
+build
+.nova
+.vscode
+.wireit
+.examples
+.changeset/*.md
+
+# Allow us to manually format this.
+examples/md/slides.md
+examples/one-page/index.html
diff --git a/.prettierrc b/.prettierrc
index 544138be4..a6448d885 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,3 +1,7 @@
{
- "singleQuote": true
+ "singleQuote": true,
+ "printWidth": 80,
+ "trailingComma": "none",
+ "endOfLine": "lf",
+ "semi": true
}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e7e376b76..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-language: node_js
-
-node_js:
- - "8"
- - "10"
-
-# Use container-based Travis infrastructure.
-sudo: false
-
-branches:
- only:
- - master
-
-install:
- # Fail if lockfile outdated.
- # https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
- - yarn install --frozen-lockfile
-
-notifications:
- email:
- on_success: change
- on_failure: always
-
-script:
- - yarn run build
- - yarn run check-ci
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b78f3573f..6dbe567d8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,53 +1,267 @@
-Thanks for contributing!
+# Contributing
+
+Thank you for contributing!
+
+
+
+
+
+Spectacle is actively maintained by @[carlos-kelly][] for [@FormidableLabs][formidable-github].
## Development
### Installing dependencies
+We use [`pnpm`][pnpm-docs].
+
+Install all dependencies by running:
+
```sh
-yarn install
+$ pnpm install
```
-You will find all building blocks that make up Spectacle in the [`src`](src) folder.
+### Examples
+
+We have various deck scenarios in `examples` in this repository that are part of the development process.
+
+We follow the convention of `start:NAME` to run an in-memory dev server for a specific example, but we also have a `pnpm build` script task to make sure we're actually producing non-broken sample presentations as a CI / assurance test.
+
+- `spectacle`
+ - [`examples/js`](https://github.com/FormidableLabs/spectacle/tree/main/examples/js)
+ - [`examples/md`](https://github.com/FormidableLabs/spectacle/tree/main/examples/md)
+ - [`examples/typescript`](https://github.com/FormidableLabs/spectacle/tree/main/examples/typescript)
+ - [`examples/one-page`](https://github.com/FormidableLabs/spectacle/tree/main/examples/one-page)
+- `spectacle-mdx-loader`
+ - [`examples/mdx`](https://github.com/FormidableLabs/spectacle-mdx-loader/tree/main/examples/mdx)
+
+Here's how you can run the various examples:
+
+```sh
+# JavaScript demo app (in two different terminals)
+$ pnpm start:js
+$ open http://localhost:3000/
-### Testing
+# TypeScript demo app (in two different terminals)
+$ pnpm start:ts
+$ open http://localhost:3100/
-You will find tests for files colocated with `*.test.js` suffixes. Whenever making any changes, ensure that all existing tests pass by running `yarn run test`.
+# Markdown demo app (in two different terminals)
+$ pnpm start:md
+$ open http://localhost:3200/
-If you are adding a new feature or some extra functionality, you should also make sure to accompany those changes with appropriate tests.
+# One-page (no build, HTML page only) demo app (in two different terminals)
+$ pnpm start:one-page
+$ open examples/one-page/index.html
-### Linting and Formatting
+# Start **ALL** the example watchers at the same time!
+$ pnpm start:examples
+```
-Before committing any changes, be sure to do `yarn run lint`; this will lint all relevant files using [ESLint](http://eslint.org/) and report on any changes that you need to make.
+You can also live watch the CLI and execute the built script on command with:
-You will also want to ensure your code meets the prettier formatting guidelines by running `yarn run prettier -l ` on a specific file. If there are differences the script errors out. You can also specify a glob `yarn run prettier -l "src/**/*.js"` which will return a list of files that do not conform.
+```sh
+# Watch create-spectacle code and test out (in two different terminals)
+$ pnpm start:create-spectacle
+$ node packages/create-spectacle/bin/cli.js -h
+```
-Alternatively, install the Prettier [editor plugin](https://prettier.io/docs/en/editors.html) in your favorite editor. This is the preferred method.
+These run appropriate file watchers, so you can just start developing source files and wait for the various dev servers to pick up the new changes.
-There is also a pre-commit hook in place to lint all staged files. If any of the staged files do not conform to the eslint rules or the [prettier](https://prettier.io/) formatting guidelines, your commit will fail until you resolve all outstanding issues.
+### Build and checks
-To resolve/fix prettier formatting problems from the CLI:
+Our task system mostly takes care of all task dependencies and things you need. When you first clone this repo or a new branch, run:
```sh
-yarn prettier-fix && yarn lint-fix
+# 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
+
+# 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
```
-This will modify your file in place. You will need to `git add` the file again and re-commit.
+This will do all the build, seeding the task cache so subsequent tasks are fast, and checks that everything is correctly working. Your Spectacle workflow could reasonably just be (1) making some changes to files + tests, and then (2) re-running `pnpm run check`!
+
+Here are some other useful tasks (with or without a `--watch` flag):
-### Before submitting a PR...
+```sh
+# Quality checks
+$ pnpm run prettier
+$ pnpm run prettier --watch
+$ pnpm run lint
+$ pnpm run lint --watch
+$ pnpm run types:check
+$ pnpm run types:check --watch
+
+# Tests
+$ pnpm run test
+$ pnpm run test --watch
+```
+
+We also have some helper tasks to fix issues that are fixable.
+
+```sh
+$ pnpm run prettier:fix
+$ pnpm run lint:fix
+```
+
+If you have issues with tasks failing erroneously, you can clear our tooling 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.)
+```
+
+### Checking `create-spectacle`
+
+We have slower checks for the outputs created by our `create-spectacle` package that are run in CI, but you generally won't need to run unless you are developing that package.
+
+First, you can install Chromium to use in `puppeteer` or use a local Chrome instance. We only presently have Mac instructions and will get to Windows/Linux support when we get demand. You only need to do the following step once.
+
+```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
+# Option 2.b -- If you are on an M1/2 Mac, do this instead:
+$ PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM=true pnpm puppeteer:install
+```
+
+After that, you'll want to either build or watch the `create-spectacle` files:
+
+```sh
+$ pnpm run --filter ./packages/create-spectacle build
+$ pnpm run --filter ./packages/create-spectacle build --watch
+```
+
+From there, here are sample collections of commands to create new example applications from scratch with full installation and ending with firing up a dev server:
+
+```sh
+# JavaScript
+$ pnpm run --filter ./packages/create-spectacle examples:jsx:clean && \
+ pnpm run --filter ./packages/create-spectacle examples:jsx:create && \
+ pnpm run --filter ./packages/create-spectacle examples:jsx:install && \
+ pnpm run --filter ./packages/create-spectacle examples:jsx:build && \
+ pnpm run --filter ./packages/create-spectacle examples:jsx:start
+
+# TypeScript
+$ pnpm run --filter ./packages/create-spectacle examples:tsx:clean && \
+ pnpm run --filter ./packages/create-spectacle examples:tsx:create && \
+ pnpm run --filter ./packages/create-spectacle examples:tsx:install && \
+ pnpm run --filter ./packages/create-spectacle examples:tsx:build && \
+ pnpm run --filter ./packages/create-spectacle examples:tsx:start
+
+# One Page (HTML-only, no build step)
+$ pnpm run --filter ./packages/create-spectacle examples:onepage:clean && \
+ pnpm run --filter ./packages/create-spectacle examples:onepage:create && \
+ pnpm run --filter ./packages/create-spectacle examples:onepage:start
+```
+
+The dev server in each of these examples runs on port 3000 by default, and you can run a simple Puppeteer test against that port with the following:
+
+```sh
+$ pnpm run --filter ./packages/create-spectacle examples:test
+```
+
+### Before submitting a PR
Thanks for taking the time to help us make Spectacle even better! Before you go ahead and submit a PR, make sure that you have done the following:
-- Run the tests using `yarn run test`.
-- Run lint and flow using `yarn run lint`
-- Update the [type definitions](./index.d.ts) for anything that modifies the Spectacle API, like breaking changes or new features.
-- Everything else included in our [pull request checklist](https://github.com/FormidableLabs/spectacle/blob/master/.github/PULL_REQUEST_TEMPLATE.md#checklist-feel-free-to-delete-this-section-upon-completion)
+- Run all checks using `pnpm run check:ci`.
+- Run `pnpm run build` and check + commit changes to `examples/one-page/index.html`
+- Add a [changeset](#changeset) if your PR requires a version change for any of the packages in this repo.
+- Everything else included in our [pull request checklist](.github/PULL_REQUEST_TEMPLATE.md).
+
+### Changesets
+
+We use [changesets](https://github.com/changesets/changesets) to create package versions and publish them.
+
+If your work contributes changes that require a change in version to any of the packages, add a changeset by running:
+
+```sh
+$ pnpm changeset
+```
+
+which will open an interactive CLI menu. Use this menu to select which packages need versioning, which semantic version changes are needed, and add appropriate messages accordingly.
+
+After this, you'll see a new uncommitted file in `.changesets` that looks something like:
+
+```
+$ git status
+# ....
+Untracked files:
+ (use "git add ..." to include in what will be committed)
+ .changeset/flimsy-pandas-marry.md
+```
+
+Review this file, make any necessary adjustments, and commit the file to source. During the next package release, the changes (and changeset notes) will be automatically incorporated based on these changeset files.
+
+### Releasing a new version to NPM
-## Releasing a new version to NPM (only for project administrators)
+
+
+Only for project administrators
+
-1. Run `npm version patch` (or `minor`, `major` as appropriate) to run tests and lint, build the `lib` and `dist` directories, and automatically update the `package.json` with a new git tag.
-2. Run `npm publish` and publish to npm if all is well.
-3. Run `git push && git push --tags`
+We use [changesets](https://github.com/changesets/changesets) to create package versions and publish them.
+
+Our official release path is to use automation (via GitHub actions) to perform the actual publishing of our packages. The steps are:
+
+1. Developers add changesets, ideally as part of their PR that have version impacts.
+2. On merge of a PR with a changeset file, our automation opens a "Version Packages" PR.
+3. On merging the "Version Packages" PR, the automation system publishes the packages.
+
+This streamlines releasing too: ensuring PRs have changeset files added as necessary, and approving the "Version Packages" PR generated from GitHub actions to publish a release to all affected packages.
+
+#### Manual Releases
+
+For exceptional circumstances, here is a quick guide to manually publish from a local machine using changesets.
+
+1. Add a changeset with `pnpm changeset`. Generate the changeset file, review it, and commit it.
+2. Make a version. Due to our changelog formatting package you will need to create a personal token and pass it to the environment.
+
+ ```sh
+ $ GITHUB_TOKEN= pnpm run version
+ ```
+
+ Review git changes, tweak, and commit.
+
+3. Publish.
+
+ First, build necessary files:
+
+ ```sh
+ $ pnpm run build
+ ```
+
+ Then publish:
+
+ ```sh
+ # Test things out first
+ $ pnpm -r publish --dry-run
+
+ # The real publish
+ $ pnpm changeset publish --otp=
+ ```
+
+ Note that publishing multiple pacakges via `changeset` to npm with an OTP code can often fail with `429 Too Many Requests` rate limiting error. Take a 5+ minute coffee break, then come back and try again.
+
+ Then issue the following to also push git tags:
+
+ ```sh
+ $ git push && git push --tags
+ ```
+
+
## Contributor Covenant Code of Conduct
@@ -118,8 +332,13 @@ members of the project's leadership.
### Attribution
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
+This Code of Conduct is adapted from the [Contributor Covenant][cc-homepage], version 2.0,
+available at [https://www.contributor-covenant.org/version/2/0][cc-latest-version]
+
+
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+[carlos-kelly]: https://www.github.com/carlos-kelly
+[cc-homepage]: http://contributor-covenant.org
+[cc-latest-version]: https://www.contributor-covenant.org/version/2/0/code_of_conduct
+[formidable-github]: https://www.github.com/FormidableLabs
+[pnpm-docs]: https://pnpm.io/
diff --git a/LICENSE b/LICENSE
index cd46f55b2..d39574007 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,9 +2,6 @@ The MIT License (MIT)
Copyright (c) 2013-2018 Formidable Labs, Inc.
-Copyright (c) 2016-2018 Zachary Maybury, Kylie Stewart, and potentially other
-DefinitelyTyped contributors
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
diff --git a/README.md b/README.md
index 59e868d9d..cce4baa76 100644
--- a/README.md
+++ b/README.md
@@ -1,1059 +1,36 @@
-# Spectacle
-
-[![Travis Status][trav_img]][trav_site]
-[![Maintenance Status][maintenance-image]](#maintenance-status)
-
-ReactJS based Presentation Library
-
-[Spectacle Boilerplate MDX](https://github.com/FormidableLabs/spectacle-boilerplate-mdx/)
-[Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate/)
-
-Looking for a quick preview of what you can do with Spectacle? Check out our live Demo Deck [here](https://raw.githack.com/FormidableLabs/spectacle/master/one-page.html#/).
-
-Have a question about Spectacle? Submit an issue in this repository using the "Question" template.
-
-## Contents
-
-
-
-- [Getting Started](#getting-started)
- - [Classic Spectacle](#classic-spectacle)
- - [Spectacle MDX](#spectacle-mdx)
- - [One Page](#one-page)
-- [Development](#development)
-- [Build & Deployment](#build--deployment)
-- [Presenting](#presenting)
-- [Controls](#controls)
-- [Fullscreen](#fullscreen)
-- [PDF Export](#pdf-export)
-- [Basic Concepts](#basic-concepts)
- - [Main file](#main-file)
- - [Themes](#themes)
- - [createTheme(colors, fonts)](#createthemecolors-fonts)
-- [FAQ](#faq)
-- [Tag API](#tag-api)
- - [Main Tags](#main-tags)
- - [Deck](#deck)
- - [Slide (Base)](#slide-base)
- - [Notes](#notes)
- - [MarkdownSlides](#markdown-slides)
- - [Layout Tags](#layout-tags)
- - [Layout](#layout)
- - [Fit](#fit)
- - [Fill](#fill)
- - [Markdown Tag](#markdown-tag)
- - [Markdown](#markdown)
- - [Magic Tag](#magic-tag)
- - [Magic](#magic)
- - [Element Tags](#element-tags)
- - [Appear](#appear)
- - [Anim](#anim)
- - [BlockQuote, Quote and Cite (Base)](#blockquote-quote-and-cite-base)
- - [CodePane (Base)](#codepane-base)
- - [Code (Base)](#code-base)
- - [ComponentPlayground](#component-playground)
- - [GoToAction (Base)](#go-to-action)
- - [Heading (Base)](#heading-base)
- - [Image (Base)](#image-base)
- - [Link (Base)](#link-base)
- - [List & ListItem (Base)](#list--listitem-base)
- - [S (Base)](#s-base)
- - [Table, TableRow, TableBody, TableHeader, TableHeaderItem and TableItem (Base)](#table-tablerow-tableheaderitem-and-tableitem-base)
- - [Text (Base)](#text-base)
- - [Typeface](#typeface)
- - [Base Props](#base-props)
-- [Third Party Extensions](#third-party)
-
-
-
-
+
## Getting Started
-First, decide whether you want to use [classic Spectacle](#classic-spectacle), [Spectacle MDX](#spectacle-mdx), which has all the same functionality but allows you to write your Spectacle presentation in markdown, or using only [one HTML page](#one-page).
-
-### Classic Spectacle
-
-There are four ways to get started building your presentation.
-
-1. **Option #1:** Run the following command in your terminal:
-
- `npx create-react-app my-presentation --scripts-version spectacle-scripts`
-
-2. **Option #2:** Using the [Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate).
-
-3. **Option #3:** Following along the [Spectacle Tutorial](./docs/tutorial.md), which also involves downloading the [Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate).
-
-All three of the above ways will give you everything you'll need to get started, including a sample presentation in the `presentation` folder. You can change the props and tags as needed for your presentation or delete everything in `presentation/index.js` to start from scratch. From here you can go to [Development](#development) to get started.
-
-3. **Option #4:** Run `npm install spectacle` in your terminal and writing your own build configurations. We also provide full UMD builds (with a `Spectacle` global variable) of the library at `dist/spectacle.js` and `dist/spectacle.min.js` for more general use cases. You could, for example, include the library via a script tag with: `https://unpkg.com/spectacle@VERSION/dist/spectacle.min.js`.
-
-### Spectacle MDX
-
-Download the [Spectacle MDX Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate-mdx).
-
-This repository will give you everything you'll need to get started, including a sample presentation in the `presentation` folder. You can change the props and tags as needed for your presentation or delete everything in the `index.mdx` file to start from scratch. From here you can go to [Development](#development) to get started.
-
-_NOTE: We have webpack externals for `react`, `react-dom`, and `prop-types`, so you will need to provide them in your upstream build or something like linking in via `script` tags in your HTML page for all three libraries. This comports with our project dependencies which place these three libraries in `peerDependencies`._
-
-
-
-### One Page
-
-To aid with speedy development we've provided a simple boilerplate HTML page with a bespoke script tag that contains your entire presentation. The rest of the setup will take care of transpiling your React/ESnext code, providing Spectacle, React, and ReactDOM libraries, and being raring to go with a minimum of effort.
-
-We can start with this project's sample at [`one-page.html`](./one-page.html). It's the same presentation as the fully-built-from-source version, with a few notable exceptions:
-
-1. There are no `import`s or `require`s. Everything must come from the global namespace. This includes `Spectacle`, `React`, `ReactDOM` and all the Spectacle exports from [`./src/index.js`](./src/index.js) -- `Deck`, `Slide`, `themes`, etc.
-
-2. The presentation must include exactly **one** script tag with the type `text/spectacle` that is a function. Presently, that function is directly inserted inline into a wrapper code boilerplate as a React Component `render` function. The wrapper is transpiled. There should not be any extraneous content around it like outer variables or comments.
-
- **Good** examples:
-
- ```html
-
- ```
-
- ```html
-
- ```
-
- **Bad** examples of what not to do:
-
- ```html
-
- ```
-
-3. If you want to create your own theme settings, you can use the following code snippet to change the [themes](#createthemecolors-fonts) default settings.
-
- ```html
-
- ```
-
-... with those guidelines in mind, here's the boilerplate that you can copy-and-paste into an HTML file and start a Spectacle presentation that works from the get go!
-
-```html
-
-
-
-
-
- Spectacle
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-
-
-## Development
-
-After downloading the boilerplate, run the following commands on the project's root directory...
-
-- `npm install` (you can also use `yarn`)
-- `rm -R .git` to remove the existing version control
-- `npm start` to start up the local server or visit [http://localhost:3000/#/](http://localhost:3000/#/)
-
-... and we are ready to roll
-
-
-
-## Build & Deployment
-
-Building the dist version of the slides is as easy as running `npm run build:dist`
-
-If you want to deploy the slideshow to [surge](https://surge.sh/), run `npm run deploy`
-
-_⚠️ WARNING: If you are deploying the dist version to [GitHub Pages](https://pages.github.com/ 'GitHub Pages'), note that the built bundle uses an absolute path to the `/dist/` directory while GitHub Pages requires the relative `./dist/` to find any embedded assets and/or images. A very hacky way to fix this is to edit one place in the produced bundle, as shown [in this GitHub issue](https://github.com/FormidableLabs/spectacle/issues/326#issue-233283633 'GitHub: spectacle issue #326')._
-
-
-
-## Presenting
-
-Spectacle comes with a built in presenter mode. It shows you a slide lookahead, current time and your current slide:
-
-
-
-You also have the option of a stopwatch to count the elapsed time:
-
-
-
-To present:
-
-- Run `npm start`. You will be redirected to a URL containing your presentation or visit [http://localhost:3000/#/](http://localhost:3000/#/)
-- Open a second browser window on a different screen
-- Add `?presenter` or `?presenter&timer` immediately after the `/`, e.g.: [http://localhost:3000/#/0?presenter](http://localhost:3000/#/0?presenter) or [http://localhost:3000/#/?presenter&timer](http://localhost:3000/#/?presenter&timer)
-- Give an amazingly stylish presentation
-
-_NOTE: Any windows/tabs in the same browser that are running Spectacle will sync to one another, even if you don't want to use presentation mode_
-
-Check it out:
-
-
-
-You can toggle the presenter or overview mode by pressing respectively `alt+p` and `alt+o`.
-
-
-
-## Controls
-
-| Key Combination | Function |
-| --------------- | ------------------------------ |
-| Right Arrow | Next Slide |
-| Left Arrow | Previous Slide |
-| Space | Next Slide |
-| Shift+Space | Previous Slide |
-| Alt/Option + O | Toggle Overview Mode |
-| Alt/Option + P | Toggle Presenter Mode |
-| Alt/Option + T | Toggle Timer in Presenter Mode |
-| Alt/Option + A | Toggle autoplay (if enabled) |
-| Alt/Option + F | Toggle Fullscreen Mode |
-
-
-
-## Fullscreen
-
-Fullscreen can be toggled via browser options, Alt/Option + F, or by pressing the button in the bottom right corner of your window.
-
-Note: Right now, this works well when browser window itself is not full screen. When the browser is in fullscreen, there is an issue [#654](https://github.com/FormidableLabs/spectacle/issues/654). This is because we use the browser's FullScreen API methods. It still works but has some inconstiency.
-
-
-
-## PDF Export
-
-You can export a PDF from your Spectacle presentation either from the command line or browser:
-
-#### CLI
-
-- Run `npm install spectacle-renderer -g`
-- Run `npm start` on your project and wait for it to build and be available
-- Run `spectacle-renderer`
-
-A PDF is created in your project directory. For more options and configuration of this tool, check out:
-
-[https://github.com/FormidableLabs/spectacle-renderer](https://github.com/FormidableLabs/spectacle-renderer)
-
-#### Browser
-
-After running `npm start` and opening [http://localhost:3000/#/](http://localhost:3000/#/) in your browser...
-
-- Add `?export` after the `/` on the URL of the page you are redirected to, e.g.: [http://localhost:3000/#/?export](http://localhost:3000/#/?export)
-- Bring up the print dialog `(ctrl or cmd + p)`
-- Change destination to "Save as PDF", as shown below:
-
-
-
-If you want a printer friendly version, repeat the above process but instead print from [http://localhost:3000/#/?export&print](http://localhost:3000/#/?export&print).
-
-If you want to export your slides with your [notes](#notes) included, repeat the above process but instead print from [http://localhost:3000/#/?export¬es](http://localhost:3000/#/?export¬es).
-
-#### Query Parameters
-
-Here is a list of all valid query parameters that can be placed after `/#/` on the URL.
-
-| Query | Description |
-| ------------------- | -------------------------------------------------------------------------------------------------------------------- |
-| 0, 1, 2, 3... etc. | Will take you to the corresponding slide, with `0` being the first slide in the presentation. |
-| ?export | Creates a single-page overview of your slides, that you can then print. |
-| ?export¬es | Creates a single-page overview of your slides, including any [notes](#notes), that you can then print. |
-| ?export&print | Creates a black & white single-page overview of your slides. |
-| ?export&print¬es | Creates a black & white single-page overview of your slides, including any [notes](#notes), that you can then print. |
-| ?presenter | Takes you to presenter mode where you’ll see current slide, next slide, current time, and your [notes](#notes). |
-| ?presenter&timer | Takes you to presenter mode where you’ll see current slide, next slide, timer, and your [notes](#notes). |
-| ?overview | Take you to overview mode where you’ll see all your slides. |
-
-_NOTE: If you add a non-valid query parameter, you will be taken to a blank page. Removing or replacing the query parameter with a valid query parameter and refreshing the page will return you to the correct destination._
-
-
-
-## Basic Concepts
-
-
-
-### Main file
-
-Your presentation files & assets will live in the `presentation` folder.
-
-The main `.js` file you write your deck in is `/presentation/index.js`
-
-Check it out [here](https://github.com/FormidableLabs/spectacle-boilerplate/blob/master/presentation/index.js) in the boilerplate.
-
-```jsx
-// index.js
-
-import React, { Component } from 'react';
-import {
- Appear,
- BlockQuote,
- Cite,
- CodePane,
- Code,
- Deck,
- Fill,
- Fit,
- Heading,
- Image,
- Layout,
- ListItem,
- List,
- Quote,
- Slide,
- Text
-} from 'spectacle';
-
-export default class extends Component {
- render() {
- return (
-
-
- Hello
-
-
- );
- }
-}
-```
-
-Here is where you can use the library's tags to compose your presentation. While you can use any JSX syntax here, building your presentation with the supplied tags allows for theming to work properly.
-
-The bare minimum you need to start is a `Deck` element and a `Slide` element. Each `Slide` element represents a slide inside of your slideshow.
-
-
-
-### Themes
-
-In Spectacle, themes are functions that return style objects for `screen` & `print`.
-
-You can import the default theme from:
-
-```jsx
-import createTheme from 'spectacle/lib/themes/default';
-```
-
-Or create your own based upon the source.
-
-`index.js` is what you would edit in order to create a custom theme of your own, using object based styles.
-
-You will want to edit `index.html` to include any web fonts or additional CSS that your theme requires.
-
-
-
-#### createTheme(colors, fonts)
-
-Spectacle's functional theme system allows you to pass in color and font variables that you can use on your elements. The fonts configuration object can take a string for a system font or an object that specifies it‘s a Google Font. If you use a Google Font you can provide a styles array for loading different weights and variations. Google Font tags will be automatically created. See the example below:
-
-```jsx
-const theme = createTheme(
- {
- primary: 'red',
- secondary: 'blue'
- },
- {
- primary: 'Helvetica',
- secondary: {
- name: 'Droid Serif',
- googleFont: true,
- styles: ['400', '700i']
- }
- }
-);
-```
-
-The returned theme object can then be passed to the `Deck` tag via the `theme` prop, and will override the default styles.
-
-
-
-## FAQ
-
-**_How can I easily style the base components for my presentation?_**
-
-Historically, custom styling in Spectacle has meant screwing with a theme file, or using `!important` overrides. We fixed that. Spectacle is now driven by [emotion](https://github.com/emotion-js/emotion), so you can bring your own styling library, whether it's emotion itself, or something like styled-components or glamorous. For example, if you want to create a custom Heading style:
-
-```javascript
-import styled from 'react-emotion';
-import { Heading } from 'spectacle';
-
-const CustomHeading = styled(Heading)`
- font-size: 1.2em;
- color: papayawhip;
-`;
-```
-
-
-
-**_Can I write my presentation in TypeScript?_**
-
-Yes, you can! Type definitions are shipped with the library, so you can import Spectacle components into any `.tsx` presentation without additional installation steps.
-
-Updated type definitions for the Spectacle API can be found [at the root of this repository](./index.d.ts).
-
-## Tag API
-
-In Spectacle, presentations are composed of a set of base tags. We can separate these into three categories: Main tags, Layout tags & Element tags.
-
-
-
-### Main Tags
-
-
-
-#### Deck
-
-The Deck tag is the root level tag for your presentation. It supports the following props:
-
-| Name | PropType | Description | Default |
-| ----------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
-| autoplay | PropTypes.bool | Automatically advance slides. | `false` |
-| autoplayDuration | PropTypes.number | Accepts integer value in milliseconds for global autoplay duration. | `7000` |
-| autoplayLoop | PropTypes.bool | Keep slides in loop. | `true` |
-| autoplayOnStart | PropTypes.bool | Start presentation with autoplay on/not paused (if autoplay is enabled). | `true` |
-| controls | PropTypes.bool | Show control arrows when not in fullscreen. | `true` |
-| contentHeight | PropTypes.numbers | Baseline content area height. | `700px` |
-| contentWidth | PropTypes.numbers | Baseline content area width. | `1000px` |
-| disableKeyboardControls | PropTypes.bool | Toggle keyboard control. | `false` |
-| onStateChange | PropTypes.func | Called whenever a new slide becomes visible with the arguments `(previousState, nextState)` where state refers to the outgoing and incoming ``'s `state` props, respectively. The default implementation attaches the current state as a class to the document root. | see description |
-| history | PropTypes.object | Accepts custom configuration for [history](https://github.com/ReactTraining/history). | |
-| progress | PropTypes.string | Accepts `pacman`, `bar`, `number` or `none`. To override the color, change the 'quaternary' color in the theme. | `pacman` |
-| showFullscreenControl | PropTypes.bool | Show the fullscreen control button in bottom right of the screen. | `true` |
-| theme | PropTypes.object | Accepts a theme object for styling your presentation. | |
-| transition | PropTypes.array | Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets global slide transitions. **Note: If you use the 'scale' transition, fitted text won't work in Safari.** | |
-| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for global transition duration. | `500` |
-
-
-
-#### Slide ([Base](#base-props))
-
-The slide tag represents each slide in the presentation. Giving a slide tag an `id` attribute will replace its number based navigation hash with the `id` provided. It supports the following props, in addition to any of the props outlined in the [Base](#base-props) class props listing:
-
-| Name | PropType | Description | Default |
-| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
-| align | PropTypes.string | Accepts a space delimited value for positioning interior content. The first value can be `flex-start` (left), `center` (middle), or `flex-end` (right). The second value can be `flex-start` (top) , `center` (middle), or `flex-end` (bottom). | `align="center center"` |
-| controlColor | PropTypes.string | Used to override color of control arrows on a per slide basis, accepts color aliases, or valid color values. | Set by `Deck`'s `control` prop |
-| goTo | PropTypes.number | Used to navigate to a slide for out-of-order presenting. Slide numbers start at `1`. This can also be used to skip slides as well. | |
-| id | PropTypes.string | Used to create a string based hash. |
-| notes | PropTypes.string | Text which will appear in the presenter mode. Can be HTML. | |
-| onActive | PropTypes.func | Optional function that is called with the slide index when the slide comes into view. | |
-| progressColor | PropTypes.string | Used to override color of progress elements on a per slide basis, accepts color aliases, or valid color values. | `quaternary` color set by theme |
-| state | PropTypes.string | Used to indicate that the deck is in a specific state. Inspired by [Reveal.js](https://github.com/hakimel/reveal.js)'s `data-state` attribute | |
-| transition | PropTypes.array | Used to override transition prop on a per slide basis, accepts `slide`, `zoom`, `fade`, `spin`, or a [function](#transition-function), and can be combined. This will affect both enter and exit transitions. **Note: If you use the 'scale' transition, fitted text won't work in Safari.** | Set by `Deck`'s `transition` prop |
-| transitionIn | PropTypes.array | Specifies the slide transition when the slide comes into view. Accepts the same values as transition. |
-| transitionOut | PropTypes.array | Specifies the slide transition when the slide exits. Accepts the same values as transition. | Set by `Deck`'s `transition` prop |
-| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for slide transition duration. | Set by `Deck`'s `transition` prop |
-
-#### SlideSet
-
-With `SlideSet`, you can wrap multiple slide in it to apply the same style.
-
-```jsx
-
- Slide1
- Slide2
- Slide3
-
-```
-
-
-
-##### Transition Function
-
-Spectacle now supports defining custom transitions. The function prototype is `(transitioning: boolean, forward: boolean) => Object`. The `transitioning` param is true when the slide enters and exits. The `forward` param is `true` when the slide is entering, `false` when the slide is exiting. The function returns a style object. You can mix string-based transitions and functions. Styles provided when `transitioning` is `false` will appear during the lifecyle of the slide. An example is shown below:
-
-```jsx
- {
- const angle = forward ? -180 : 180;
- return {
- transform: `
- translate3d(0%, ${transitioning ? 100 : 0}%, 0)
- rotate(${transitioning ? angle : 0}deg)
- `,
- backgroundColor: transitioning ? '#26afff' : '#000'
- };
- }
- ]}
->
-```
-
-
-
-#### Notes
-
-The notes tag allows to use any tree of react elements as the notes of a slide. It is used as a child node of a slide tag and its children override any value given as the `notes` attribute of its parent slide.
-
-```jsx
-
-
-
Slide notes
-
-
First note
-
Second note
-
-
- {/* Slide content */}
-
-```
-
-
-
-### MarkdownSlides
-
-The MarkdownSlides function lets you create a single or multiple slides using Markdown. It can be used as a tagged template literal or a function. Three dashes (`---` are used as a delimiter between slides.
-
-**Tagged Template Literal Usage**
-
-```jsx
-
- {MarkdownSlides`
-## Slide One Title
-Slide Content
----
-## Slide Two Title
-Slide Content
- `}
-
-```
-
-**Function Usage**
-
-```jsx
-const slidesMarkdown = `
-## Slide One Title
-Slide Content
----
-## Slide Two Title
-Slide Content
- `;
-
- ....
-import slidesMarkdown from "!raw-loader!markdown.md";
-
-
- {MarkdownSlides(slidesMarkdown)}
-
-```
-
-
-
-### Layout Tags
-
-Layout tags are used for layout using Flexbox within your slide. They are `Layout`, `Fit` & `Fill`.
-
-
-
-#### Layout
-
-The layout tag is used to wrap `Fit` and `Fill` tags to provide a row.
-
-
-
-#### Fit
-
-The fit tag only takes up as much space as its bounds provide.
-
-
-
-#### Fill
-
-The fill tag takes up all the space available to it. For example, if you have a `Fill` tag next to a `Fit` tag, the `Fill` tag will take up the rest of the space. Adjacent `Fill` tags split the difference and form an equidistant grid.
-
-
-
-### Markdown Tag
-
-
-
-#### Markdown ([Base](#base-props))
-
-The Markdown tag is used to add inline markdown to your slide. You can provide markdown source via the `source` prop, or as children. You can also provide a custom [mdast configuration](https://github.com/wooorm/mdast) via the `mdastConfig` prop.
-
-Markdown generated tags aren't prop configurable, and instead render with your theme defaults.
-
-| Name | PropType | Description | Default |
-| ------ | ---------------- | --------------- | ------- |
-| source | PropTypes.string | Markdown source | |
-
-
-
-### Magic Tag
-
-
-
-#### Magic
-
-_NOTE: The Magic tag uses the Web Animations API. If you use the Magic tag and want it to work places other than Chrome, you will need to include the polyfill [https://github.com/web-animations/web-animations-js](https://github.com/web-animations/web-animations-js)_
-
-The Magic Tag recreates Magic Move behavior that slide authors might be accustomed to coming from Keynote. It wraps slides and transitions between positional values for child elements. This means that if you have two similar strings, we will transition common characters to their new positions. This does not transition on non positional values such as slide background color or font size.
-
-_⚠️ WARNING: Do not use a `transition` prop on your slides if you are wrapping them with a Magic tag since it will take care of the transition for you._
-
-```javascript
-
-
- First Heading
-
-
- Second Heading
-
-
-```
-
-Transitioning between similar states will vary based upon the input content. It will look better when there are more common elements. An upcoming patch will allow for custom keys, which will provide greater control over which elements are identified as common for reuse.
-
-Until then, feedback is very welcome, as this is a non-trivial feature and we anticipate iterating on the behind the scenes mechanics of how it works, so that we can accommodate most use cases.
-
-
-
-### Element Tags
-
-The element tags are the bread and butter of your slide content. Most of these tags derive their props from the Base class, but the ones that have special options will have them listed:
-
-
-
-#### Appear
-
-This tag does not extend from Base. It's special. Wrapping elements in the appear tag makes them appear/disappear in order in response to navigation.
-
-For best performance, wrap the contents of this tag in a native DOM element like a `
` or ``.
-
-_NOTE: When using `CodePane` tag inside an `Appear` tag you must wrap it inside a `
`_
-
-```jsx
-....
-
-
-
-
-
-....
-```
-
-| Name | PropType | Description | Default |
-| ------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
-| order | PropTypes.number | An optional integer starting at 1 for the presentation order of the Appear tags within a slide. If a slide contains ordered and unordered Appear tags, the unordered will show first. |
-| transitionDuration | PropTypes.number | An optional duration (in milliseconds) for the Appear animation. | `300` |
-| startValue | PropTypes.object | An optional style object that defines the starting, inactive state of the Appear tag. The default animation is a fade-in. | `{ opacity: 0 }` |
-| endValue | PropTypes.object | An optional style object that defines the ending, active state of the Appear tag. The default animation is a simple fade-in. | `{ opacity: 1 }` |
-| easing | PropTypes.string | An optional victory easing curve for the Appear animation. The various options are documented in the [Victory Animation easing docs](https://formidable.com/open-source/victory/docs/victory-animation/#easing). | `quadInOut` |
-
-
-
-#### Anim
-
-If you want extra flexibility with animated animation, you can use the Anim component instead of Appear. It will let you have multi-step animations for each individual fragment. You can use this to create fancy animated intros, in-slide carousels, and many other fancy things. This tag does not extend from Base. It's special.
-
-For best performance, wrap the contents of this tag in a native DOM element like a `
` or ``.
-
-_NOTE: `CodePane` tag can not be used inside a `Anim` tag._
-
-| Name | PropType | Description | Default |
-| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
-| order | PropTypes.number | An optional integer for the presentation order of the Appear tags within a slide. If a slide contains ordered and unordered Appear tags, the unordered will show first. | Starting at `1` |
-| transitionDuration | PropTypes.number | A duration (in milliseconds) for the animation. | `300` |
-| fromStyle | PropTypes.object | A style object that defines the starting, inactive state of the Anim tag. | |
-| toStyle | PropTypes.array | An array of style objects that define each step in the animation. They will step from one toStyle object to another, until that fragment is finished with its animations. | |
-| easing | PropTypes.string | A victory easing curve for the Appear animation. The various options are documented in the [Victory Animation easing docs](https://formidable.com/open-source/victory/docs/victory-animation/#easing). | |
-| onAnim | PropTypes.fun | This function is called every time the Anim component plays an animation. It'll be called with two arguments, forwards, a boolean indicating if it was stepped forwards or backwards, and the index of the animation that was just played. | |
-
-
-
-#### BlockQuote, Quote and Cite ([Base](#base-props))
-
-These tags create a styled blockquote. Use them as follows:
-
-```jsx
-
- Ken Wheeler is amazing
- Everyone
-
-```
-
-_NOTE: By default the text color of the `Quote` tag is the same as the background color and may not show up. Use the `bgColor` and/or `textColor` props on the `Slide` or `Quote` tags to make it visible._
-
-```jsx
-
-
- Example Quote
- Author
-
-
-```
-
-```jsx
-
-
- Example Quote
- Author
-
-
-```
-
-
-
-#### CodePane ([Base](#base-props))
-
-This tag displays a styled, highlighted code preview. I prefer putting my code samples in external `.example` files and requiring them using `raw-loader` as shown in the demo. Here are the props:
-
-| Name | PropType | Description | Default |
-| --------- | ---------------- | ----------------------------------------------------------------------------------- | ------- |
-| lang | PropTypes.string | Prism compatible language name. i.e: 'javascript' | |
-| source | PropTypes.string | String of code to be shown | |
-| className | PropTypes.string | String of a className to be appended to the CodePane | |
-| theme | PropTypes.string | Accepts `light`, `dark`, or `external` for the source editor's syntax highlighting. | `dark` |
-
-If you want to change the theme used here, you can include a prism theme in index.html via a style or a link tag. For your theme to be actually applied
-correctly you need to set the `theme` prop to `"external"`, which disables our builtin light and dark themes.
-Please note that including a theme can actually influence all CodePane and Playground components, even if you don't set this prop, since some Prism
-themes use very generic CSS selectors.
-
-CodePane and Playground both use the prism library under the hood, which has several themes that are available to include.
-
-
-
-#### Code ([Base](#base-props))
-
-A simple tag for wrapping inline text that you want lightly styled in a monospace font.
-
-
-
-#### Component Playground
-
-This tag displays a two-pane view with a ES6 source code editor on the right and a preview pane on the left for showing off custom React components. `React` and `render` are supplied as variables. To render a component call `render` with some JSX code. Any `console` output will be forwarded to the main console in the browser.
-
-For more information on the playground read the docs over at [react-live](https://github.com/FormidableLabs/react-live).
-
-| Name | PropType | Description | Default |
-| ---------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------- |
-| code | PropTypes.string | The code block you want to initially supply to the component playground. If none is supplied a demo component will be displayed. | |
-| previewBackgroundColor | PropTypes.string | The background color you want for the preview pane. | `#fff` |
-| theme | PropTypes.string | Accepts `light`, `dark`, or `external` for the source editor's syntax highlighting. | `dark` |
-| scope | PropTypes.object | Defines any outside modules or components to expose to the playground. React, Component, and render are supplied for you. | |
-
-Example code blocks:
-
-```jsx
-const Button = ({ title }) => ;
-render();
-```
-
-```jsx
-class View extends React.Component {
- componentDidMount() {
- console.log('Hello');
- }
-
- render() {
- return
My View
;
- }
-}
-render();
-```
-
-If you want to change the theme used here, please refer to the instructions above in the [CodePane's API reference](#codepane-base).
-
-
-
-#### Go To Action ([Base](#base-props))
-
-The GoToAction tag lets you jump to another slide in your deck. The GoToAction can be used a simple button that supports `Base` styling or accept a render prop with a callback to support custom components.
-
-| Name | PropType | Description | Default |
-| ------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
-| slide | PropTypes.string or PropTypes.number | The string identifier or number of the side the button should jump to. This is only used in the simple button configuration. | Starting at `1` |
-| render | PropTypes.func | A function with a `goToSlide` param that should return a React element to render. This is only used in the custom component configuration. | |
-
-##### Simple Button Configuration Example
-
-```jsx
-Jump to 3
-```
-
-##### Custom Component Configuration Example
-
-```jsx
- (
- goToSlide('wait-wut')}>
- WAIT WUT!?
-
- )}
-/>
-```
-
-
-
-#### Heading ([Base](#base-props))
-
-Heading tags are special in that, when you specify a `size` prop, they generate the appropriate heading tag, and extend themselves with a style that is defined in the theme file for that heading. Line height can be adjusted via a numeric `lineHeight` prop.
-
-| Name | PropType | Description | Default |
-| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- | ------- |
-| fit | PropTypes.boolean | When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** | `false` |
-| lineHeight | PropTypes.number | Sets the line height of your text. |
-| size | PropTypes.number | Sets the heading tag |
-
-
-
-#### Image ([Base](#base-props))
-
-| Name | PropType | Description | Default |
-| ------- | ------------------------------------ | ---------------------------------------------- | ------- |
-| alt | PropTypes.string | Set the `alt` attribute of the image | |
-| display | PropTypes.string | Set the `display` style attribute of the image | |
-| height | PropTypes.string or PropTypes.number | Set the `height` to the image | |
-| src | PropTypes.string | Set the `src` attribute of the image | |
-| width | PropTypes.string or PropTypes.number | Set the `width` to the image | |
-
-
-
-#### Link ([Base](#base-props))
-
-The link tag is used to render `` tags. It accepts an `href` prop:
-
-| Name | PropType | Description | Default |
-| ------ | ---------------- | ---------------------------------- | ------- |
-| href | PropTypes.string | String of url for `href` attribute | |
-| target | PropTypes.string | Set the `target` attribute | `_self` |
-
-
-
-#### List & ListItem ([Base](#base-props))
-
-| Name | PropType | Description | Default |
-| ----------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
-| ordered | PropTypes.bool | Render as `` tag | |
-| reversed | PropTypes.bool | Set the `reversed` attribute | |
-| start | PropTypes.number | Set the `start` attribute. | `1` |
-| type | PropTypes.string | Set the `type` attribute. | `"1"` |
-| bulletStyle | PropTypes.string | Allows to customize list bullets for unordered-list. You can set `bulletStyle="star"` both in `List` and `ListItem` components. When `ListItem` prop is set it will overwrite the `List` styling only for the specific `ListItem`. You can either use built-in strings: `star`, `classicCheck`, `greenCheck`, `arrow`, `cross`, or any unicode number `bulletStyle="274C"` |
-
-These tags create lists. Use them as follows:
-
-Ordered lists:
-
-```jsx
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-```
-
-Unordered lists:
-
-```jsx
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-```
-
-
-
-#### S ([Base](#base-props))
-
-The `S` tag is used to add styling to a piece of text, such as underline or strikethrough.
-
-| Name | PropType | Description | Default |
-| ---- | ---------------- | -------------------------------------------------------- | ------- |
-| type | PropTypes.string | Accepts `strikethrough`, `underline`, `bold` or `italic` | |
-
-
-
-#### Table, TableRow, TableHeaderItem and TableItem ([Base](#base-props))
-
-The `Table` tag is used to add table to your slide. It is used with `TableHeader`, `TableBody`, `TableRow`, `TableHeaderItem` and `TableItem`. Use them as follows:
-
-```jsx
-
-```
-
-
-
-#### Text ([Base](#base-props))
-
-The `Text` tag is used to add text to your slide. Line height can be adjusted via a numeric `lineHeight` prop.
-
-| Name | PropType | Description | Default |
-| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- | ------- |
-| fit | PropTypes.boolean | When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** | |
-| lineHeight | PropTypes.number | Sets the line height of your text. | |
-
-
-
-### Base Props
-
-Every component above that has `(Base)` after it has been extended from a common class that includes the following props:
-
-| Name | PropType | Description | Default |
-| ------------ | -------------------------- | ---------------------------------------------------------------------------- | --------------- |
-| italic | PropTypes.boolean | Set `fontStyle` to `italic` | `false` |
-| bold | PropTypes.boolean | Set `fontWeight` to `bold` | `false` |
-| caps | PropTypes.boolean | Set `textTransform` to `uppercase` | `false` |
-| margin | PropTypes.number or string | Set `margin` value | |
-| padding | PropTypes.number or string | Set `padding` value | |
-| textColor | PropTypes.string | Set `color` value | |
-| textFont | PropTypes.string | Set `fontFamily` value | |
-| textSize | PropTypes.string | Set `fontSize` value | |
-| textAlign | PropTypes.string | Set `textAlign` value | |
-| bgColor | PropTypes.string | Set `backgroundColor` value | |
-| bgGradient | PropTypes.string | Set `backgroundImage` value | |
-| bgImage | PropTypes.string | Set `backgroundImage` value | |
-| bgImageStyle | PropTypes.string | Set backgroundImage css property value directly | |
-| bgSize | PropTypes.string | Set `backgroundSize` value | `cover` |
-| bgPosition | PropTypes.string | Set `backgroundPosition` value | `center center` |
-| bgRepeat | PropTypes.string | Set `backgroundRepeat` value | |
-| bgDarken | PropTypes.number | Float value from 0.0 to 1.0 specifying how much to darken the bgImage image | 0 |
-| bgLighten | PropTypes.number | Float value from 0.0 to 1.0 specifying how much to lighten the bgImage image | 0 |
-| overflow | PropTypes.string | Set `overflow` value | |
-| height | PropTypes.string | Set `height` value | |
-
-_NOTE: When using `bgImage` prop for local images, you must import the file for it to render properly._
-
-```jsx
-import myImage from './images/my-image.jpg';
-
-......
-
-
- I have an image for a background
-
-```
-
-
-
-#### Typeface
+Welcome to our monorepo project, housing the core [`spectacle` package](https://github.com/FormidableLabs/spectacle/blob/main/packages/spectacle/README.md) and related tools and examples.
-The `Typeface` tag is used to apply a specific font to text content. It can either use a font that exists on the system or load a font from the Google Fonts library. `Typeface` requires either `font` or `googleFont` to be defined.
+Come learn more at our [docs site]!
-| Name | PropType | Description | Default |
-| ---------- | ----------------- | ------------------------------------------------ | ------- |
-| font | PropTypes.string | Use a font from the local system | |
-| googleFont | PropTypes.string | Use a font from the Google Fonts library | |
-| weight | PropTypes.number | Numeric weight value for the font. | `400` |
-| italic | PropTypes.boolean | Use an italics variant of the font if it exists. | `false` |
+## Support
-```jsx
-
- This text is using bold Roboto Slab from Google Fonts.
-
-```
+Have a question about Spectacle? Submit an issue in this repository using the
+["Question" template](https://github.com/FormidableLabs/spectacle/issues/new?template=question.md).
-```jsx
-
- This text is using the San Francisco Text font from the system.
-
-```
+Notice something inaccurate or confusing? Feel free to [open an issue](https://github.com/FormidableLabs/spectacle/issues) or [make a pull request](https://github.com/FormidableLabs/spectacle/pulls) to help improve the documentation for everyone!
-
+The source for our docs site lives in this repo in the [`docs`](https://github.com/FormidableLabs/spectacle/blob/main/docs/README.md) folder.
-## Third Party Extensions
+## Contributing
-- [Spectacle Code Slide](https://github.com/thejameskyle/spectacle-code-slide) - Step through lines of code using this awesome slide extension by @thejameskyle
-- [Spectacle Terminal Slide](https://github.com/elijahmanor/spectacle-terminal) - Terminal component that can be used in a spectacle slide deck by @elijahmanor
-- [Spectacle Image Slide](https://github.com/FezVrasta/spectacle-image-slide) - Show a slide with a big image and a title on top
+Please see our [contributing guide](CONTRIBUTING.md).
## Maintenance Status
**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
-[trav_img]: https://api.travis-ci.org/FormidableLabs/spectacle.svg
-[trav_site]: https://travis-ci.org/FormidableLabs/spectacle
-[maintenance-image]: https://img.shields.io/badge/maintenance-active-green.svg
+[docs site]: https://www.formidable.com/open-source/spectacle
diff --git a/__mocks__/styleMock.js b/__mocks__/styleMock.js
deleted file mode 100644
index f053ebf79..000000000
--- a/__mocks__/styleMock.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = {};
diff --git a/__mocks__/use-resize-observer.js b/__mocks__/use-resize-observer.js
new file mode 100644
index 000000000..cc40a4649
--- /dev/null
+++ b/__mocks__/use-resize-observer.js
@@ -0,0 +1 @@
+module.exports = () => {};
diff --git a/docs/advanced-concepts.md b/docs/advanced-concepts.md
new file mode 100644
index 000000000..a40724973
--- /dev/null
+++ b/docs/advanced-concepts.md
@@ -0,0 +1,37 @@
+---
+title: Advanced Concepts
+order: 2
+sidebar_position: 2
+---
+
+# Advanced Concepts
+
+## Build & Deployment
+
+There are a variety of ways to host your Spectacle presentation.
+
+1. If you are integrating this lib yourself, take your build and follow the linked instructions from any of (but not limited to) the following providers: [Heroku](https://devcenter.heroku.com/articles/git#deploying-code), [Zeit](https://zeit.co/docs/v2/platform/deployments), or [Surge](https://surge.sh/help/deploying-continuously-using-git-hooks).
+
+2. If using `spectacle-cli` (either `spectacle --action build` or `spectacle-boilerplate` with `yarn clean && yarn build`) your output is `dist/` and upload that directory to any of the above static hosting providers.
+
+## Keyboard Controls
+
+| Key Combination | Function |
+| --------------- | ---------------------- |
+| Right Arrow | Next Slide |
+| Left Arrow | Previous Slide |
+| Alt/Option + O | Toggle Overview Mode |
+| Alt/Option + P | Toggle Presenter Mode |
+| Alt/Option + F | Toggle Fullscreen Mode |
+
+## Query Parameters
+
+A handful of query parameters are supported within your Spectacle presentation.
+Append your URL with one of the following parameters, like so: `&=true`.
+To combine parameters, use multiple `&` to separate the parameters, e.g.: `&exportMode=true&printMode=true`
+
+| Parameter | Description of Use |
+| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `exportMode` | For exporting your presentation as a PDF. Add it to your project URL and "Save to PDF" directly from the browser |
+| `printMode` | Turns your slideshow into a printer-friendly, black & white version. Meant for use concurrently with `?exportMode` e.g. `?exportMode=true&printMode=true` |
+| `presenterMode` | Displays a Presenter Mode for ease of presentation. For more info on this mode, please see [Presenting](./index.md#presenting) in our Basic Concepts doc |
diff --git a/docs/api-reference.md b/docs/api-reference.md
new file mode 100644
index 000000000..0b58ed15b
--- /dev/null
+++ b/docs/api-reference.md
@@ -0,0 +1,485 @@
+---
+title: API Reference
+order: 5
+sidebar_position: 5
+---
+
+# API Reference
+
+In Spectacle, presentations are composed of a set of base tags. We can separate these into three categories: [Main tags](#main-tags), [Typography tags](#typography-tags) & [Layout tags](#layout-tags).
+
+## Main Tags
+
+These are the bare bones of a Spectacle presentation, the two most essential tags you'll need to assemble a slideshow.
+
+### Deck
+
+Wraps the entire presentation and carries most of the overarching slide logic, like `theme` and `template` context.
+A `template` contains Layout tags (referred to as a template render function) and is supplied to the `Deck` component to apply to all subsequent `Slide`s. The last three props are for print and export mode only, they have no effect on the audience or presenter views. The `pageSize` and `pageOrientation` props correspond to the size and orientation values for the [CSS media print size selector](https://developer.mozilla.org/en-US/docs/Web/CSS/@page/size). The `pageSize` is 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 the `pageSize` prop. The `printScale` is the ratio for the selected page size, orientation, and slide size. `0.958` is the best ratio for to ensure the PDF export fits the slide theme size. Currently, only Chrome and Chromium-based browsers fully implement the custom page size CSS media print specification. Other browsers such as Firefox and Safari can still export to PDF but the page size will not be a best fit.
+
+| Props | Type | Default |
+| ------------------ | ------------------------------------------- | ------------------ |
+| `theme` | [Styled-system theme object](./themes.md) | |
+| `template` | [Template render function](#layout-tags) | |
+| `pageSize` | PropTypes.string | `"13.66in 7.68in"` |
+| `pageOrientation` | `"landscape"` or `"portrait"` | `"landscape"` |
+| `printScale` | PropTypes.number | `0.959` |
+| `autoPlay` | PropTypes.bool | `false` |
+| `autoPlayLoop` | PropTypes.bool | `false` |
+| `autoPlayInterval` | PropTypes.number (milliseconds) | `1000` |
+| `transition` | [**Transition**](./props.md#transition-object) | `slideTransition` |
+| `backgroundImage` | PropTypes.string | |
+
+
+### Slide
+
+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 | Type |
+| -------------------- | ------------------------------------------- |
+| `backgroundColor` | PropTypes.string |
+| `backgroundImage` | PropTypes.string |
+| `backgroundOpacity` | PropTypes.number |
+| `backgroundPosition` | PropTypes.string |
+| `backgroundRepeat` | PropTypes.string |
+| `backgroundSize` | PropTypes.string |
+| `scaleRatio` | PropTypes.number |
+| `slideNum` | PropTypes.number |
+| `template` | PropTypes.func |
+| `textColor` | PropTypes.string |
+| `transition` | [**Transition**](./props.md#transition-object) |
+
+## Typography Tags
+
+These tags are for displaying textual content.
+
+| Tag Name | Theme Props | Additional Props | Default Props |
+| ------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`Text`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **color**: primary **fontFamily**: text **fontSize**: text **textAlign**: left **margin**: textMargin |
+| **`Heading`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **color**: secondary **fontFamily**: header **fontSize**: h1 **fontWeight**: bold **textAlign**: center **margin**: headerMargin |
+| **`Link`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | **href**: PropTypes.string | **color**: quaternary **fontFamily**: text **fontSize**: text **textDecoration**: underline **textAlign**: left **margin**: textMargin |
+| **`Quote`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **color**: primary **fontFamily**: text **fontSize**: text **textAlign**: left **borderLeft**: 1px solid secondary |
+| **`OrderedList`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **color**: primary **fontFamily**: text **fontSize**: text **textAlign**: left **margin**: listMargin |
+| **`UnorderedList`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **color**: primary **fontFamily**: text **fontSize**: text **textAlign**: left **margin**: listMargin |
+| **`ListItem`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **margin**: listMargin |
+| **`CodeSpan`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Typography**](./props.md#typography) | — | **fontFamily**: monospace **fontSize**: text |
+
+## Layout Tags
+
+These tags are for adding structure to your slides.
+A template render function consists of one or more Layout tags — it is supplied to the `Deck` component to apply to all subsequent `Slide`s.
+
+| Tag Name | Theme Props | Additional Props | Default Props |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------------- |
+| **`Box`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Position**](./props.md#position) [**Border**](./props.md#border) | — | — |
+| **`FlexBox`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Position**](./props.md#position) [**Border**](./props.md#border) [**Flex**](./props.md#flex) | — | — |
+| **`Grid`** | [**Layout**](./props.md#layout) [**Position**](./props.md#position) [**Grid**](./props.md#grid) | — | **display**: grid |
+
+## Table Tags
+
+These tags are for adding tables with content to your slides.
+
+| Tag Name | Theme Props | Additional Props | Default Props |
+| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`Table`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Typography**](./props.md#typography) [**Border**](./props.md#border) | - | **color**: primary **fontFamily**: text **fontSize**: text **textAlign:** left **margin**: listMargin |
+| **`TableHeader`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Typography**](./props.md#typography) [**Border**](./props.md#border) | - | **color**: primary **fontFamily**: text **fontSize**: text **fontWeight**: bold **textAlign:** left **margin**: listMargin |
+| **`TableBody`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Typography**](./props.md#typography) [**Border**](./props.md#border) | - | **color**: primary **fontFamily**: text **fontSize**: text **textAlign:** left **margin**: listMargin |
+| **`TableRow`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Typography**](./props.md#typography) [**Border**](./props.md#border) | - | **color**: primary **fontFamily**: text **fontSize**: text **textAlign:** left **margin**: listMargin |
+| **`TableCell`** | [**Space**](./props.md#space) [**Color**](./props.md#color) [**Layout**](./props.md#layout) [**Typography**](./props.md#typography) [**Border**](./props.md#border) | - | **color**: primary **fontFamily**: text **fontSize**: text **textAlign:** left **margin**: listMargin |
+
+## useSteps
+
+The `useSteps` hook allows a component to participate in the _slide step sequence_ for a given Slide.
+
+NOTE: the vast majority of use cases are covered by the `Stepper` and `Appear` components documented below- in fact, they are implemented via this hook. The only case in which you may need to use this hook explicitly is if you need more precise control over a component in your presentation.
+
+### Arguments and Options
+
+- `numSteps` The first argument to this hook, `numSteps`, indicates how many steps your component will occupy in the slide step sequence. The second argument is an options object which accepts two options: `id` and `stepIndex`.
+- `options.id`: _(For debugging and testing purposes only.)_ Allows you to customize the step sequence ID for this component.
+- `options.priority`: Allows fine-grained control over the sequencing of multiple step sequence participants in a given Slide. By default, participants will be activated in the order in which they are rendered. However, this option allows you to specify a "priority"- for instance, a participant with `priority: -1` will run before any other participant, _regardless_ of render order.
+
+### Return Values
+
+This hook returns four values: `stepId`, `isActive`, `step`, and `placeholder`.
+
+- `stepId`: _(For debugging and testing purposes only.)_ Either the `id` option passed into the hook, or a randomly-generated ULID.
+- `step`: the _relative_ step within this participant's step sequence. Before the slide has reached this participant, this value is `-1`. When the slide reaches this stepper, it will increase at each step until it reaches `numSteps - 1`, and will remain there after the slide step has 'passed' it.
+- `isActive`: Boolean value indicating whether the slide step sequence has reached this participant. Equivalent to the expression `step >= 0`.
+- `placeholder`: DOM node which _must_ be rendered by the consumer component- this is how a Slide detects step sequence participants.
+
+## Stepper
+
+`` is a thin wrapper around `useSteps`. The length of its `values` list indicates the number of steps it occupies in the slide step sequence. Each of these values are passed in turn to the render function you provide. Additionally, it allows you to specify styles which should be applied before and after it is activated, and uses `react-spring` to interpolate between the 'active style' and the 'inactive style'.
+
+The render function you provide (either via the `render` prop or as a '`children` function') is called with three arguments:
+
+- The element of the list passed to `values` which corresponds to the current step (or `undefined` if the Stepper is inactive)
+- The current step _relative_ to this Stepper's sequence (which will be `-1` if the Stepper is inactive)
+- A boolean value (`isActive`) indicating whether the Stepper is active.
+
+For instance, suppose we render a slide like this:
+
+```jsx
+
+
Hello, world!
+
+ {(value, step, isActive) =>
+ isActive
+ ? `The first stepper is not active. Step: ${step} Value: ${value}`
+ : `The first stepper is active. Step: ${step} Value: ${value}`
+ }
+
+
+ {(value, step, isActive) =>
+ isActive
+ ? `The second stepper is not active. Step: ${step} Value: ${value}`
+ : `The second stepper is active. Step: ${step} Value: ${value}`
+ }
+
+
+```
+
+The following output will be rendered as you step through the slide:
+
+```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
+```
+
+### Props
+
+- `id`: _(For debugging and testing purposes only)_ Passed to `useSteps`.
+- `priority`: Passed to `useSteps`.
+- `render`: Render function (see above.)
+- `children`: Render function (see above.)
+- `className`: Class name applied to the animated container element.
+- `tagName`: Tag which will be used as the animated container element. Defaults to `div`.
+- `values`: Values array (see description above).
+- `alwaysVisible`: Forces this stepper to always have its active style applied.
+- `activeStyle`: Style object applied when this `` is active. Defaults to `{ opacity: 1 }`.
+- `inactiveStyle`: Style object applied when this `` is inactive. Defaults to `{ opacity: 0 }`.
+
+## Appear
+
+Appear is a thin wrapper around `useSteps`. It occupies a single step within the slide step sequence. It wraps its child elements in an animated container element, and uses `react-spring` to interpolate between its `activeStyle` and `inactiveStyle`.
+
+### Props
+
+- `id`: _(For debugging and testing purposes only)_ Passed to `useSteps`.
+- `priority`: Passed to `useSteps`.
+- `children`: Children rendered within this `Appear`.
+- `className`: Class name applied to the animated container element.
+- `tagName`: Tag which will be used as the animated container element. Defaults to `div`.
+- `activeStyle`: Style object applied when this `` is active. Defaults to `{ opacity: 1 }`.
+- `inactiveStyle`: Style object applied when this `` is inactive. Defaults to `{ opacity: 0 }`.
+
+## Code Pane
+
+CodePane is a component for showing a syntax-highlighted block of source code. It will scroll for overflow amounts of code, trim whitespace and normalize indents. It will also wrap long lines of code and preserve the indent. CodePane uses the [React Syntax Highlighter](https://github.com/react-syntax-highlighter/react-syntax-highlighter) Component.
+
+The `theme` prop accepts a configurable object or pre-defined theme object from the available [Prism Themes](https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/src/styles/prism/index.js).
+
+Additionally, the `highlightRanges` prop accepts an array that can be used to highlight certain ranges of code:
+
+This array can contain a range of two numbers, where the first number indicates the _start_, and the second number the _end_ of that range, e.g.,
+
+`[1, 3]` will highlight lines 1 through 3.
+
+It can also contain a list of sub-arrays which will be considered as a list of ranges, e.g.,
+
+`[[1, 3], [6, 8], [10, 15]]`.
+
+Array values can even be mixed to include sub-arrays (for multiple lines) and numbers (for single lines), e.g.,
+
+`[[1, 3], 5, [6, 8], [10, 15], 20]`.
+
+_Note that each range will be considered as a step in your current slide's animation. Each range will be highlighted as you move forward or backwards on each step._
+
+| Props | Type | Example | Default Props |
+| ---------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------- |
+| `children` | PropTypes.string | `let name = "Carlos"` | - |
+| `highlightRanges` | PropTypes.arrayOf(PropTypes.number) or PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)) | `[1, 3]` or `[[6, 8], [10, 15]]` | - |
+| `language` | PropTypes.string | `javascript` | - |
+| `theme` | PropTypes.object or | [Prism Theme](https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/src/styles/prism/index.js) | vs-dark Theme Object |
+| `showLineNumbers` | PropTypes.bool | `true`, `false` | `true` |
+| [**`Layout`**](./props.md#layout) | | | |
+| [**`Position`**](./props.md#position) | | | |
+
+```jsx
+import tomorrow from 'react-syntax-highlighter/dist/cjs/styles/prism/tomorrow';
+
+() => (
+
+
+ {`
+ const App = () => (
+
+
+
+ );
+ `}
+
+
+);
+```
+
+## FullScreen
+
+FullScreen is a button that takes the presentation in and out of the browser's full screen mode. It can have a different color and be re-sized.
+
+| Props | Type | Example |
+| ---------------------------------- | ---------------- | --------- |
+| `size` | PropTypes.number | `23` |
+| `color` | PropTypes.string | `#abc123` |
+| [**`Position`**](./props.md#position) | | |
+
+## Image
+
+Image is a component to display a picture within a slide. It is analogous to an `` tag and conforms to Layout and Position props.
+
+| Props | Type |
+| ---------------------------------- | ---------------- |
+| src | PropTypes.string |
+| [**`Layout`**](./props.md#layout) | |
+| [**`Position`**](./props.md#position) | |
+
+## Markdown Components
+
+The Markdown components let you include a block of Markdown within a slide using ``, author a complete slide with Markdown using ``, or author a series of slides with Markdown using ``. Markdown tags get converted into Spectacle components. The `---` three dash marker when used inside `` is used to divide content into separate slides. Markdown also supports presenter notes using the `Notes:` marker. `` must be a child of `` where `` and `` are children of ``.
+
+| Props | Type | Example |
+| ---------------------------------- | ----------------- | ----------------------------------------------------------------------------------- |
+| `children` | PropTypes.string | `# Hi there` |
+| `componentProps` | PropTypes.object | `# I'm purple!` |
+| `animateListItems` | PropTypes.boolean | `` |
+| [**`Layout`**](./props.md#layout) | | |
+| [**`Position`**](./props.md#position) | | |
+
+```jsx
+
+
+ # Urql
+ A highly customizable and versatile GraphQL client
+
+ Made by Formidable
+
+
+ # 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.
+
+
+ # 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'.
+
+```
+
+#### v7 Migration Guide
+
+In prior versions of Spectacle the `` component was used for slides, set and markdown content. As noted above there are now three specific components for each of these use cases.
+
+1. `` remains the same.
+2. `` when used for a full slide is now ``.
+3. `` is now ``.
+
+## Notes
+
+Notes is a component that only renders in Presenter mode as presenter notes. It is used as the last component inside your slide but does not show on the deck.
+
+| Props | Type | Example |
+| ---------- | ---------------- | ----------------- |
+| `children` | PropTypes.string | `Presenter Notes` |
+
+```jsx
+
+ Urql
+ A highly customizable and versatile GraphQL client
+
+ Urql is a GraphQL client that exposes a set of React components and hooks.
+
+
+```
+
+## Progress
+
+Progress is a component with no children that just shows dots for each slide in your deck. The current slide is represented by a filled circle. Visited and future slides are represented by a transparent, outlined circle. The size and color are customizable.
+
+| Props | Type | Example |
+| ---------------------------------- | ---------------- | --------- |
+| `size` | PropTypes.number | `23` |
+| `color` | PropTypes.string | `#abc123` |
+| [**`Position`**](./props.md#position) | | |
+
+## AnimatedProgress
+
+AnimatedProgress is similar to the Progress component, with an additional Pacman character that moves when the current slide changes. It looks like the Pacman is eating all of the circles that represent slides up to, and including, the new current slide. The size and color of the circles are customizable, as is the color of the Pacman.
+
+| Props | Type | Example |
+| ---------------------------------- | ---------------- | --------- |
+| `size` | PropTypes.number | `23` |
+| `color` | PropTypes.string | `#abc123` |
+| `pacmanColor` | PropTypes.string | `#abc123` |
+| [**`Position`**](./props.md#position) | | |
+
+## SlideLayout
+
+`SlideLayout` is a set of helper components used to create slides from a set of pre-defined layouts, so you can avoid dealing with things like layout primitives.
+
+### `SlideLayout.Full`
+
+A full-slide layout for if you need basic slide with nothing in your way.
+
+| Props | Type | Example |
+|-----------------|-----------------------|---------|
+| `...slideProps` | [Slide Props](#slide) | |
+
+### `SlideLayout.Center`
+
+A centered-content layout for if you want to display your slide content as a piece of content centered on the slide.
+
+| Props | Type | Example |
+|-----------------|-----------------------|---------|
+| `...slideProps` | [Slide Props](#slide) | |
+
+### `SlideLayout.TwoColumn`
+
+A two-column layout for if you want to easily split your slide content into two equal-sized columns.
+
+| Props | Type | Example |
+|-----------------|-----------------------|----------------------------------|
+| `...slideProps` | [Slide Props](#slide) | |
+| `left` | `ReactNode` | `Hello world` |
+| `right` | `ReactNode` | `Hello world` |
+
+### `SlideLayout.List`
+
+A layout with a list and an optional title for if you want to quickly display a list of items.
+
+| Props | Type | Required | Example |
+|--------------------|-------------------------------------|----------|---------------------------------|
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `title` | `string` | ❌ | `My list slide` |
+| `titleProps` | [Heading Props](./props.md/#typograph) | ❌ | `{ color: 'red' }` |
+| `items` | `ReactNode[]` | ✅ | `['Hello', World]` |
+| `animateListItems` | `boolean` | ❌ | `true` |
+| `listProps` | [List Props](#typography-tags) | ❌ | `{ backgroundColor: 'purple' }` |
+
+
+### `SlideLayout.Section`
+
+A vertically-centered left-aligned section title layout for if you want title page for a new section.
+
+| Props | Type | Required | Example |
+|------------------------|---------------------------------|----------|--------------------------|
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `sectionProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "48px" } |
+
+### `SlideLayout.Statement`
+
+A vertically-centered center-aligned statement for if you want to make a statement.
+
+| Props | Type | Required | Example |
+|------------------------|---------------------------------|----------|--------------------------|
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `statementProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "48px" } |
+
+### `SlideLayout.BigFact`
+
+A centered Big Fact layout for if you want to present a fact in a large font.
+
+| Props | Type | Required | Example | Default |
+|------------------------|--------------------------------|----------|-----------------------|---------|
+| `children` | `ReactNode` | ✅ | `100%` | |
+| `...slideProps` | [Slide Props](#slide) | ❌ | | |
+| `factInformation` | `ReactNode` | ❌ | `Fact information` | |
+| `factProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "100px" } | |
+| `factInformationProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "48px" } | |
+| `factFontSize` | `string` | ❌ | `150px` | `250px` |
+
+### `SlideLayout.Quote`
+
+A vertically-centered Quote layout for if you want to present a quote and attribute it to someone.
+
+| Props | Type | Required | Example |
+|--------------------|--------------------------------|----------|-----------------------|
+| `children` | `ReactNode` | ✅ | `To be, or not to be` |
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `attribution` | `ReactNode` | ✅ | `William Shakespeare` |
+| `quoteProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "100px" } |
+| `attributionProps` | [Text Props](#typography-tags) | ❌ | { fontSize: "48px" } |
+
+### `SlideLayout.Code`
+
+A layout with a single code pane and an optional title for if you want one code block per slide.
+
+| Props | Type | Required | Example |
+|-----------------|-----------------------------------|----------|------------------------------------------------------------------|
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `title` | `string` | ❌ | `Show me the code!` |
+| `titleProps` | [Heading Props](#typography-tags) | ❌ | `{ color: 'red' }` |
+| `children` | `string` | ✅ | `const Component = (props: componentProps): JSX.Element = {...}` |
+| `language` | `boolean` | ✅ | `false` |
+| `codePaneProps` | `CodePaneProps` | ❌ | |
+
+### `SlideLayout.MultiCodeLayout`
+
+A layout with multiple code panes and optional descriptions, and an optional title for if you want more than one code block per slide or code with description text.
+
+| Props | Type | Required | Example |
+|-----------------|-----------------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
+| `...slideProps` | [Slide Props](#slide) | ❌ | |
+| `title` | `string` | ❌ | `Show me the code!` |
+| `titleProps` | [Heading Props](#typography-tags) | ❌ | `{ color: 'red' }` |
+| `numColumns` | `number` | ❌ | `{2}` |
+| `codeBlocks` | `CodeBlock[]` | ✅ | `[{ code: 'console.log("hello world!")', language: 'jsx', description: 'Say hello', codePaneProps: {...} }, {...}]` |
+
+where
+
+```ts
+type CodeBlock = Omit & {
+ code: CodePaneProps['children'];
+ description?: string | ReactNode;
+ descriptionProps?: ComponentProps;
+}
+```
diff --git a/docs/basic-concepts.md b/docs/basic-concepts.md
deleted file mode 100644
index a9869c7d1..000000000
--- a/docs/basic-concepts.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-# Basic Concepts
-
-
-
-## Main file
-
-Your presentation files & assets will live in the `presentation` folder.
-
-The main `.js` file you write your deck in is `/presentation/index.js`
-
-Check it out [here](https://github.com/FormidableLabs/spectacle-boilerplate/blob/master/presentation/index.js) in the boilerplate.
-
-```jsx
-// index.js
-
-import React, { Component } from 'react';
-import {
- Appear,
- BlockQuote,
- Cite,
- CodePane,
- Code,
- Deck,
- Fill,
- Fit,
- Heading,
- Image,
- Layout,
- ListItem,
- List,
- Quote,
- Spectacle,
- Slide,
- Text
-} from 'spectacle';
-
-export default class extends Component {
- render() {
- return (
-
-
-
- Hello
-
-
-
- );
- }
-}
-```
-
-Here is where you can use the library's tags to compose your presentation. While you can use any JSX syntax here, building your presentation with the supplied tags allows for theming to work properly.
-
-The bare minimum you need to start is a `Spectacle` element, a`Deck` element and a `Slide` element. Each `Slide` element represents a slide inside of your slideshow.
-
-
-
-## Themes
-
-In Spectacle, themes are functions that return style objects for `screen` & `print`.
-
-You can import the default theme from:
-
-```jsx
-import createTheme from 'spectacle/lib/themes/default';
-```
-
-Or create your own based upon the source.
-
-`index.js` is what you would edit in order to create a custom theme of your own, using ReactJS style inline style objects.
-
-You will want to edit `index.html` to include any web fonts or additional CSS that your theme requires.
-
-
-
-### createTheme(colors, fonts)
-
-Spectacle's functional theme system allows you to pass in color and font variables that you can use on your elements. See the example below:
-
-```jsx
-const theme = createTheme(
- {
- primary: 'red'
- },
- {
- primary: 'Helvetica'
- }
-);
-```
-
-The returned theme object can then be passed to the `Spectacle` tag via the `theme` prop, and will override the default styles.
diff --git a/docs/extensions.md b/docs/extensions.md
index 9d6227854..1b02e63f1 100644
--- a/docs/extensions.md
+++ b/docs/extensions.md
@@ -1,6 +1,32 @@
-
+---
+title: Extensions
+order: 7
+sidebar_position: 7
+---
-# Spectacle Extensions
+# Third Party Extensions
-- [Spectacle Editor](https://www.formidable.com/open-source/spectacle-editor) - A desktop application to create your own Spectacle-based presentations using drag and drop, text editors, and more. Plotly integrated and open sourced. Created by [Formidable](https://www.formidable.com) in partnership with [Plotly](https://plot.ly).
-- [Spectacle Code Slide](https://github.com/thejameskyle/spectacle-code-slide) - Step through lines of code using this awesome slide extension by [@thejameskyle](https://github.com/thejameskyle).
+In the past, developers across the open-source-iverse have created extensions for use within your Spectacle presentation.
+
+Since the [release of v6](https://github.com/FormidableLabs/spectacle/releases/tag/v6.0.0), the previously developed extensions are no longer compatible with the latest and greatest in Spectacle. We hope that changes soon, and we are happy to support you...
+
+- ... in updating your project if you're one of the folks with a now-deprecated tool.
+- ... with PR review and feedback if you're interested in writing a new tool and don't know where to start.
+
+To see a list of the extensions we've listed here in the past, please check out [the archive in git](https://github.com/FormidableLabs/spectacle/blob/3fd0e850ebab65758b1a4db04c8edef5f2cee81e/docs/content/extensions.md).
+
+# Formidable Extensions
+
+There are a few companion projects that Formidable directly maintains.
+
+## spectacle-cli
+
+A collection of tools for serving or generating new presentation decks. Includes `spectacle` and `spectacle-boilerplate`.
+
+For complete documentation of the CLI, please check out [the repository](https://www.github.com/FormidableLabs/spectacle-cli).
+
+## spectacle-mdx-loader
+
+A webpack MDX loader for Spectacle presentations.
+
+See [the repository](https://www.github.com/FormidableLabs/spectacle-mdx-loader) for usage, integration, and more information.
diff --git a/docs/faq.md b/docs/faq.md
new file mode 100644
index 000000000..44fd641d1
--- /dev/null
+++ b/docs/faq.md
@@ -0,0 +1,19 @@
+---
+title: FAQ
+order: 8
+sidebar_position: 8
+---
+
+# Frequently Asked Questions
+
+## Can I export my slides for use elsewhere?
+
+Yes - you can export your slides in PDF format. Appending your presentation URL with `?exportMode=true` will allow you to export your presentation by flattening out your presentation so that you can Print to PDF directly from your browser. 🎉
+
+If you want a black & white version of your slides printed to PDF, append your URL with `?exportMode=true&printMode=true` to get a printer-friendly, flattened, black & white print out of your slideshow.
+
+For more info about the query parameters Spectacle supports, please check out our section about it in the [advanced concepts documentation](./advanced-concepts.md#query-parameters).
+
+## Can I write my presentation in TypeScript?
+
+Yes - Spectacle types are shipped with the package, so you can safely use Spectacle in any `.ts` or `.js` presentation without a separate type definition import.
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 000000000..d8cf24ce8
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,149 @@
+---
+sidebar_label: Basic Concepts
+order: 1
+sidebar_position: 1
+slug: /
+---
+
+# Basic Concepts
+
+## Installation
+
+Installing Spectacle is as quick as you'd expect. Install it using your package manager of choice.
+
+```bash
+$ yarn add spectacle
+# or
+$ npm install --save spectacle
+```
+
+## Getting Started with Development
+
+The `src` directory contains all the source for the Spectacle library. All components designed to be part of the Spectacle API must be exported in `src/index.tsx`.
+
+#### JavaScript-based Decks
+
+To start the development server at port `3000` against a JavaScript-based deck (found in `examples/js`) use `yarn start:js` or `npm run start:js`.
+
+#### Markdown-based Decks
+
+To start the development server at port `3100` against a Markdown-based deck (found in `examples/md`) use `yarn start:md` or `npm run start:md`.
+
+## Writing your Presentation
+
+After installing Spectacle, all of your presentation and style logic will live in a main file, while your content exists either inline (with JSX) or in a separate markdown file (using MDX).
+
+### MDX/Markdown
+
+This approach involves statically generating your slides from a `.mdx` or .`md` file, which is accomplished with [`spectacle-cli`](https://www.github.com/FormidableLabs/spectacle-cli). With this package, you can either generate a new presentation (with the `spectacle-boilerplate` tool) or you can serve up an existing MDX/Markdown file as a presentation (with `spectacle -s`). It can be installed globally, locally, or used via `npx`.
+
+```bash
+# globally install `spectacle` and `spectacle-boilerplate` tools
+$ npm install --global spectacle-cli
+$ yarn global add spectacle-cli
+
+# serving a presentation using npx
+$ npx spectacle-cli
+
+# generating a new presentation using npx
+$ npx -p spectacle-cli spectacle-boilerplate
+```
+
+To serve a local Markdown or MDX file up as a presentation with the CLI tool:
+
+```bash
+# navigate to the directory containing your slides
+$ cd my-cool-presentation
+
+# run the CLI (given there is a slides.md or slides.mdx in the CWD)
+$ spectacle -s
+```
+
+To generate a new MDX or MD presentation using the boilerplate tool:
+
+```bash
+$ spectacle-boilerplate -m mdx
+$ spectacle-boilerplate -m md
+```
+
+To see a more complete examples of a presentation generated with MDX or Markdown, please check out our three samples available for use with the CLI as well as manual builds:
+
+- [`.md` Example](https://github.com/FormidableLabs/spectacle/tree/main/examples/md) (`spectacle`)
+- [`.mdx` Example](https://github.com/FormidableLabs/spectacle-mdx-loader/tree/main/examples/mdx) (`spectacle-mdx-loader`)
+- [`.mdx` + Babel Example](https://github.com/FormidableLabs/spectacle-cli/tree/main/examples/cli-mdx-babel) (`spectacle-cli`)
+
+For a more thorough understanding of the features and flags provided by the CLI, please see its [complete documentation](./extensions.md#spectacle-cli).
+
+**Note:** If you want to manually create the build infrastructure for MDX support in a Spectacle deck, you can add the [`spectacle-mdx-loader`](https://github.com/FormidableLabs/spectacle-mdx-loader) plugin to your webpack configuration.
+
+### JSX
+
+This approach is where you use the library's tags to compose your presentation. While you can mix in your own JSX syntax here, building your presentation with the supplied tags will allow for out-of-box themeing and layouts to work properly.
+
+The bare minimum you'll want to use to build your presentation are the `Deck` element and a `Slide` element. Each `Slide` represents a slide within your presentation `Deck` (the entire slideshow).
+
+To see a complete example of a presentation written in JSX, please check out our [sample JSX presentation](https://github.com/FormidableLabs/spectacle/blob/main/examples/js/index.js).
+
+You can also bootstrap a fresh JSX project with `spectacle-boilerplate`:
+
+```bash
+$ spectacle-boilerplate
+```
+
+### One HTML Page
+
+To create a Spectacle presentation that lives in a single HTML page, you will only need to add a few scripts to your setup:
+
+```html
+
+
+
+
+
+```
+
+... and then wrap your HTML in a declarative `module` script, like so:
+
+```html
+
+```
+
+To see a complete example of a presentation written as a single HTML page, please check out our [sample one page presentation](https://github.com/FormidableLabs/spectacle/blob/main/examples/one-page/index.html).
+
+## Presenting
+
+Spectacle comes with a built-in presenter mode. It shows you a slide lookahead, your current slide, current time (or time elapsed), and any notes you've appended to your slide:
+
+
+
+To present:
+
+1. Run `yarn start`, which will open up a presentation at [localhost:3000/](http://localhost:3000/) by default.
+2. Open a second browser window on a different screen.
+3. Append [`?presenterMode=true`](http://localhost:3000/?presenterMode=true) immediately after the `/`
+4. Give an amazingly in-sync and stylish presentation.
+
+**Note:** Any windows/tabs in the same browser running Spectacle will sync to one another, even if you aren't in presentation mode.
+
+
diff --git a/docs/props.md b/docs/props.md
index 3b9fdf5b9..ae51eede6 100644
--- a/docs/props.md
+++ b/docs/props.md
@@ -1,20 +1,188 @@
-
+---
+title: Base Props
+order: 3
+sidebar_position: 3
+---
# Base Props
-Every component in the Tag API that has `(Base)` after it has been extended from a common class that includes the following props:
-
-| Name | PropType | Description |
-| --------- | -------------------------- | --------------------------------------------------------------------------- |
-| italic | PropTypes.boolean | Set `fontStyle` to `italic` |
-| bold | PropTypes.boolean | Set `fontWeight` to `bold` |
-| caps | PropTypes.boolean | Set `textTransform` to `uppercase` |
-| margin | PropTypes.number or string | Set `margin` value |
-| padding | PropTypes.number or string | Set `padding` value |
-| textColor | PropTypes.string | Set `color` value |
-| textSize | PropTypes.string | Set `fontSize` value |
-| textAlign | PropTypes.string | Set `textAlign` value |
-| textFont | PropTypes.string | Set `textFont` value |
-| bgColor | PropTypes.string | Set `backgroundColor` value |
-| bgImage | PropTypes.string | Set `backgroundImage` value |
-| bgDarken | PropTypes.number | Float value from 0.0 to 1.0 specifying how much to darken the bgImage image |
+The following are a handful of standard base props many components consume. For a complete list of available components and the props they consume, please see our complete [API Reference](./api-reference.md).
+
+## Transition Object
+
+A transition object defines the animatable CSS properties for three states: `from`, `enter`, and `leave`. From is the starting transition. Enter are the styles applied when the slide is in view. Leave are the styles when the slide goes out of view.
+
+An example transition object looks like:
+
+```javascript
+const transition = {
+ from: {
+ opacity: 0,
+ transform: 'rotate(45deg)'
+ },
+ enter: {
+ opacity: 1,
+ transform: 'rotate(0)'
+ },
+ leave: {
+ opacity: 0,
+ transform: 'rotate(315deg)'
+ }
+};
+```
+
+## Background
+
+**Background** props used by [`Slide`](./api-reference.md#slide).
+
+| Name | PropType | Description | Example |
+| -------------------- | ---------------- | ---------------------------- | ------------------------------ |
+| `backgroundImage` | PropTypes.string | Set CSS `backgroundImage` | `url('...')` or `require(...)` |
+| `backgroundSize` | PropTypes.string | Set CSS `backgroundSize` | `cover` |
+| `backgroundPosition` | PropTypes.string | Set CSS `backgroundPosition` | `center` |
+| `backgroundRepeat` | PropTypes.string | Set CSS `backgroundRepeat` | `no-repeat` |
+
+## Color
+
+**Color** props are used by [`CodeSpan`](./api-reference.md#code-span), [`Text`](./api-reference.md#text), [`Link`](./api-reference.md#link), [`Heading`](./api-reference.md#heading), [`Quote`](./api-reference.md#quote), [`Table`](./api-reference.md#table), [`TableHeader`](./api-reference.md#table-header), [`TableBody`](./api-reference.md#table-body), [`TableRow`](./api-reference.md#table-row), [`TableCell`](./api-reference.md#table-cell), [`UnorderedList`](./api-reference.md#unordered-list), [`OrderedList`](./api-reference.md#ordered-list), and [`ListItem`](./api-reference.md#list-item).
+
+| Name | PropType | Description | Example |
+| ------------------------- | ---------------- | ------------------------------------------------------- | ------------------------ |
+| `color` | PropTypes.string | Set CSS `color` value or `color` theme value | `#abc123` or `primary` |
+| `bg` or `backgroundColor` | PropTypes.string | Set CSS `background-color` value or `color` theme value | `#abc123` or `secondary` |
+
+## Space
+
+**Space** props used by [`Box`](./api-reference.md#box), [`FlexBox`](./api-reference.md#flex-box), [`Grid`](./api-reference.md#grid), [`CodeSpan`](./api-reference.md#code-span), [`Text`](./api-reference.md#text), [`Link`](./api-reference.md#link), [`Heading`](./api-reference.md#heading), [`Quote`](./api-reference.md#quote), [`Table`](./api-reference.md#table), [`TableHeader`](./api-reference.md#table-header), [`TableBody`](./api-reference.md#table-body), [`TableRow`](./api-reference.md#table-row), [`TableCell`](./api-reference.md#table-cell), [`UnorderedList`](./api-reference.md#unordered-list), [`OrderedList`](./api-reference.md#ordered-list), and [`ListItem`](./api-reference.md#list-item).
+
+| Name | PropType | Description | Example |
+| ----------------------- | ---------------- | ----------------------------------------------------------------------- | ----------------------------------- |
+| `m` or `margin` | PropTypes.string | Set CSS `margin` value or `space` theme value | `24px`, `6px 3px 2px`, or `primary` |
+| `mt` or `marginTop` | PropTypes.string | Set CSS `margin-top` value or `space` theme value | `1em` or `tertiary` |
+| `mr` or `marginRight` | PropTypes.string | Set CSS `margin-right` value or `space` theme value | `0.5em` or `secondary` |
+| `mb` or `marginBottom` | PropTypes.string | Set CSS `margin-bottom` value or `space` theme value | `2px` or `primary` |
+| `ml` or `marginLeft` | PropTypes.string | Set CSS `margin-left` value or `space` theme value | `3%` or `secondary` |
+| `mx` or `marginX` | PropTypes.string | Set CSS `margin-left` and `margin-right` value or `space` theme value | `1em` or `secondary` |
+| `my` or `marginY` | PropTypes.string | Set CSS `margin-top` and `margin-bottom` value or `space` theme value | `5px` or `tertiary` |
+| `p` or `padding` | PropTypes.string | Set CSS `padding` value or `space` theme value | `24px`, `6px 3px 2px`, or `primary` |
+| `pt` or `paddingTop` | PropTypes.string | Set CSS `padding-top` value or `space` theme value | `1em` or `tertiary` |
+| `pr` or `paddingRight` | PropTypes.string | Set CSS `padding-right` value or `space` theme value | `0.5em` or `secondary` |
+| `pb` or `paddingBottom` | PropTypes.string | Set CSS `padding-bottom` value or `space` theme value | `2px` or `primary` |
+| `pl` or `paddingLeft` | PropTypes.string | Set CSS `padding-left` value or `space` theme value | `3%` or `secondary` |
+| `px` or `paddingX` | PropTypes.string | Set CSS `padding-left` and `padding-right` value or `space` theme value | `1em` or `secondary` |
+| `py` or `paddingY` | PropTypes.string | Set CSS `padding-top` and `padding-bottom` value or `space` theme value | `5px` or `tertiary` |
+
+## Typography
+
+**Typography** props are used by [`CodeSpan`](./api-reference.md#code-span), [`Text`](./api-reference.md#text), [`Link`](./api-reference.md#link), [`Heading`](./api-reference.md#heading), [`Quote`](./api-reference.md#quote), [`Table`](./api-reference.md#table), [`TableHeader`](./api-reference.md#table-header), [`TableBody`](./api-reference.md#table-body), [`TableRow`](./api-reference.md#table-row), [`TableCell`](./api-reference.md#table-cell), [`UnorderedList`](./api-reference.md#unordered-list), [`OrderedList`](./api-reference.md#ordered-list), and [`ListItem`](./api-reference.md#list-item).
+
+| Name | PropType | Description | Example |
+| --------------- | ---------------- | -------------------------------------------------------------- | ------------------------------------------------------ |
+| `fontFamily` | PropTypes.string | Set CSS `font-family` value or `fonts` theme value | `Helvetica` or `primary` |
+| `fontSize` | PropTypes.string | Set CSS `font-size` value or `fontSizes` theme value | `16px` or `bodyCopy` |
+| `fontWeight` | PropTypes.string | Set CSS `font-weight` value or `fontWeights` theme value | `400`, `bold`, or [`Heading`](./api-reference.md#heading) |
+| `lineHeight` | PropTypes.string | Set CSS `line-height` value or `fontWeights` theme value | `1.5em` or `paragraph` |
+| `letterSpacing` | PropTypes.string | Set CSS `letter-spacing` value or `letterSpacings` theme value | `1px` or `spreadOutText` |
+| `textAlign` | PropTypes.string | Set CSS `text-align` value | `left` |
+| `fontStyle` | PropTypes.string | Set CSS `font-style` value | `normal` or `italic` |
+
+## Layout
+
+**Layout** props are used by [`Box`](./api-reference.md#box), [`FlexBox`](./api-reference.md#flex-box), [`Grid`](./api-reference.md#grid), [`Table`](./api-reference.md#table), [`TableHeader`](./api-reference.md#table-header), [`TableBody`](./api-reference.md#table-body), [`TableRow`](./api-reference.md#table-row), [`TableCell`](./api-reference.md#table-cell), [`CodePane`](./api-reference.md#code-pane), and [`Markdown`](./api-reference.md#markdown-components).
+
+| Name | PropType | Description | Example |
+| ----------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
+| `width` | PropTypes.string or PropTypes.number | Set CSS `width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `height` | PropTypes.string or PropTypes.number | Set CSS `height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `minWidth` | PropTypes.string or PropTypes.number | Set CSS `min-width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `maxWidth` | PropTypes.string or PropTypes.number | Set CSS `max-width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `minHeight` | PropTypes.string or PropTypes.number | Set CSS `min-height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `maxHeight` | PropTypes.string or PropTypes.number | Set CSS `max-height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `size` | PropTypes.string or PropTypes.number | Set CSS `width` and `height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
+| `display` | PropTypes.string | Set CSS `display` value | `inline-block` |
+| `overflow` | PropTypes.string | Set CSS `overflow` value | `visible` |
+| `overflowX` | PropTypes.string | Set CSS `overflow-x` value | `hidden` |
+| `overflowY` | PropTypes.string | Set CSS `overflow-y` value | `visible` |
+
+## Flex
+
+**Flex** props are used by [`FlexBox`](./api-reference.md#flex-box).
+
+| Name | PropType | Description | Example |
+| ---------------- | ------------------------------------ | ------------------------------- | --------------- |
+| `alignItems` | PropTypes.string | Set CSS `align-items` value | `flex-start` |
+| `alignContent` | PropTypes.string | Set CSS `align-content` value | `center` |
+| `justifyContent` | PropTypes.string | Set CSS `justify-content` value | `space-between` |
+| `flexWrap` | PropTypes.string | Set CSS `flex-wrap` value | `wrap` |
+| `flexBasis` | PropTypes.string or PropTypes.number | Set CSS `flex-basis` value | `auto` or `1` |
+| `flexDirection` | PropTypes.string | Set CSS `flex-direction` value | `column` |
+| `flex` | PropTypes.string | Set CSS `flex` value | `1 1 auto` |
+| `justifySelf` | PropTypes.string | Set CSS `justify-self` value | `stretch` |
+| `alignSelf` | PropTypes.string | Set CSS `align-self` value | `center` |
+| `order` | PropTypes.number | Set CSS `order` value | `1` |
+
+## Grid
+
+**Grid** props are used by [`Grid`](./api-reference.md#grid).
+
+| Name | PropType | Description | Example |
+| --------------------- | ------------------------------------ | ------------------------------------- | --------------------------------------------- |
+| `gridGap` | PropTypes.number | Set CSS `grid-gap` value | `15` |
+| `gridColumnGap` | PropTypes.number | Set CSS `grid-column-gap` value | `3` |
+| `gridRowGap` | PropTypes.number | Set CSS `grid-row-gap` value | `6` |
+| `gridColumn` | PropTypes.number or PropTypes.string | Set CSS `grid-column` value | `auto`, `1 / 2`, or `3` |
+| `gridRow` | PropTypes.number or PropTypes.string | Set CSS `grid-row` value | `auto`, `1 / 2`, or `3` |
+| `gridAutoFlow` | PropTypes.string | Set CSS `grid-auto-flow` value | `row` or `column-dense` |
+| `gridAutoColumns` | PropTypes.string | Set CSS `grid-auto-columns` value | `min-content`, `1fr`, or `minmax(10px, auto)` |
+| `gridAutoRows` | PropTypes.string | Set CSS `grid-auto-rows` value | `min-content`, `1fr`, or `minmax(10px, auto)` |
+| `gridTemplateColumns` | PropTypes.string | Set CSS `grid-template-columns` value | `60px 60px` or `1fr 2fr` |
+| `gridTemplateRows` | PropTypes.string | Set CSS `grid-template-rows` value | `40px 1fr` or `8ch auto` |
+| `gridTemplateAreas` | PropTypes.string | Set CSS `grid-template-area` value | `a b` or `inherit` |
+| `gridArea` | PropTypes.string | Set CSS `grid-area` value | `a` or `2 / 1 / 4` |
+
+## Position
+
+**Position** props are used by [`Box`](./api-reference.md#box), [`FlexBox`](./api-reference.md#flex-box), [`Grid`](./api-reference.md#grid), [`CodePane`](./api-reference.md#code-pane), [`FullScreen`](./api-reference.md#fullscreen), [`Progress`](./api-reference.md#progress), [`AnimatedProgress`](./api-reference.md#animatedprogress), and [`Markdown`](./api-reference.md#markdown-components).
+
+| Name | PropType | Description | Example |
+| ---------- | ---------------- | ------------------------ | ---------- |
+| `position` | PropTypes.string | Set CSS `position` value | `relative` |
+| `zIndex` | PropTypes.number | Set CSS `z-index` value | `2` |
+| `top` | PropTypes.number | Set CSS `top` value | `1` |
+| `right` | PropTypes.number | Set CSS `right` value | `3` |
+| `bottom` | PropTypes.number | Set CSS `bottom` value | `10` |
+| `left` | PropTypes.number | Set CSS `left` value | `5` |
+
+## Border
+
+**Border** props are used by [`Box`](./api-reference.md#box), [`FlexBox`](./api-reference.md#flex-box), [`Grid`](./api-reference.md#grid), [`Table`](./api-reference.md#table), [`TableHeader`](./api-reference.md#table-header), [`TableBody`](./api-reference.md#table-body), [`TableRow`](./api-reference.md#table-row), and [`TableCell`](./api-reference.md#table-cell).
+
+| Name | PropType | Description | Example |
+| ------------------------- | ------------------------------------ | ---------------------------------------------- | -------------------- |
+| `border` | PropTypes.string | Set CSS `position` value | `2px solid white` |
+| `borderWidth` | PropTypes.number or PropTypes.string | Set CSS `border-width` value | `5px` |
+| `borderStyle` | PropTypes.string | Set CSS `border-style` value | `solid` |
+| `borderColor` | PropTypes.string | Set CSS `border-color` value | `rgb(255, 200, 150)` |
+| `borderRadius` | PropTypes.number or PropTypes.string | Set CSS `border-radius` value | `10` |
+| `borderTop` | PropTypes.string | Set CSS `border-top` value | `3px dashed #000` |
+| `borderTopWidth` | PropTypes.number or PropTypes.string | Set CSS `border-top-width` value | `1` |
+| `borderTopStyle` | PropTypes.string | Set CSS `border-top-style` value | `solid` |
+| `borderTopColor` | PropTypes.string | Set CSS `border-top-color` value | `#ff0abc` |
+| `borderTopLeftRadius` | PropTypes.number or PropTypes.string | Set CSS `border-top-left-radius` value | `20%` |
+| `borderTopRightRadius` | PropTypes.number or PropTypes.string | Set CSS `border-top-right-radius` value | `4px` |
+| `borderRight` | PropTypes.string | Set CSS `border-right` value | `relative` |
+| `borderRightWidth` | PropTypes.number or PropTypes.string | Set CSS `border-right-width` value | `1px` |
+| `borderRightStyle` | PropTypes.string | Set CSS `border-right-style` value | `solid` |
+| `borderRightColor` | PropTypes.string | Set CSS `border-right-color` value | `red` |
+| `borderBottom` | PropTypes.string | Set CSS `border-bottom` value | `2px solid blue` |
+| `borderBottomWidth` | PropTypes.number or PropTypes.string | Set CSS `border-bottom-width` value | `1em` |
+| `borderBottomStyle` | PropTypes.string | Set CSS `border-bottom-style` value | `dashed` |
+| `borderBottomColor` | PropTypes.string | Set CSS `border-bottom-color` value | `orange` |
+| `borderBottomLeftRadius` | PropTypes.number or PropTypes.string | Set CSS `border-bottom-left-radius` value | `2px` |
+| `borderBottomRightRadius` | PropTypes.number or PropTypes.string | Set CSS `border-bottom-right-radius` value | `4px` |
+| `borderLeft` | PropTypes.string | Set CSS `border-left` value | `1px solid green` |
+| `borderLeftWidth` | PropTypes.number or PropTypes.string | Set CSS `border-left-width` value | `2px` |
+| `borderLeftStyle` | PropTypes.string | Set CSS `border-left-style` value | `solid` |
+| `borderLeftColor` | PropTypes.string | Set CSS `border-left-color` value | `green` |
+| `borderX` | PropTypes.string | Set CSS `border-left` and `border-right` value | `2px dotted red` |
+| `borderY` | PropTypes.string | Set CSS `border-top` and `border-bottom` value | `1px solid black` |
diff --git a/docs/tag-api.md b/docs/tag-api.md
deleted file mode 100644
index feb64961f..000000000
--- a/docs/tag-api.md
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-# Tag API
-
-In Spectacle, presentations are composed of a set of base tags. We can separate these into three categories: Main tags, Layout tags & Element tags.
-
-
-
-## Main Tags
-
-
-
-### Spectacle
-
-The Spectacle tag is the root level tag for your presentation. It handles routing, flux and generally presenting your Deck & Slides. It supports the following props:
-
-| Name | PropType | Description |
-| ------- | ---------------- | ------------------------------------------------------------------------------------ |
-| history | PropTypes.object | Accepts custom configuration for [history](https://github.com/ReactTraining/history) |
-| theme | PropTypes.object | Accepts a theme object for styling your presentation |
-
-
-
-### Deck
-
-The deck tag wraps your slides. It supports the following props:
-
-| Name | PropType | Description |
-| ------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| transition | PropTypes.array | Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets global slide transitions. **Note: If you use the 'scale' transition, fitted text won't work in Safari.** |
-| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for global transition duration. |
-| progress | PropTypes.string | Accepts `pacman`, `bar`, `number` or `none`. |
-| controls | PropTypes.bool | Show control arrows when not in fullscreen |
-| globalStyles | PropTypes.bool | Add spectable styles to global scope. Default: true |
-
-
-
-### Slide (Base)
-
-The slide tag represents each slide in the presentation. Giving a slide tag an `id` attribute will replace its number based navigation hash with the `id` provided. It supports the following props, in addition to any of the props outlined in the Base class props listing:
-
-| Name | PropType | Description |
-| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| align | PropTypes.string | Accepts a space delimited value for positioning interior content. The first value can be `flex-start` (left), `center` (middle), or `flex-end` (right). The second value can be `flex-start` (top) , `center` (middle), or `flex-end` (bottom). You would provide this prop like `align="center center"`, which is its default. |
-| transition | PropTypes.array | Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets the slide transition. **Note: If you use the 'scale' transition, fitted text won't work in Safari.** |
-| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for slide transition duration. |
-| notes | PropTypes.string | Text which will appear in the presenter mode. Can be HTML. |
-| id | PropTypes.string | Used to create a string based hash. |
-
-
-
-## Layout Tags
-
-Layout tags are used for layout using Flexbox within your slide. They are `Layout`, `Fit` & `Fill`.
-
-
-
-### Layout
-
-The layout tag is used to wrap `Fit` and `Fill` tags to provide a row.
-
-
-
-### Fit
-
-The fit tag only takes up as much space as its bounds provide.
-
-
-
-### Fill
-
-The fill tag takes up all the space available to it. For example, if you have a `Fill` tag next to a `Fit` tag, the `Fill` tag will take up the rest of the space. Adjacent `Fill` tags split the difference and form an equidistant grid.
-
-
-
-## Markdown Tag
-
-
-
-### Markdown
-
-The Markdown tag is used to add inline markdown to your slide. You can provide markdown source via the `source` prop, or as children. You can also provide a custom [mdast configuration](https://github.com/wooorm/mdast) via the `mdastConfig` prop.
-
-Markdown generated tags aren't prop configurable, and instead render with your theme defaults.
-
-| Name | PropType | Description |
-| ----------- | ---------------- | -------------------------- |
-| source | PropTypes.string | Markdown source |
-| mdastConfig | PropTypes.object | Mdast configuration object |
-
-
-
-## Element Tags
-
-The element tags are the bread and butter of your slide content. Most of these tags derive their props from the Base class, but the ones that have special options will have them listed:
-
-
-
-### Appear
-
-This tag does not extend from Base. It's special. Wrapping elements in the appear tag makes them appear/disappear in order in response to navigation.
-
-| Name | PropType | Description |
-| ------------------ | ---------------- | --------------------------------------------------------------------------- |
-| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for duration of appearance animation. |
-
-
-
-### BlockQuote, Quote and Cite (Base)
-
-These tags create a styled blockquote. Use them as follows:
-
-```jsx
-
- Ken Wheeler is amazing
- Everyone
-
-```
-
-
-
-### CodePane (Base)
-
-This tag displays a styled, highlighted code preview. I prefer putting my code samples in external `.example` files and requiring them using `raw-loader` as shown in the demo. Here are the props:
-
-| Name | PropType | Description |
-| ------ | ---------------- | ------------------------------------------------- |
-| lang | PropTypes.string | Prism compatible language name. i.e: 'javascript' |
-| source | PropTypes.string | String of code to be shown |
-
-Prism.js supports `Markup`, `CSS`, `C-like`and `Javascript` languages out of the box. To add more [supported languages](http://prismjs.com/#languages-list), you have to import the respective language's prism.js component/plugin from `prismjs/components/prism-LANG`, where `LANG` is the language/component you'd like to add.
-
-
-
-### Code (Base)
-
-A simple tag for wrapping inline text that you want lightly styled in a monospace font.
-
-
-
-### Heading (Base)
-
-Heading tags are special in that, when you specify a `size` prop, they generate the appropriate heading tag, and extend themselves with a style that is defined in the theme file for that heading. Line height can be adjusted via a numeric `lineHeight` prop.
-
-| Name | PropType | Description |
-| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
-| fit | PropTypes.boolean | When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** |
-| lineHeight | PropTypes.number | Sets the line height of your text. |
-
-
-
-### Image (Base)
-
-| Name | PropType | Description |
-| ------- | ------------------------------------ | ------------------------------------------- |
-| display | PropTypes.string | Set the display style property of the image |
-| height | PropTypes.string or PropTypes.number | Supply a height to the image |
-| src | PropTypes.string | Image src |
-| width | PropTypes.string or PropTypes.number | Supply a width to the image |
-
-
-
-### Link (Base)
-
-The link tag is used to render `` tags. It accepts an `href` prop:
-
-| Name | PropType | Description |
-| ------ | ---------------- | ---------------------------------- |
-| href | PropTypes.string | String of url for `href` attribute |
-| target | PropTypes.string | Set the `target` attribute |
-
-
-
-### List & ListItem (Base)
-
-These tags create lists. Use them as follows:
-
-```jsx
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-```
-
-
-
-### S (Base)
-
-The `S` tag is used to add inline styling to a piece of text, such as underline or strikethrough.
-
-| Name | PropType | Description |
-| ---- | ---------------- | -------------------------------------------------------- |
-| type | PropTypes.string | Accepts `strikethrough`, `underline`, `bold` or `italic` |
-
-
-
-### Table, TableRow, TableHeaderItem and TableItem (Base)
-
-The `Table` tag is used to add table to your slide. It is used with `TableRow`, `TableHeaderItem` and `TableItem`. Use them as follows:
-
-```jsx
-
-```
-
-
-
-### Text (Base)
-
-The `Text` tag is used to add text to your slide. Line height can be adjusted via a numeric `lineHeight` prop.
-
-| Name | PropType | Description |
-| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
-| fit | PropTypes.boolean | When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** |
-| lineHeight | PropTypes.number | Sets the line height of your text. |
diff --git a/docs/themes.md b/docs/themes.md
new file mode 100644
index 000000000..97d4ce337
--- /dev/null
+++ b/docs/themes.md
@@ -0,0 +1,116 @@
+---
+title: Themes
+order: 4
+sidebar_position: 4
+---
+
+# Theme System
+
+Spectacle has a robust theme system that is built upon [styled system](https://styled-system.com/theme-specification).
+
+A theme is a 2-level deep object of labeled theme keys and CSS property object values, which is passed directly to the `Deck` component.
+
+## Theme Object
+
+The following is an example of a simple custom theme object:
+
+```js
+const theme = {
+ colors: {
+ primary: '#f00',
+ secondary: '#00f'
+ },
+ fontSizes: {
+ header: '64px',
+ paragraph: '28px'
+ }
+};
+```
+
+## Usage
+
+Components in Spectacle can accept either a value label such as `primary` or a raw CSS value like `#f00`.
+The label `primary` returns `#f00` since the `backgroundColor` prop (CSS property `background-color`) is mapped to the `colors` theme key.
+
+```jsx
+
+
+```
+
+## Theme Keys
+
+Common CSS properties are divided into theme keys, which you can override in your custom theme object:
+
+| Theme Key | CSS Properties |
+| ---------------- | ----------------------------------------------------------------------- |
+| `space` | `margin`, `padding`, `grid-gap` |
+| `colors` | `color`, `background-color`, `border-color` |
+| `sizes` | `width`, `height`, `min-width`, `max-width`, `min-height`, `max-height` |
+| `fontSizes` | `font-size` |
+| `borders` | `border`, `border-top`, `border-right`, `border-bottom`, `border-left` |
+| `borderWidths` | `border-width` |
+| `borderStyles` | `border-style` |
+| `radii` | `border-radius` |
+| `fonts` | `font-family` |
+| `fontWeights` | `font-weight` |
+| `lineHeights` | `line-height` |
+| `letterSpacings` | `letter-spacing` |
+| `shadows` | `box-shadow`, `text-shadow` |
+| `zIndices` | `z-index` |
+
+## Deck Templates
+
+A template in Spectacle is a fixed overlay of components that are presented on every slide. They are similar to masters in Keynote or PowerPoint. It’s a function prop that has a single optional config object containing the current slide and total slide count and returns a React Node.
+
+```jsx
+ (
+
+
+
+
+
+
+ Slide {slideNumber} of {numberOfSlides}
+
+
+))>
+```
+
+## Scaled Spacing
+
+The `space` key is used as a scale for margins, paddings, and gaps for grids. It is an array of integer values. This allows for a more consistent scale of sizes throughout your presentation. The default theme uses three values on the scale, `16`, `24`, and `32`.
+
+Given the following theme:
+
+```jsx
+let theme = {
+ space: [16, 24, 32]
+};
+```
+
+One can use a scale value by passing the index of the value as a numeric prop to any space theme property (such as `padding` or `margin`), like so:
+
+```jsx
+Hello World
+```
+
+### Default Margin Assignments
+
+Spectacle components use different values on the space scale as defaults for margins. The values can be overridden in your theme by providing alternative values as part of a space array that is at least 3 values deep. If no value is provided, Spectacle will default to `0`. Individual margin values can be also provided as `margin` props to the component.
+
+| Component | Default Space Index | Default Theme Value |
+| --------------- | ------------------- | ------------------- |
+| `Slide` | `2` | `32px` |
+| `Heading` | `1` | `24px` |
+| `Text` | `0` | `16px` |
+| `OrderedList` | `0` | `16px` |
+| `UnorderedList` | `0` | `16px` |
+| `ListItem` | `0` | `16px` |
+| `Link` | `0` | `16px` |
+| `Quote` | `0` | `16px` |
+| `CodeSpan` | `0` | `16px` |
diff --git a/docs/tutorial.md b/docs/tutorial.md
index 95e2a0c16..aea92c1ae 100644
--- a/docs/tutorial.md
+++ b/docs/tutorial.md
@@ -1,554 +1,127 @@
+---
+title: Getting Started
+order: 6
+sidebar_position: 6
+---
+
# Getting Started with Spectacle: A Tutorial
-In this guide, we'll show you how to get started with Spectacle and walk you through the creation and customization of a presentation deck. We've created a Github repository with the [completed project](https://github.com/FormidableLabs/spectacle-boilerplate), and will link the corresponding commit where appropriate to help you follow along. If you want, you can [view the completed tutorial here](https://github.com/FormidableLabs/spectacle-boilerplate/blob/master/presentation/index.js).
-
-## 1. Set up a basic React project
-
-You can do this on your own if you'd like, or you can...
-
-- Clone down [this project](https://github.com/FormidableLabs/spectacle-boilerplate) we've started for you using `git clone git@github.com:FormidableLabs/spectacle-boilerplate.git`
-- `cd spectacle-boilerplate`
-- Remove existing version control by running `rm -rf .git`
-- Replace the existing code in the `presentation/index.js` file with:
-
- ```js
- import React from 'react';
-
- export default class Presentation extends React.Component {
- render() {
- return (
-
-
Spectacle Tutorial
-
- );
- }
- }
- ```
-
-- Run `yarn install` to install all necessary dependencies
-
-Once you've completed these steps, you can run the webpack sever with the command `yarn start`, and the project will render at [localhost:3000](http://localhost:3000). All modifications will take place in this `index.js` file.
-
-## 2. Add Spectacle
-
-If you chose to use the [spectacle-boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate) to get started, Spectacle is already in your dependencies and there is no reason to add the library a second time - you can go ahead and skip to the next paragraph. If you chose _not_ to use the boilerplate to get setup, you will need to run `yarn add spectacle`.
-
-Almost all Spectacle presentations are comprised of a couple of basic components: One `Deck` and typically multiple `Slide`s. For now, let's import these two basic components to get our deck started.
-
-The imports at the top of your main JavaScript file should look like this:
-
-```js
-import React from 'react';
-import { Deck, Slide } from 'spectacle';
-```
-
-To create our deck, we'll wrap some Slide components into a Deck in our Presentation class:
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
- Spectacle Boilerplate
- Typography
- Standard List
- Example Quote
-
- );
- }
-}
-```
-
-## 3. Add some slide content
-
-To break up our content, we can use the `Heading` and `Text` tags to display varying sizes of text. Every time we want to use a new component from the Spectacle API, we will have to add it to our imports at the top:
-
-```js
-import React from 'react';
-import { Deck, Heading, Slide, Text } from 'spectacle';
-```
-
-Now we can add these components to our slides:
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
- Spectacle Boilerplate
- open the presentation/index.js file to get started
-
-
- Typography
- Heading 1
- Heading 2
- Heading 3
- Heading 4
- Heading 5
- Standard text
-
-
- Standard List
-
-
- Example Quote
-
-
- );
- }
-}
-```
-
-We can bring in additional core tags like `BlockQuote`, `Quote`, and `Cite` to display large quotes with a credited author. Other tags like `List` and `ListItem` will display bulleted lists on your slides:
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
- Spectacle Boilerplate
- open the presentation/index.js file to get started
-
-
- Typography
- Heading 1
- Heading 2
- Heading 3
- Heading 4
- Heading 5
- Standard text
-
-
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-
-
-
- Example Quote
- Author
-
-
-
- );
- }
-}
-```
-
-## 4. Add images
-
-If you used the starter, there are already a few images in the `assets` directory for you to use. If not, create an `assets` directory in the root of your project and save a few images of your own to it.
-
-Then, near the top of your file, import your image(s):
-
-```js
-const images = {
- formidagon: require('../assets/formidable-logo.svg'),
- goodWork: require('../assets/good-work.gif')
-};
-```
-
-Once you've brought in your images, you can supply them to the `src` prop on the `Image` tag to display within your slides (but don't forget to import the tag!). Now, your `index.js` should look like this:
-
-```js
-import React from 'react';
-import {
- BlockQuote,
- Cite,
- Deck,
- Heading,
- Image,
- List,
- ListItem,
- Quote,
- Slide,
- Text
-} from 'spectacle';
-
-const images = {
- formidagon: require('../assets/formidable-logo.svg'),
- goodWork: require('../assets/good-work.gif')
-};
-
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
- Spectacle Boilerplate
- open the presentation/index.js file to get started
-
-
-
-
-
- Typography
- Heading 1
- Heading 2
- Heading 3
- Heading 4
- Heading 5
- Standard text
-
-
- Standard List
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-
-
-
- Example Quote
- Author
-
-
-
-
-
-
- );
- }
-}
-```
-
-## 5. Style your slides
-
-Because the `Text`, `Image`, and `Heading` accept a number of [props](https://github.com/FormidableLabs/spectacle#tag-api) (like `bold`, `caps`, `fit`, `lineHeight`, and `size`), we can use these props to minimally style our content.
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
-
- Spectacle Boilerplate
-
-
- open the presentation/index.js file to get started
-
-
-
-
-
-
-
- Typography
-
- Heading 1
- Heading 2
- Heading 3
- Heading 4
- Heading 5
- Standard text
-
-
-
- Standard List
-
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-
-
-
- Example Quote
- Author
-
-
-
-
-
-
- );
- }
-}
-```
-
-## 6. Create a theme
-
-To style our slides a little further, we can create a theme to enforce fonts and colors on all of our slides. We'll want to import the `createTheme` function from Spectacle, but we use a direct path (`'spectacle/lib/themes/default'`) instead of grouping it in with the default component exports. Your imports should now look like so:
-
-```js
-import React from 'react';
-import { Deck, Heading, Slide, Text } from 'spectacle';
-import createTheme from 'spectacle/lib/themes/default';
-```
-
-And then, using `createTheme`, we can declare values for our theme:
-
-```js
-const theme = createTheme(
- {
- primary: 'white',
- secondary: '#1F2022',
- tertiary: '#03A9FC',
- quaternary: '#CECECE'
- },
- {
- primary: 'Montserrat',
- secondary: 'Helvetica'
- }
-);
-```
-
-Then, we can supply these values to our slides:
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
-
- Spectacle Boilerplate
-
-
- open the presentation/index.js file to get started
-
-
-
-
-
-
-
- Typography
-
-
- Heading 1
-
-
- Heading 2
-
-
- Heading 3
-
-
- Heading 4
-
-
- Heading 5
-
-
- Standard text
-
-
-
-
- Standard List
-
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-
-
-
- Example Quote
- Author
-
-
-
-
-
-
- );
- }
-}
-```
-
-## 6. Add animations
-
-Using the core Spectacle API, we can supply transition props like `transition` and `transitionDuration` to our `Deck` and `Slide` components to make the presentation more animated, without adding any new imports:
-
-```js
-export default class Presentation extends React.Component {
- render() {
- return (
-
-
-
- Spectacle Boilerplate
-
-
- open the presentation/index.js file to get started
-
-
-
-
-
-
-
- Typography
-
-
- Heading 1
-
-
- Heading 2
-
-
- Heading 3
-
-
- Heading 4
-
-
- Heading 5
-
-
- Standard text
-
-
-
-
- Standard List
-
-
- Item 1
- Item 2
- Item 3
- Item 4
-
-
-
-
- Example Quote
- Author
-
-
-
-
-
-
- );
- }
-}
-```
-
-Additionally, you could bring in other core components, like `Anim` and `Appear` to animate your slides. `Appear` will delay the rendering of your text or image for one click, so you can have more control over the timing of your content. Just wrap any fragment you would like to delay with the tag to apply the animation. For example:
-
-```js
-
- Animated List
-
-
- Item 1
-
-
- Item 2
-
-
- Item 3
-
-
- Item 4
-
-
-
-```
-
-`Anim` allows you extra flexibility with your animations. You can write your own multi-step animations for individual fragments. You can provide it a `transitionDuration`, a `toStyle` and/or `fromStyle` object, an `easing` property that renders a [Victory Animation easing curve](https://formidable.com/open-source/victory/docs/victory-animation/#easing), or a custom `onAnim` function. For example:
-
-```js
-
- {
- console.log('forwards ', forwards);
- console.log('animIndex ', animIndex);
- }}
- >
-
-
- Flexible
-
- animations
-
-
-
-
-```
-
-## 7. Add code examples
-
-Finally, you have a couple of options for displaying code content. `CodePane` and `ComponentPlayground` both offer ways to display code, but they differ in a fundamental way: `CodePane` is a styled, highlighted code preview, while `ComponentPlayground` is a two-paned view with source on the right and a preview pane on the left for showing off custom React components.
-
-When displaying code using either component, the process is similar to display an image. You'll want to start by importing your code examples as assets:
-
-```js
-const code = {
- deckSample: require('../assets/deck.example')
-};
-```
-
-To use the `CodePane` component, you'll then provide it as a `source`:
-
-```js
-
-
-
-```
-
-To use a `ComponentPlayground`, you'll want to provide the code sample to the component in a similar way, as the `code`:
-
-```js
-
-
-
-```
+In this guide, we'll show you a couple of different ways to get started with Spectacle and walk you through the creation and customization of a presentation deck.
+
+## Option One: Using a standard React-based web app
+
+1. Spin up a new React project using [`create-react-app`](https://github.com/facebook/create-react-app):
+
+ ```bash
+ npx create-react-app spectacle-tutorial
+ ```
+
+2. Install Spectacle by running `yarn add spectacle` or `npm i spectacle`.
+
+3. In `App.js`, replace the boilerplate content with this Spectacle starter:
+
+ ```jsx
+ import React from 'react';
+ import { Deck, Slide, Heading } from 'spectacle';
+
+ function App() {
+ return (
+
+
+ Welcome to Spectacle
+
+
+ );
+ }
+
+ export default App;
+ ```
+
+4. And you're good to go! Using `create-react-app`'s built-in `start` script, you can start a hot-reloading server to begin building your Spectacle presentation by running `yarn run start` or `npm run start`.
+
+## Option Two: Using Markdown and the Spectacle CLI
+
+1. Create a new markdown file. You can use `.md` or `.mdx` (MDX lets you mix JSX components inside markdown).
+
+ You can use this as a starter:
+
+ ```md
+ # Welcome to Spectacle
+
+ - This is a list item
+ - This is another list item
+
+ ---
+
+ # Second Slide
+
+ Text can be **bold** or _italic_!
+
+ Notes: These are presenter notes, only visible in presenter mode to the speaker.
+ ```
+
+ **Note:** The triple dash (`---`) is used as a slide delimiter. The `Notes:` keyword is used to embed presenter notes only visible to the speaker in presenter mode.
+
+2. To view your slides, supply your markdown to the Spectacle CLI to start a local web server.
+
+ ```bash
+ $ npm install --global spectacle-cli
+ $ spectacle -s my-slides.mdx
+ ```
+
+3. And you're good to go! The web server you started supports live refreshing and will update your deck as you make changes to the markdown file.
+
+## Option Three: Using One Page
+
+One Page is a single self-contained `HTML` file that lets you build a deck using no build steps, using [htm](https://github.com/developit/htm) over JSX to reduce the dependencies and load time.
+
+As a self-contained entity, it already has references to the dependencies you need to author and launch a deck in a web browser. Since there is no tooling required, One Page is also optimal on tablets. The One Page `HTML` file can be downloaded from the `examples` directory [in this repository](https://github.com/FormidableLabs/spectacle/blob/main/examples/one-page/index.html).
## Next Steps
-For more information on [Presenting](../README.md#presenting), [Exporting](../README.md#pdf-export), [Building](../README.md#build--deployment), or [Deploying](../README.md#build--deployment) your Spectacle deck, check out the [`README`](../README.md).
+### Styling your Spectacle Deck
+
+The easiest way to apply consistent styles to your Spectacle deck is using [themes](./themes.md).
+
+1. Create a theme JS file containing a single object export. Supplied properties will be merged with the default base theme (found in Spectacle at `src/theme/default-theme.js`).
+
+ Here's a sample object:
+
+ ```js
+ export default {
+ colors: {
+ primary: 'red',
+ secondary: 'green'
+ },
+ fonts: {
+ header: '"Helvetica Neue", Helvetica, Arial, sans-serif'
+ },
+ fontSizes: {
+ h1: '72px',
+ h2: '64px'
+ }
+ };
+ ```
+
+2. Consume the theme using the approach of your choice:
+
+ a. To use a custom theme with a JSX- (Option One) or HTM- (Option Three) Deck, supply the object to the `theme` prop in the `Deck` tag. ``.
+
+ b. To use a custom theme with the Markdown CLI (Option Two), supply the file using the `-t` argument.
+
+ ```bash
+ $ npm install --global spectacle-cli
+ $ spectacle -s my-slides.mdx -t custom-theme.js
+ ```
+
+### Sharing your Spectacle Deck
+
+For more information on [presenting](./index.md#presenting), [exporting](./advanced-concepts.md#exporting), [building](./advanced-concepts.md#build--deployment), or [deploying](./advanced-concepts.md#build--deployment) your Spectacle deck, please check out [the documentation on advanced concepts](./advanced-concepts.md).
## Documentation, Contributing, and Source
-For more information about Spectacle and it's components, check out the docs - see [Spectacle](https://formidable.com/open-source/spectacle) to get started. Interested in helping out or seeing what's happening under the hood? Spectacle is maintained at [github.com/FormidableLabs/spectacle](https://github.com/FormidableLabs/spectacle), and you can [start contributing here](../CONTRIBUTING.md).
+For more information about Spectacle and its components, check out [the docs](https://formidable.com/open-source/spectacle).
+
+Interested in helping out or seeing what's happening under the hood? Spectacle is maintained [on Github](https://github.com/FormidableLabs/spectacle) and you can [start contributing here](https://github.com/FormidableLabs/spectacle/blob/main/CONTRIBUTING.md).
For any questions, feel free to [open a new question on Github](https://github.com/FormidableLabs/spectacle/issues/new?template=question.md).
diff --git a/example/assets/city.jpg b/example/assets/city.jpg
deleted file mode 100644
index 328212e1f..000000000
Binary files a/example/assets/city.jpg and /dev/null differ
diff --git a/example/assets/deck.example b/example/assets/deck.example
deleted file mode 100644
index 396ea69ce..000000000
--- a/example/assets/deck.example
+++ /dev/null
@@ -1,27 +0,0 @@
-return (
-
-
-
- React Presentations
-
-
- Written In React
-
-
-
-
- Wait What?
-
-
-
-
- Thats right
-
-
- Inline style based theme system
- Autofit Text
- PDF Export
-
-
-
-)
diff --git a/example/assets/formidable-logo.svg b/example/assets/formidable-logo.svg
deleted file mode 100644
index 71041b9e8..000000000
--- a/example/assets/formidable-logo.svg
+++ /dev/null
@@ -1,72 +0,0 @@
-
\ No newline at end of file
diff --git a/example/assets/interactive.js b/example/assets/interactive.js
deleted file mode 100644
index 8cf65f758..000000000
--- a/example/assets/interactive.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import React, { Component } from 'react';
-import Heading from '../../src/components/heading';
-
-export default class Interactive extends Component {
- constructor() {
- super();
- this.state = {
- count: 0
- };
- this.handleClick = this.handleClick.bind(this);
- }
- handleClick() {
- this.setState({
- count: this.state.count + 1
- });
- }
- render() {
- const styles = {
- padding: 20,
- background: 'black',
- minWidth: 300,
- marginTop: 20,
- textTransform: 'uppercase',
- border: 'none',
- color: 'white',
- outline: 'none',
- fontWeight: 'bold',
- fontSize: '2em'
- };
- return (
-
- {this.state.count < 5 ?
-
-
- The button has been clicked {this.state.count} times
-
-
-
-
- Much animation, very style
-
-
-
- Mix it up!
-
-
- You can even jump to different slides with a standard button or
- custom component!
-
-
- Jump to Slide 8
-
- (
-
- )}
- />
- Doesn't work in export view, though
-
-
-
-
- Can
-
-
-
-
- Count
-
-
-
-
- Steps
-
-
-
- Steps: {this.state.steps}
-
-
-
-
- Flexible Layouts
-
-
-
-
- Left
-
-
-
-
- Right
-
-
-
-
- Use layout to fill or fit{' '}
- your content
-
-
-
-
- Wonderfully formatted quotes
- Ken Wheeler
-
-
-
-
- Inline Markdown
-
-
- {`
- })
-
- You can write inline images, [Markdown Links](http://commonmark.org), paragraph text and most other markdown syntax
- * Lists too!
- * With ~~strikethrough~~ and _italic_
- * And let's not forget **bold**
- * Add some \`inline code\` to your sldes!
- `}
-
- Who doesn't love markdown?
-
- {MarkdownSlides`
-#### Create Multiple Slides in Markdown
-All the same tags and elements supported in are supported in MarkdownSlides.
----
-Slides are separated with **three dashes** and can be used _anywhere_ in the deck. The markdown can either be:
-* A Tagged Template Literal
-* Imported Markdown from another file
----
-Add some inline code to your markdown!
-
-\`\`\`js
-const myCode = (is, great) => 'for' + 'sharing';
-\`\`\`
- `}
-
-
- Smooth
-
-
- Combinable Transitions
-
- So smooth
-
-
-
-
-
- Inline style based theme system
-
-
- Autofit text
-
-
- Flexbox layout system
-
-
- PDF export
-
-
- Customized bullets
-
-
- And...
-
-
-
-
-
- Your presentations are interactive
-
-
-
-
-
-
- Pizza Toppings
-
-
-