apiad / auditorium Goto Github PK
View Code? Open in Web Editor NEWAn HTML+CSS+JS generator from pure Python code
Home Page: https://apiad.net/auditorium
An HTML+CSS+JS generator from pure Python code
Home Page: https://apiad.net/auditorium
Refactor Show
methods such as do_markup
and do_code
so that all logic is executed against a local context (something like a dict
that passes through the functions), so that there is no show state stored in the Show
instance.
Rewrite backend logic to use WebSockets instead of pure REST requests. This will allow for server-to-client updates, such as updating an animated progress bar based on backend progress.
Hi, I am using version 0.6.1 and I can't and my OS (Ubuntu 18.04) can't seem to find the auditorium command. Did a pip install auditorium and then tried: auditorium demo I looked at my installation directories and can't seem to find auditorium anywhere.
When using render
, allow for a possibly optional flag --animations
that makes auditorium
inject into the generated HTML the content for all frames of animations, and corresponding JavaScript to change them.
Beware that in general is it not possible to cover all possible cases, e.g., animations that have some randomness, animations that interact with input values, nested animations whose state depends on different combinations of frames.
Since this can potentially create very large HTML files, perhaps it should be opt-in and log a warning when animations are found and --animations
is not passed.
Right now auditorium
only works on Python 3.6. In order to make it work with 3.5 up to 3.8 I think some changes are necessary to the coroutine handling in sanic
. Also, we need some way to setup the development environment so that we can test all versions. Maybe creating multiple virtual-envs inside the Docker container?
Is this project abandoned or moved? I can not seem to find anything on the main branch and the documentation is broken.
On your webpages such as "https://apiad.net/auditorium/quickstart/" you refer to an API documentation at https://apiad.net/api/show/ .
Sorry to say that but https://apiad.net/api/show/ is broken.
Hi!
It seems that always the theme 'white' is used regardless of what you specify in run()
.
Theming works in HTML export.
I've been giving a shot to auditorium for presentations and like it so far, but there are a few things that it would be great to make configurable. I'd love to submit a PR, but wanted to check on preferred approach to implementing feature.
The issue I'm trying to solve is that when using plotnine, many figures (especially legends) get cropped out. I traced this down to that pyplot
https://github.com/apiad/auditorium/blob/master/auditorium/show.py#L340 calls plt.tight_layout()
. On the other hand, plotnine
does not call that, but makes a call like plt.savefig(filename, bbox_inches='tight'
(https://plotnine.readthedocs.io/en/stable/_modules/plotnine/ggplot.html#ggplot.save).
I'd propose something like:
pyplot
like savefig_args
and change the savefig
call to plt.savefig(buffer, format=fmt, **savefig_args)
tight_layout=True
(or False
) so only call plt.tight_layout()
if it is True
Combined, this would make it so that I can display plotnine plots as they're intended to look, without monkey patching the pyplot
call. Another possibility is in addition to (1)/(2), add argument on Show
where the defaults can be set, although a similar thing could be accomplished in user code like
def myplot(ctx, plt):
ctx.pyplot(plt, savefig_args={}, tight_layout=False)
def myslide(ctx):
myplot(ctx, someplot)
If not, where would I start to add that functionality ?
Thanks! Great project!
Hi! Really cool idea!
I'm trying to reuse the themes options on reveal.js but getting an error. Is the themes list restricted somehow?
static_html = show.render(theme="beige")
....
Traceback (most recent call last):
File "test.py", line 45, in <module>
static_html = show.render(theme="beige")
File "/usr/local/lib/python3.8/site-packages/auditorium/show.py", line 241, in render
return self._template_static.render(
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 13, in top-level template code
File "/usr/local/lib/python3.8/site-packages/auditorium/show.py", line 256, in _embed
with open(path(src)) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/site-packages/auditorium/static/css/auditorium-beige.css'
On a separate note: is there a way to pass custom CSS styles ? Eg I have a slide with a lot of text so I'd like to set the base font to a smaller size cause otherwise it gets cropped..
When using auditorium render
the rendered HTML embeds all JS, but reveal-js
needs to load plugins from source files, so there is no trivial way of getting highlight.js
and potentially other plugins to work in the static context.
Solution idea: Replace highlight.js
for a Python alternative, such as Pygments.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.