Skip to content

Commit

Permalink
Merge pull request #5 from apiad/develop
Browse files Browse the repository at this point in the history
v0.1.5
  • Loading branch information
apiad authored Dec 9, 2019
2 parents fee38b0 + 0574900 commit 147ae37
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ Staying away from `eval` and `exec` should keep you safe in most scenarios, but

## History

### v0.1.4 (latest release and branch `master`)
### v0.1.5 (latest release and branch `master`)

* Added support for `reveal.js` themes via `show.default_theme` and query-string argument `?theme=...`.
* Added support for `reveal.js` themes via `show.theme` and query-string argument `?theme=...`.
* Improved testing coverage.
* Fixed error with missing static files in the distribution package.

### v0.1.3

Expand All @@ -167,9 +169,9 @@ Staying away from `eval` and `exec` should keep you safe in most scenarios, but
* Added custom layout options with `show.columns`.
* Added styled block with `show.block`.
* Added parameter `language` for `show.code`, defaulting to `"python"`.
* Better layout for columns, with horizontal centering.
* Better layout for input texts.
* Better example for the `pyplot` support in the demo.
* Improved layout for columns, with horizontal centering.
* Improved layout for input texts.
* Improved example for the `pyplot` support in the demo.
* Fixed some style issues.
* Fixed error reloading on a slide with an animation.
* Updated Readme with some examples.
Expand Down
1 change: 1 addition & 0 deletions auditorium/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from enum import IntEnum


class ShowMode(IntEnum):
Markup = 1
Code = 2
Expand Down
5 changes: 3 additions & 2 deletions auditorium/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def the_basics():
from auditorium import Show
show = Show("Auditorium Demo")""")

show.markdown("add a method for every slide, decorated with `@show.slide`.")
show.markdown("Add a method for every slide, decorated with `@show.slide`.")

show.code("""
@show.slide
Expand Down Expand Up @@ -366,4 +366,5 @@ def themes():


if __name__ == "__main__":
show.run("localhost", 5050, debug=True)
import sys
show.run("localhost", 5050, debug='--debug' in sys.argv)
13 changes: 4 additions & 9 deletions auditorium/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@
from flask import Flask, jsonify, render_template, send_from_directory, request
from markdown import markdown

from .components import Animation
from .components import Column
from .components import ShowMode
from .components import Vertical
from .components import Block
from .components import Fragment
from .components import *
from .utils import fix_indent


class Show:
def __init__(self, title="", default_theme='white'):
def __init__(self, title="", theme='white'):
self.slides = {}
self.slide_ids = []
self.default_theme = default_theme
self.theme = theme

self.flask = Flask("auditorium")
self.flask.route("/")(self._index)
Expand Down Expand Up @@ -215,7 +210,7 @@ def _update(self):
return jsonify(self.current_update)

def _index(self):
theme = request.args.get("theme", self.default_theme)
theme = request.args.get("theme", self.theme)
return render_template("index.html", show=self, theme=theme)

def _serve_static(self, filename):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


# TODO: Update version whenever changes
VERSION = '0.1.4-dev'
VERSION = '0.1.5'


def get_install_requirements():
Expand Down
14 changes: 13 additions & 1 deletion tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

from auditorium import Show


def test_show():
show = Show(__name__)
show = Show()

assert show.current_slide is None


def test_one_slide():
show = Show()

@show.slide
def slide_one():
"## Title"

assert show.slide_ids == ['slide_one']
assert show.slides['slide_one'] == slide_one

0 comments on commit 147ae37

Please sign in to comment.