Skip to content

Commit a9eafda

Browse files
author
dave thompson
committed
build slide decks in external repos
1 parent 269f8c1 commit a9eafda

File tree

302 files changed

+2954
-2245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+2954
-2245
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
lib/index.js
21
dist
32
node_modules
43
.DS_Store

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@ Open `http://localhost:9001` in your browser.
2525

2626
## Create your presentation
2727

28-
Fork and clone the repo, then:
28+
Clone the repo, then:
2929

3030
> npm install
31-
> cp -r ./presentations/example ./presentations/{your-presentation-directory}
31+
> cp -r presentations/example {your-presentation-directory}
3232
> npm run build-dev {your-presentation-directory}
3333

34-
Navigate to `http://localhost:9001` in your browser. Make changes to `{your-presentation-title}/slideList`, and they should be hot-loaded into your browser whenever you save.
34+
Navigate to `http://localhost:9001` in your browser. Make changes to `{your-presentation-directory}/index.js`, and they should be hot-loaded into your browser whenever you save.
3535

3636
## Create your slides
3737

3838
Slides are normal React components that can be written with JSX and ES6. You're free to include whatever markup and styles you'd like.
3939

40-
Include and order slides within `{your-presentation-title}/slideList`.
41-
4240
I recommend using [glamorous](https://github.com/paypal/glamorous) to style slides, but CSS can also be imported from within slide source code.
4341

4442
import './my-slide-styles.css';
@@ -53,22 +51,7 @@ Use the `CodeBlock` component to get js syntax highlighting and code editing.
5351
</CodeBlock>
5452
);
5553

56-
## Publishing to Github pages
57-
58-
Generate pages locally, push to master, and then [enable serving pages from master:docs/](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/#publishing-your-github-pages-site-from-a-docs-folder-on-your-master-branch).
59-
60-
```bash
61-
npm run ghpages
62-
```
63-
64-
## Package presentation as zip file
65-
66-
Create a zip file containing a presentation within the `built-presentations` directory.
67-
Extract the zip file and open `index.html` to view the presentation.
68-
69-
> npm run package {your-presentation-directory}
70-
7154
## Screen sharing and remote meetings
7255

73-
Slide transitions cause some screen sharing apps like WebEx to have significant lag.
56+
Slide transitions cause some screen sharing apps to have significant lag.
7457
Disable transitions by pressing `ctrl-t` while viewing the presentation in the browser.

bin/build

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22

3-
SLIDE_LIST="$1"
4-
if [ -z $SLIDE_LIST ]
5-
then
6-
SLIDE_LIST="component-library"
7-
fi
8-
9-
sed "s|--slide-list-dir--|../presentations/$SLIDE_LIST|g" ./lib/index.tpl.js > ./lib/index.js
10-
webpack
3+
dist="$(dirname ${1})/dist/$(basename ${1})"
4+
zipDist="${dist}/$(basename ${1}).zip"
5+
echo "building presentation ${1} -> ${dist}"
6+
rm -rf ${dist}
7+
webpack --config="webpack.config.js" --entry="${1}/index.js" --output-path="${dist}" --output-filename="index.js" && \
8+
echo "zipping presentation ${dist}/* -> ${zipDist}" && \
9+
zip -r "${zipDist}" "${dist}/"

bin/build-dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22

33
npm run build $1
4-
webpack-dev-server --contentBase "dist/" --port 9001 --host 0.0.0.0 --inline true
4+
dist="$(dirname ${1})/dist/$(basename ${1})"
5+
webpack-dev-server --debug --entry=${1}/index.js --output-path=${dist} --output-filename=index.js --contentBase="${dist}/" --port 9001 --host 0.0.0.0 --inline true

bin/ghpages

Lines changed: 0 additions & 10 deletions
This file was deleted.

bin/package

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/index.tpl.js renamed to lib/index.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@ import React from 'react';
22
import ReactDOM from 'react-dom';
33
import { Router, Route, IndexRedirect, hashHistory } from 'react-router';
44
import App from './components/App';
5-
import slideList from './--slide-list-dir--/slideList';
65

76
import './index.html';
87

9-
class AppWithSlides extends React.Component {
10-
render() {
11-
return <App {...this.props}>{slideList}</App>;
8+
export function renderSlideList(slideList) {
9+
let AppWithSlides = (props) => {
10+
return <App {...props}>{slideList}</App>;
1211
}
13-
}
1412

15-
class AppWithNoTransitionsAndSlides extends React.Component {
16-
render() {
17-
return <App disableTransitions={true} {...this.props}>{slideList}</App>;
13+
let AppWithNoTransitionsAndSlides = (props) => {
14+
return <App disableTransitions={true} {...props}>{slideList}</App>;
1815
}
19-
}
2016

21-
(() => {
2217
if (!window.React) {
2318
window.React = React; // Global React needed for React dev tools
2419
}
@@ -37,4 +32,4 @@ class AppWithNoTransitionsAndSlides extends React.Component {
3732
);
3833

3934
ReactDOM.render(routes, window.document.getElementById("app"));
40-
})();
35+
}

0 commit comments

Comments
 (0)