Skip to content

Commit

Permalink
Update boilerplate to match new Getting Started tutorial (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kylie Stewart authored Dec 21, 2018
1 parent 354c581 commit 6c5c79f
Show file tree
Hide file tree
Showing 15 changed files with 302 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"no-magic-numbers": 0
"react/prefer-es6-class": 0
"react/no-multi-comp": 0

"quotes": [2, "single"]
"env":
"browser": true,
"node": true
Expand Down
58 changes: 33 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,53 @@

- [Reference](#reference)
- [Getting Started](#getting-started)
- [Tutorial](#tutorial)
- [Build & Deployment](#build-deployment)

## Reference

The Spectacle core API is available at [https://github.com/FormidableLabs/spectacle/blob/master/README.md](https://github.com/FormidableLabs/spectacle/blob/master/README.md).
The Spectacle core API is available in the [Spectacle Docs](https://github.com/FormidableLabs/spectacle/blob/master/README.md).

## Getting Started

After downloading the boilerplate, your first order of business is to open a terminal and run
```bash
yarn
```
or
```bash
npm install
```
if you're about that life.
1. Download the boilerplate

Next, run
```bash
rm -R .git
```
to remove the existing version control.
```sh
git clone [email protected]:Formidable.com/spectacle-boilerplate.git
```

Then, to start up the local server, run
```bash
npm start
```
2. Remove existing version control

```sh
rm -R .git
```

3. Install dependencies

Open a browser and hit [http://localhost:3000](http://localhost:3000), and we are ready to roll.
```sh
yarn install
```

4. Start the webpack server. The server will run at [`localhost:3000`](http://localhost:3000).

```sh
yarn start
```

## Tutorial

If want you a step-by-step guide for getting started with Spectacle, a basic tutorial is available [here](https://github.com/FormidableLabs/spectacle/blob/master/docs/tutorial.md).

## Build & Deployment

Building the dist version of the project is as easy as running
```bash
npm run build

```sh
yarn build
```

If you want to deploy the slideshow to surge, run
```bash
npm run deploy
If you want to deploy the slideshow to surge, run

```sh
yarn deploy
```
Binary file removed assets/city.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion assets/deck.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ return (
<List>
<ListItem>Inline style based theme system</ListItem>
<ListItem>Autofit Text</ListItem>
<ListItem>react-router navigation</ListItem>
<ListItem>PDF Export</ListItem>
</List>
</Slide>
Expand Down
73 changes: 1 addition & 72 deletions assets/formidable-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/good-work.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 22 additions & 17 deletions assets/interactive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { Heading } from "spectacle";
import React, { Component } from 'react';
import { Heading } from 'spectacle';

export default class Interactive extends Component {
constructor() {
Expand All @@ -17,27 +17,32 @@ export default class Interactive extends Component {
render() {
const styles = {
padding: 20,
background: "black",
background: 'black',
minWidth: 300,
marginTop: 20,
textTransform: "uppercase",
border: "none",
color: "white",
outline: "none",
fontWeight: "bold",
fontSize: "2em"
textTransform: 'uppercase',
border: 'none',
color: 'white',
outline: 'none',
fontWeight: 'bold',
fontSize: '2em'
};
return (
<div>
{this.state.count < 5 ?
<div>
<Heading fit size={5} textColor="black">
The button has been clicked {this.state.count} times
{this.state.count < 5 ? (
<div>
<Heading fit size={5} textColor="black">
The button has been clicked {this.state.count} times
</Heading>
<button style={styles} type="button" onClick={this.handleClick}>
Click Me
</button>
</div>
) : (
<Heading size={5} fit caps textColor="black">
Easy there pal
</Heading>
<button style={styles} type="button" onClick={this.handleClick}>Click Me</button>
</div> :
<Heading size={5} fit caps textColor="black">Easy there pal</Heading>
}
)}
</div>
);
}
Expand Down
Binary file removed assets/kat.png
Binary file not shown.
Binary file removed assets/markdown.png
Binary file not shown.
26 changes: 16 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no" />
<title>Spectacle Boilerplate</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
</head>
<body>
<div id="root"></div>
<script src="./dist/bundle.js"></script>
</body>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width initial-scale=1 user-scalable=no"
/>
<title>Spectacle Boilerplate</title>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:400,700"
rel="stylesheet"
/>
</head>
<body>
<div id="root"></div>
<script src="./dist/bundle.js"></script>
</body>
</html>
23 changes: 12 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import PropTypes from "prop-types";
import ReactDOM from "react-dom";
import { AppContainer } from "react-hot-loader";
import Redbox from "redbox-react";
import React from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import Redbox from 'redbox-react';
import { AppContainer } from 'react-hot-loader';

import Presentation from "./presentation";
import Presentation from './presentation';

const CustomErrorReporter = ({ error }) => <Redbox error={ error } />;
const CustomErrorReporter = ({ error }) => <Redbox error={error} />;

CustomErrorReporter.propTypes = {
error: PropTypes.instanceOf(Error).isRequired
Expand All @@ -16,16 +16,17 @@ ReactDOM.render(
<AppContainer errorReporter={CustomErrorReporter}>
<Presentation />
</AppContainer>,
document.getElementById("root"),
document.getElementById('root')
);

if (module.hot) {
module.hot.accept("./presentation", () => {
const NextPresentation = require("./presentation").default; ReactDOM.render(
module.hot.accept('./presentation', () => {
const NextPresentation = require('./presentation').default;
ReactDOM.render(
<AppContainer errorReporter={CustomErrorReporter}>
<NextPresentation />
</AppContainer>,
document.getElementById("root"),
document.getElementById('root')
);
});
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "ReactJS Powered Presentation Framework",
"main": "lib/index.js",
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean & cross-env NODE_ENV=production webpack --config webpack.config.production.js",
"lint": "eslint --ext .js,.jsx .",
"clean": "rimraf dist",
"deploy": "npm run build && surge -p .",
"export": "spectacle-renderer --delay 3000",
"lint": "eslint --ext .js,.jsx .",
"start": "cross-env NODE_ENV=development node server.js"
},
"author": "",
"author": "Formidable Labs <[email protected]> (https://formidable.com)",
"license": "MIT",
"dependencies": {
"@babel/polyfill": "^7.0.0",
Expand All @@ -35,6 +35,7 @@
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@webpack-cli/migrate": "^0.1.2",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.18",
"cross-env": "^5.2.0",
Expand All @@ -43,6 +44,7 @@
"eslint-config-formidable": "^4.0.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"express": "^4.16.3",
"file-loader": "^2.0.0",
Expand Down
Loading

0 comments on commit 6c5c79f

Please sign in to comment.