anaconda-platform / nbpresent Goto Github PK
View Code? Open in Web Editor NEWnext generation slides for Jupyter Notebooks
License: BSD 3-Clause "New" or "Revised" License
next generation slides for Jupyter Notebooks
License: BSD 3-Clause "New" or "Revised" License
See this screencast:
http://screencast.com/t/7ltl4z9pK
Or:
It feels like the two modes should be mutually exclusive, but there might be some usage mode I don't understand where it does make sense to have both
There will be times when someone wants to mix a busy background with a tint to make it into an interesting, but not distracting background.
Further, some font effects could be pretty nice if they had some alpha.
This is the follow-on to #29. Since no new features were added and the public API didn't change, I think this should be 0.4.2, and not 0.5.0. Could be argued otherwise!
All of our packages are called nb_...
:
My vote is for consistency
A constraint-based layout, a la kiwi.js, would be extremely powerful.
with it, one could do all the vertical aligning and stuff that people would expect from a layout program.
By letting the "natural" size of the cell part (as determined by typography) drive its position, it would be possible to do some very good reusable layouts that were more reactive to the content provided by the user.
The repo page on Github links to https://continuumio.github.io/nbpresent , which 404s.
I guess the link should point to https://anaconda-server.github.io/nbpresent/
The colour
module doesn't appear to be part of the standard conda installation. Please consider rewriting the Importing%20revealjs%20themes.ipynb notebook not to use it. If you are only dealing with #abc
and #aabbcc
style RGB specs, you could just use a simple function like
c_re = re.compile('^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$')
def repeat_chars(s,k):
return ''.join(c*k for c in s)
def v2color(v):
m = c_re.search(v)
if not m:
return None
rgb = m.group(1)
if len(rgb) == 3:
rgb = repeat_chars(rgb,2)
return tuple(int(rgb[k:k+2],16) for k in xrange(0,6,2))
My largest, and perhaps the only stumbling stone with nbpresent so far is the scales of everything. Since the presentation css is the same (?) as in the notebook, most things are tiny in a slideshow.
It would be great if sizes were somehow possible to adjust. (Or am I missing something obvious, and the option is already there?)
As a RISE user, I want to try out my existing slides as an nbpresent presentation.
//cell/*/metadata/slideshow
into //metadata/nbpresent/slides/*
most of the esoteric reveal functions were hard to get to short of direction use of the API (background, parallax, autoplay, themes), so such features can be deferred.
Back on the reveal.js slides, we constantly ran into issues with long content.
now that we have the region-based model, we can solve this in a more fine-grained manner, in the near term. Long term, we'll want interesting, evented scrolling like this:
I think some node_modules
are slipping in. Probably don't need to ship the reference screenshots either... unless they are needed in the docs.
The next release needs to strip these out.
MANIFEST.in
Each extra notebook with embedded stuff carries cost in package size, etc.
Further, since the development steps to go from repo to usable package are rather involved, there's no reason to make mybinder.org do that in their docker infrastructure if we're already automatically building packages.
Let's create an nbpresent-examples
repo like bokeh-notebooks, with a binder (#27) using an environment.yml pointing at the built nbpresent to bring in third party libraries will lighten the base development environment considerably.
When I drag slides left and right to reorder them a few things happen
(1) The Your Slides window hangs
(2) The slides do reorder, but not in "Your Slides", even if the kernel is restarted. In fact, if I flip through the slides, the orange box jumps around in "Your Slides". This means I cannot change the order a second time!
The trash can icon is consistently used across the UI to delete things: Slides, regions, themes, colors, backgrounds.
However, it's pretty much an aw, crap moment when the delete occurs.
Two possible approaches:
Right now, when you create a background, it will cover over all previous backgrounds (alpha channel included, but moot for colors).
By making them drag/droppable or with up down buttons, controlling this stack would be easy.
In the data layer, themes.theme.*.backgrounds
is a list, so that could just be reordered with splices... or just a big set. Or, we could go to the more customary model and use a keyed tree and a linked list (again for the atomicity).
At present, the slide sorter is pretty inflexible, just offering horizontal scrolling through the slides.
A direction forward would be a view that put all the slides on a grid (or something else, if we do subslides) which can be reordered in two dimensions.
Further, being able to "combine" slides should be possible: drag a slide "onto" a NSEW of another slide, and it would be split, adding the new content in.
This view would be particularly useful when content import is a thing.
I've started on a conda recipe.
I'd like it to do all of my npm
scut work for me, but there appear to be some issues as it doesn't look like everything gets installed. Any thoughts, @damianavila?
I just did a quick review of the package (not code level, but packaging), and noticed a few things:
README.rst
and README.md
and README.html
all checked in?environment.yml
that would be great: https://github.com/Anaconda-Server/nbpresent/blob/master/conda.recipe/build.sh#L6Let's be ready for the new notebook and continue to support 4.0.6.
.binstar.yml
build.sh
? run_test.sh
?Binder is the best way to expose potential users to the full capability of nbpresent.
The themes need to have visible names. Seeing the color palate and sizing is valuable, but secondary. I think name, colors, fonts are the important pieces for theme selection.
Mature some of the github widget examples into a dashboard view of some data.
It would be nice to be able to use the drag/drop/resize editor as an overlay on top of the current slide at full size.
When "viewing" an nbpresent notebook it would be nice if arrow keys could advance slides and ESC could return to notebook editor mode.
As a User, I want to reuse slides, cell content, backgorunds, themes, fonts from one or more other presentations
Many types of things should be importable:
Basically, it should be possible to either use an URL or a drag-dropped .ipynb
to import all (or part of) that type of data into the appropriate place in the UI.
two types of import should be possible (and potentially not mutually exclusive):
./theme.ipynb
Once loaded, imported content should either be:
$ python -m nbpresent.install --prefix="${CONDA_ENV_PATH}" --enable
copying /media/data/devel/continuum/notebook/nbpresent/nbpresent/static/nbpresent/nbpresent.standalone.min.js -> /home/damian/miniconda3/envs/nbpresent/share/jupyter/nbextensions/nbpresent/nbpresent.standalone.min.js
copying /media/data/devel/continuum/notebook/nbpresent/nbpresent/static/nbpresent/nbpresent.min.css -> /home/damian/miniconda3/envs/nbpresent/share/jupyter/nbextensions/nbpresent/nbpresent.min.css
copying /media/data/devel/continuum/notebook/nbpresent/nbpresent/static/nbpresent/nbpresent.min.js -> /home/damian/miniconda3/envs/nbpresent/share/jupyter/nbextensions/nbpresent/nbpresent.min.js
copying /media/data/devel/continuum/notebook/nbpresent/nbpresent/static/nbpresent/nbpresent.notebook.min.js -> /home/damian/miniconda3/envs/nbpresent/share/jupyter/nbextensions/nbpresent/nbpresent.notebook.min.js
copying /media/data/devel/continuum/notebook/nbpresent/nbpresent/static/nbpresent/nbpresent.deps.min.js -> /home/damian/miniconda3/envs/nbpresent/share/jupyter/nbextensions/nbpresent/nbpresent.deps.min.js
Enabling for /home/damian/miniconda3/envs/nbpresent/etc/jupyter
Enabling nbpresent server component...
(nbpresent)damian-S400CA :: /media/data/devel/continuum/notebook/nbpresent :: (master)
$ jupyter notebook
[W 17:35:01.865 NotebookApp] Unrecognized JSON config file version, assuming version 1
[W 17:35:01.868 NotebookApp] Unrecognized JSON config file version, assuming version 1
[I 17:35:02.340 NotebookApp] The port 8888 is already in use, trying another random port.
[W 17:35:02.431 NotebookApp] Error loading server extension nbpresent
Traceback (most recent call last):
File "/home/damian/miniconda3/envs/nbpresent/lib/python3.4/site-packages/notebook/notebookapp.py", line 991, in init_server_extensions
mod = importlib.import_module(modulename)
File "/home/damian/miniconda3/envs/nbpresent/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'nbpresent'
[I 17:35:02.449 NotebookApp] Serving notebooks from local directory: /media/data/devel/continuum/notebook/nbpresent
[I 17:35:02.450 NotebookApp] 0 active kernels
[I 17:35:02.450 NotebookApp] The IPython Notebook is running at: http://localhost:8889/
[I 17:35:02.450 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Created new window in existing browser session.
[W 17:35:05.294 NotebookApp] 404 GET /clusters?_=1448570104770 (127.0.0.1) 16.59ms referer=http://localhost:8889/tree
[I 17:35:45.713 NotebookApp] Creating new notebook in
[I 17:35:47.424 NotebookApp] Kernel started: ed8a9195-b0dc-48f9-bcd8-fb4deded1c39
[W 17:35:54.111 NotebookApp] 404 GET /static/components/backbone/backbone-min.map (127.0.0.1) 2.78ms referer=None
[I 17:36:06.322 NotebookApp] Kernel shutdown: ed8a9195-b0dc-48f9-bcd8-fb4deded1c39
[W 17:36:06.326 NotebookApp] delete /Untitled.ipynb
I have two error here:
ImportError: No module named 'nbpresent'
When I tried the conda package from anaconda.org/nbcio I am seeing 1
but not 2
... but even with the conda package I can not see the extension...
Starting from the repo I followed the lines you sent in the email last week...
Use nbconvert to generate a standalone HTML document with enough dependencies:
Caveats:
This will require:
data-nbpresent-id
attribute (current approach)Present experiments pointing to problems with requirejs build: mismatched anonymous define
.
The most extensive headless browser testing is done by ipywidgets, with a simpler example from bqplot.
For testing pdf output, as with Anaconda-Platform/nbbrowserpdf#4 some kind of image-based diff should be done, but this can be deferred.
A number of users have complained of not having undo.
Baobabjs supports undo, so it should be relatively easy to add undo, though redo is harder.
Some research is needed to determine the different user activities that would would be undoable steps, as the atomic changes are too small for a user to usefully use.
The automatic play is too fast.
Also clicking on next/prev should leave on "Pause" if the user have pressed Pause.
Regions just kind of end up in the order in which they arrive.
They should be reorderable, such that one could have some more control over, say, some widgets appearing over some output generated by them (i.e. bokeh).
I don't totally understand the theme feature: it appears I can click on multiple themes and they all get added, and moreover I can click on the same theme multiple times and it appears to be added multiple times.
I can't see how to have more than one theme in effect for the entire presentation (and right now I'm not sure it is a good idea that we try to support more than one), so it seems like theme selection, for the time being, should be a matter of picking one theme only.
A commonly used element in presentations is revealing additional content on a slide. Right now the only way to do it is to fully copy a slide, and link a region which was previously empty to a new element.
While this is a universal approach, right now the amount of clicking required to copy a slide is 2 for copying the layout + 2 * number of linked regions for linking. Perhaps an easy solution would be to change "reuse slide as template" to "reuse slide". The logic here is that changing a link is as much work as making a new link, so it doesn't hurt if a newly created slide already has stuff pre-filled.
At present, we can show "all the outputs of a cell" or "all the widgets of a cell" in a region.
However, the DOM would support rejiggering each of the .output_area
s or widget
that might have been serially displayed. Now, we can't let people start talking about output[0]
but we can talk about 0 or more outputs.
With this, one could do a masonry-style layout, a treemap, a carousel (arg) or other kind of user- or data-driven layout, such that:
[display(Image(img) for img in glob("*.png"))]
would create a nice space-filling packing of the outputs.
The PART would probably be output
and widget
(vs outputs
and widgets
) and would take some more precise selector work.
Further, one still wouldn't be able to put output
and outputs
from a single cell on a single slide, but that seems reasonable.
Use bootstrap tour to walk through the key functionality of nbpresent.
Here's the notebook tour.
One approach would just be to start with the content/data screenplay, and build up a src/yml/tour.yml
with the text and order of steps. I might have to do some work to get the selectors to all work, so it might be a sec before we start thinking about clicking buttons, etc: we can add the onShow
later. At that point, we can basically do a self-building presentation.
There are some other UI things to think about as well, which might as well be discussed here:
onShow
OS: OSX
Py2.7
`โ ~ conda install -c anaconda-nb-extensions nbpresent
Fetching package metadata: ......
Solving package specifications: ................................................
Package plan for installation in environment /Users/scollis/anaconda:
The following NEW packages will be INSTALLED:
nbpresent: 1.0.0-py27_0
Proceed ([y]/n)? y
Linking packages ...
copying /Users/scollis/anaconda/lib/python2.7/site-packages/nbpresent-1.0.0-py2.7.egg/nbpresent/static/nbpresent -> /Users/scollis/anaconda/share/jupyter/nbextensions/nbpresent
Traceback (most recent call last):
File "/Users/scollis/anaconda/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/Users/scollis/anaconda/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/scollis/anaconda/lib/python2.7/site-packages/nbpresent-1.0.0-py2.7.egg/nbpresent/install.py", line 112, in
install(**parser.parse_args().dict)
File "/Users/scollis/anaconda/lib/python2.7/site-packages/nbpresent-1.0.0-py2.7.egg/nbpresent/install.py", line 39, in install
install_nbextension(directory, **kwargs)
File "/Users/scollis/anaconda/lib/python2.7/site-packages/notebook/nbextensions.py", line 220, in install_nbextension
_maybe_copy(src, full_dest, verbose)
File "/Users/scollis/anaconda/lib/python2.7/site-packages/notebook/nbextensions.py", line 53, in _maybe_copy
shutil.copy2(src, dest)
File "/Users/scollis/anaconda/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/Users/scollis/anaconda/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: u'/Users/scollis/anaconda/lib/python2.7/site-packages/nbpresent-1.0.0-py2.7.egg/nbpresent/static/nbpresent'
Error: Error: post-link failed for: nbpresent-1.0.0-py27_0 | 0%
โ`
Conda env:
` ~ conda update conda
Fetching package metadata: ....
conda 3.19.3 py27_0 `
It seems some files are missing from v0.5 (or paths aren't updated in install.py
):
> python3 -m nbpresent.install
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/nbpresent/install.py", line 120, in <module>
install(**parser.parse_args().__dict__)
File "/usr/local/lib/python3.4/dist-packages/nbpresent/install.py", line 40, in install
install_nbextension(directory, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 220, in install_nbextension
_maybe_copy(src, full_dest, verbose)
File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 50, in _maybe_copy
if _should_copy(src, dest, verbose):
File "/usr/local/lib/python3.4/dist-packages/notebook/nbextensions.py", line 37, in _should_copy
if os.stat(src).st_mtime - os.stat(dest).st_mtime > 1e-6:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.4/dist-packages/nbpresent/static/nbpresent'
My sense is that we want all extensions to be installed "globally" which will, in fact, mean "in the current conda environment". Ideally we'd like to be able to pass settings through so a user had an option of installing it on a "per user" basis, but then it will be installed outside of conda and will be in all Jupyter instances, which might be problematic.
As a user, I want to be able to bookmark a particular slide in a presentation, and have it
- start presenting
- run all the cells?
- immediately go to the slide I link
It should be possible to deep link to a particular slide, either:
#slide/u-u-i-d
#slide/0
#slide/title-slide
(most work, but probably the best, long-term)Since many rich presentations may require execution (e.g. connect widgets), and should be run-allable, we'd need some way to specify this:
http://localhost:8888/notebooks/presentation.ipynb#!slide/title-slide
This would allow a user to:
This should all work for the static HTML case, as well as the interactive case... so obviously run-all wouldn't matter.
I followed a link here from Twitter:
https://pypi.python.org/pypi/nbpresent/1.0.0
And saw that the whole rendering is broken because Markdown.
Some cells "do stuff" without producing output. If "doing stuff" either has a non-negligible chance of silent failure; "run forever" risk; or "takes more than 3 seconds to complete" some kind of visual queue as to the state of the "executed" cell would be valuable. In a normal notebook view the "prompt" on the left side performs this duty: blank means un-executed, star means "executing" (though possibly stuck), and a number means "executed/done". I don't know exactly what the right answer here is, but an idea:
This is more of a placeholder/discussion than an actual issue.
revealjs themes are not customizable enough unless the user is a CSS/SCSS/HTML/JS ninja.
The nbpresent theming UX will need to be basically an in-browser design suite with access to fonts, colors and metrics all stored in metadata, scaling from "style all h1, h2, h3
with Lato" to "the font size should be increased until an optimal reading width of 45-75 characters is acheived for this block".
"A Theme" is probably composed of a number of design rules (themelets? effects?) that apply to different regions. At the deck, slide or region level, the active rules can be enabled. disabled, tweaked or reordered.
When switching between notebook editing (i.e. working) and slide designing and presenting, the slide themes must not "leak" into the normal authoring experience. For css, this means we can't just dump the whole css, a la reveal.
A presentation will have one or more base themes that all slides and regions inherit. Thus, you can set the "title font" and have all titles get that styling. Among the only things that would be only at the deck level would be, if desirable, the "remote" that lets you switch cells, etc. Moving this to, say, an SVG would be nice.
Separate from the deck, each slide should be able to specify its own theme, defaulting to the deck theme. Among the things here would be backgrounds and gross transitions a la reveal/ppt.
The things that actually get colors, fonts, etc. These might also have per-state-change transitions.
There will be an interplay between themes and layout: the size of a piece of text may drive how large it appears in the layout. This might have to wait until we have a layout solver (i.e. kiwijs) but there are probably some simple things that can be done. Typography should drive this interplay, which will be expensive to calculate, probably, but absolutely critical to actually building better presentations.
We will want to ship/maintain a very limited number of themes (like 2) so that there is something to look at. Beyond the "unthemed" default (inheriting the notebook theme), probably a "dark" theme, and a "boring" theme. While limited and boring, they will set the stage for additional themes, establishing the metadata conventions so that users don't have to rearchitect their content when they change their themes.
Standalone themes would (at first) probably by other python modules that we can discover, but eventually would be npm modules.
When switching between two themes (or selecting them to start with), there should be good correspondence. Doing this with good URIs, with useful descriptions will help.
Probably just need to fix up build.sh and bld.bat.
This is the issue I should have made for #16.
Print-quality PDF output is really important to people being able to confidently use presentations they generate in the wild world of the notebook, as well as make handouts, etc. in critical environments like meetings and conferences, as well as read-ahead. The current Latex approach is pretty good at capturing a stream-based document, but without a serious retooling, most people will have limited success with beamer, etc.
Further, Notebook developers are always using the craziest things (WebGL, etc) to make really cool stuff. Given the HTML/JS/CSS environment becoming the de facto experience, the offline mode should mirror this as closely as possible.
The resulting PDF should:
Due to the inevitable requirement for a more-or-less real web browser, this will likely need to be hidden behind an install flag.
For example, opening the sorter and picking add slide, then closing the sorter, doesn't close the "add" panel.
Github strips out .
characters, so the anchor for 1.0.0
is actually 100
.
As it says,
If I create a new output figure in a cell that was copied and pasted, a region will still link to the old output figure of the original cell
See this screencast:
http://screencast.com/t/7ltl4z9pK
Resizing the window doesn't re-flow the content, it just expands outside of the view port.
Going forward a slide and then back (at the "increased font size") causes a re-flow so the content looks fine.
It would be nice if the re-flow could happen immediately.
Right now, the offline view is "broken" as it doesn't embed fontawesome, even though everything works fine. Nickle fix there would be to leave some CDN fallback in.
Further, all the webfont stuff is handled by webfontloader
, which is good for sharing, but bad for archiving.
At the time of import, we probably have enough information in the browser to capture and base64 the font (preferably woff/2) and the font css, and embed it in metadata.
The exporter would then need to be able to embed that as data uris, but this is likely solveable.
As this would entail a fair amount of data, it would be best to make this an opt-in feature, potentially one that one only picks when choosing to export, i.e.
Download as...
Presentation (.html)
Archive Presentation (big) (.html)
Of course, the joke is always that the first image someone loads would be bigger than the biggest font, but still.
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.