Skip to content

Commit

Permalink
Merge pull request #41 from apiad/develop
Browse files Browse the repository at this point in the history
v0.6.5
  • Loading branch information
apiad authored Dec 31, 2019
2 parents 5794fef + d5dd494 commit 7021f90
Show file tree
Hide file tree
Showing 20 changed files with 10,060 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,4 @@ dmypy.json
*.zip
*.tar.gz
reveal.js-3.8.0/*
.now
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ deploy:
script: poetry publish --build --username $PYPI_USER --password $PYPI_PASSWORD
on:
tags: true
python: "3.8"
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
[<img alt="Travis (.org)" src="https://img.shields.io/travis/apiad/auditorium/master.svg">](https://travis-ci.org/apiad/auditorium)
[<img alt="Codecov" src="https://img.shields.io/codecov/c/github/apiad/auditorium.svg">](https://codecov.io/gh/apiad/auditorium)
[<img alt="Gitter" src="https://img.shields.io/gitter/room/apiad/auditorium">](https://gitter.im/auditorium-slides/community)
[<img alt="Demo" src="https://img.shields.io/badge/demo-browse-blueviolet"></img>](http://auditorium-demo.apiad.net)
[<img alt="Demo" src="https://img.shields.io/badge/demo-browse-blueviolet"></img>](https://auditorium-demo.now.sh)

> A Python-powered slideshow creator with steroids.
See the demo at [auditorium-demo.apiad.net](http://auditorium-demo.apiad.net) (sorry, no HTTPS yet).
See the demo at [auditorium-demo.now.sh](https://auditorium-demo.now.sh).

## What's this about

Expand Down Expand Up @@ -244,6 +244,11 @@ Staying away from `eval` and `exec` should keep you safe in most scenarios, but

## History

### v0.6.5

* Improved compatibility for [Now](https://now.sh) static deployments.
* The demo has now been moved to [auditorium-demo.now.sh](https://auditorium-demo.now.sh).

### v0.6.4

* New development environment completely based on Docker.
Expand Down
2 changes: 1 addition & 1 deletion auditorium/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def demo(host="127.0.0.1", port=6789, debug=False, launch=True):
def render(path, theme="white", instance_name="show"):
"Renders a slideshow into a single HTML with all resources embedded."

show = load(path, instance_name)
show = Show.load(path, instance_name)
print(show.render(theme))

@staticmethod
Expand Down
5 changes: 3 additions & 2 deletions auditorium/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from auditorium import Show

show = Show("Auditorium Demo")
app = show.app


@show.slide
Expand Down Expand Up @@ -464,6 +465,6 @@ def append(ctx):
ctx.code("show.append('auditorium/static/md/demo.md')")


from .utils import path
from auditorium.markdown import load_markdown_demo

show.append(path("./static/md/demo.md"))
show.append(load_markdown_demo())
5 changes: 5 additions & 0 deletions auditorium/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

from auditorium import Show
from typing import List
from auditorium.utils import path


def load_markdown_demo():
return Show.load(path("./static/md/demo.md"))


class MarkdownLoader:
Expand Down
9 changes: 4 additions & 5 deletions auditorium/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ def __init__(self, title="", theme="white", code_style="monokai"):
def run(self, host: str, port: int, launch: bool, *args, **kwargs) -> None:
self._content = self._render_content()

if launch:
# if launch:
# def launch_server():
# webbrowser.open_new_tab(f"http://{host}:{port}")

def launch_server():
webbrowser.open_new_tab(f"http://{host}:{port}")

self.app.add_task(launch_server)
# self.app.add_task(launch_server)

self.app.run(host=host, port=port, *args, **kwargs)

Expand Down
Loading

0 comments on commit 7021f90

Please sign in to comment.