Slides
6. Slides#
Content format
This page is written in the Markdown Notebook format. While it is intended to be rendered through RISE as reveal.js slides, it can also be viewed as a Jupyter Book section or a Jupyter Notebook. The code blocks embedded in this page can be executed through Jupyter Notebook via MyBinder – this option is available from the Launch Menu that appears after hovering the mouse cursor over the icon shown in the top bar. Alternatively, the code boxes can be executed directly on this page with Thebe by activating Live Code from the Launch Menu.
In addition to this article page and the corresponding Jupyter Notebook, static and interactive reveal.js slides are built from the page source. The static slides can be accessed with this button . To launch the interactive version of the slides (with executable code boxes), first open this page as a Jupyter Notebook through Binder – either via the Launch Menu or using this button ; next execute all of the code cells (using the Kernel → Restart & Run All Jupyter Notebook menu); then open RISE by clicking the button located in the top bar of the Jupyter Notebook interface.
Tip
This page includes a number of Python cells holding setup code. You can reveal the content of these cells by clicking the buttons, which appear towards the right edge of this page.
You Only Write Thrice
Creating Documents, Computational Notebooks and Presentations From a Single Source
Kacper Sokol
and Peter Flach
%matplotlib widget
import ipywidgets as widgets
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import IFrame
plt.style.use('seaborn')
DISTILL = 'https://distill.pub/2019/activation-atlas/'
OPEN_REVIEW = 'https://openreview.net/forum?id=i4zpuNRiU4G'
YOU_ONLY_WRITE_THRICE = 'https://so-cool.github.io/you-only-write-thrice/'
SIMPLY_LOGICAL = 'https://too.simply-logical.space/src/text/2_part_ii/4.2.html'
def preview_url(url, height=600):
return IFrame(url, width=800, height=height) # 1200
def interactive_plot():
fig, ax = plt.subplots(figsize=(10, 4))
fig.patch.set_alpha(0)
ax.set_ylim([-4, 4])
ax.grid(True)
x = np.linspace(0, 2 * np.pi, 100)
def my_sine(x, w, amp, phi):
"""Returns a sine for x with angular frequeny w and amplitude amp."""
return amp * np.sin(w * (x - phi))
@widgets.interact(w=(0, 10, 1),
amp=(0, 4, .1),
phi=(0, 2 * np.pi + 0.01, 0.01))
def update(w=1.0, amp=1, phi=0):
"""Removes old lines from plot and plots new one."""
[l.remove() for l in ax.lines]
ax.plot(x, my_sine(x, w, amp, phi), color='C0')
Publishing Process
Stagnation
Ideas: distill.pub
preview_url(DISTILL, height=500)
Ideas: OpenReview
Ideas: The Open Journals (The Journal of Open Source Software)
Issues
Standalone tools
Not integrated
Lack of a dedicated process
Not covering the entire publishing process
Compose (write / revise)
Review (comment / rebut)
Publish (format / version)
Format Multiplicity
(Conference) Publishing
- Manuscripts
- Presentations
- Posters
- Promotional videos
- Press releases
- Blog posts
- Source code
- Computational examples
- ...
- Reviews
- Revisions
- Versions
Source Formats
\(\LaTeX\) documents and Beamer slides
Microsoft Word / OpenOffice Writer / Google Docs
Microsoft PowerPoint / OpenOffice Impress / Google Slides
Markdown / HTML (and other web technologies such as JavaScript)
Code hosted on Dropbox / GitHub / BitBucket
Jupyter Notebooks / CodaLab documents
Lowest Common Denominator: Static Outputs and Artefacts
Artefacts reusability:
visualisations / figures
tables
code snippets
mathematical typesetting
enforces their simplest – often static – type
Towards Online and Interactive Research Outputs
Authoring
Multiple Entry Points – Single Source
MyST Markdown →
- Jupyter Notebook – computational narrative
- Google Colab
- MyBinder
- Reveal.JS – interactive slides
- Jupyter Book – interactive report/document/book
Version-controlled Environment
- Source versioning and history tracking
- E.g., git or mercurial
Reviewing
- Akin to source code review, e.g., through Issues and Pull Requests infrastructure
- Permanently attached to the document source
- Provenance record
- Resubmission history
- Conversational review with inline comments and discussions
Publishing
Tag a version
Release to an archiving platform
Bibliometrics
DOI minting (e.g., Zenodo) to support citations
Google Analytics-like dissemination tracking
Presenting
Three formats: documents, slides and computational notebooks
Native interactivity support
Improved accessibility
Execute directly in the browser – no need to install stuff
Support for web-enabled assistive technologies
Web technologies are the limit
interactive_plot()
The Way Forward
Extend the Jupyter Book / Sphinx plugin ecosystem
Support non-mainstream programming languages (SWI Prolog, ProbLog and cplint)
Linked exercise and solution blocks
Custom code syntax highlighting
Bespoke publishing lifecycle platform (instead of GitHub or BitBucket)
Compute resources suitable for hosting and executing the (interactive) content
Horizon 2020 ICT-48 European AI excellence centre exploring new ways of working and AI-powered research and collaboration tools.
Exhibit
Source
Preview
preview_url(YOU_ONLY_WRITE_THRICE, height=500)