-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
30 lines (24 loc) · 784 Bytes
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# tasks to be run by the invoke tool
from invoke import task, run
import os.path
@task
def clean():
print("Removing output slides")
if os.path.exists('output'):
run('rm -R output')
@task('clean')
def slides():
print("Creating Slides Based on reveal.js")
if not os.path.exists('output'):
run('mkdir output')
run('rst2html5 --jquery --reveal-js --pretty-print-code --embed-content --pygments --reveal-js-opts theme=sky source/index.rst > output/index.html')
if os.path.exists('source/static'):
run('cp -R source/static output/')
@task('slides')
def serve():
print('Starting Web Server')
run('python -m SimpleHTTPServer')
@task('slides')
def publish():
print('Publishing to github pages')
run('ghp-import -p output')