Skip to content

Commit

Permalink
Merge pull request #13 from apiad/develop
Browse files Browse the repository at this point in the history
v0.4.3
  • Loading branch information
apiad authored Dec 14, 2019
2 parents 70c7d2f + a57c02f commit 9fb69c4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 5 deletions.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ Staying away from `eval` and `exec` should keep you safe in most scenarios, but

## History

### v0.4.3

* Improved test coverage a lot.

### v0.4.2

* Added support for injecting Python variables in Markdown mode.
* Added support for interpolating Python variables in Markdown mode.

### v0.4.0

Expand Down Expand Up @@ -302,3 +306,28 @@ License is MIT, so you know the drill: fork, develop, add tests, pull request, r
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
### License for Reveal-js

`auditorium` includes a copy a [reveal-js](https://revealjs.com) which is
itself licensed under MIT.

> Copyright (C) 2019 Hakim El Hattab, http://hakim.se, and reveal.js contributors
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
2 changes: 1 addition & 1 deletion auditorium/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def layout():
"""
## Custom layout
More complex layouts can be compossed.
More complex layouts can be composed.
"""

show.hrule()
Expand Down
7 changes: 5 additions & 2 deletions auditorium/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def do_code(self, slide):
self._run(slide)
return self.current_update

## Utils
## Utilities

def _run(self, slide):
self._unique_id = 0
Expand All @@ -217,6 +217,9 @@ def _get_unique_id(self, markup):
item_id = f"{self.current_slide}-{markup}-{self._unique_id - 1}"
return item_id, f'id="{item_id}" data-slide="{self.current_slide}"'

def render(self, theme='white'):
return self._template.render(show=self, theme=theme)

## Routes

async def _update(self, request):
Expand All @@ -232,4 +235,4 @@ async def _update(self, request):

async def _index(self, request):
theme = request.args.get("theme", self.theme)
return html(self._template.render(show=self, theme=theme))
return html(self.render(theme))
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.4.2'
VERSION = '0.4.3'


def get_install_requirements():
Expand Down
15 changes: 15 additions & 0 deletions tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ def slide_one():

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


def test_demo():
"Make sure the demo runs without exceptions at least one"

from auditorium.demo import show
show.render()


def test_md_demo():
"Make sure the Markdown-first demo runs without exceptions as well"

from auditorium.markdown import MarkdownLoader
show = MarkdownLoader("auditorium/static/md/demo.md").parse()
show.render()

0 comments on commit 9fb69c4

Please sign in to comment.