diff --git a/README.markdown b/README.markdown index 09bd3eecc..3fc575064 100644 --- a/README.markdown +++ b/README.markdown @@ -1,22 +1,76 @@ -#Spectacle +# Spectacle ReactJS based Presentation Library ->Note: master is out of sync with the documentation. Until 1.0.0 is released, use version [0.1.5](https://github.com/FormidableLabs/spectacle/releases/tag/0.1.5) - -##Getting Started - -Your first order of business is to open terminal and run `npm install` +## Contents + + + +- [Getting Started](#getting-started) +- [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) +- [Tag API](#tag-api) + - [Main Tags](#main-tags) + - [Spectacle](#spectacle) + - [Deck](#deck) + - [Slide (Base)](#slide-base) + - [Layout Tags](#layout-tags) + - [Layout](#layout) + - [Fit](#fit) + - [Fill](#fill) + - [Markdown Tag](#markdown-tag) + - [Markdown](#markdown) + - [Element Tags](#element-tags) + - [Appear](#appear) + - [BlockQuote, Quote and Cite (Base)](#blockquote-quote-and-cite-base) + - [CodePane (Base)](#codepane-base) + - [Code (Base)](#code-base) + - [Heading (Base)](#heading-base) + - [Image (Base)](#image-base) + - [Link (Base)](#link-base) + - [List & ListItem (Base)](#list--listitem-base) + - [S (Base)](#s-base) + - [Text (Base)](#text-base) + - [Base Props](#base-props) + + + + + +## Getting Started + +The best way to get started is by using the [Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate). + +Alternatively, you can `npm install spectacle` and write your own build configurations. + +But really, it is SO much easier to just use the boilerplate. Trust me. + + +## Development + +After downloading the boilerplate, your first order of business is to open terminal and run `npm install` + +Next run `rm -R .git` to remove the existing version control. Then, to start up the local server, run `npm start` -Open a browser and hit `http://localhost:3000`, and we are ready to roll +Open a browser and hit [http://localhost:3000](http://localhost:3000), and we are ready to roll -## Build & Deploy + +## Build & Deployment Building the dist version of the project is as easy as running `npm run build` If you want to deploy the slideshow to surge, run `npm run deploy` + ## Presenting Spectacle comes with a built in presenter mode. It shows you a slide lookahead, current time and your current slide: @@ -39,6 +93,24 @@ 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| + + +## Fullscreen + +Fullscreen can be toggled via browser options, or by **hovering over the bottom right corner of your window until the fullscreen icon appears and clicking it**. + + ## PDF Export Exporting a totally sweet looking PDF from your totally sweet looking Spectacle presentation is absurdly easy. @@ -53,31 +125,37 @@ Exporting a totally sweet looking PDF from your totally sweet looking Spectacle If you want to print your slides, and want a printer friendly version, simply repeat the above process but instead print from [http://localhost:3000/#/?export&print](http://localhost:3000/#/?export&print) + ## Basic Concepts + ### Main file Your presentation files & assets will live in the `presentation` folder. -The main `.jsx` file you write your deck in is `/presentation/deck.jsx` +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. ```javascript -// deck.jsx +// index.js import React, { Component } from 'react'; import { Appear, BlockQuote, Cite, CodePane, Code, Deck, Fill, Fit, Heading, Image, Layout, ListItem, List, Quote, S, Slide, Text -} from '../src/spectacle'; +} from 'spectacle'; export default class extends Component { render() { return ( - - - Hello - - + + + + Hello + + + ) } } @@ -86,98 +164,61 @@ export default class extends Component { 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. +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 live in the `themes` directory. They consist of `html.js` and `index.js`. +In Spectacle, themes are functions that return style objects for `screen` & `print`. -`index.js` is what you would edit in order to create a custom theme of your own, using ReactJS style inline style objects. +You can import the default theme from: ```javascript -var colors = { // <--- Color variables used in the presentation - primary: '#f9c300', - secondary: 'black', - tertiary: 'white' -}; - -var fonts = { // <--- Font variables used in the presentation - primary: 'Open Sans Condensed', - secondary: 'Lobster Two', - tertiary: 'monospace' -} - -module.exports = { - colors: colors, - fonts: fonts, - global: { // <--- Global styles added to a