| About | Webslides is a Python package that creates HTML presentations like this one. It enables easy sharing of Python-generated content such as charts, other visuals and data |
| Contents | This presentation demonstrates features of the HTML format and should help you get started |
| PyPi | https://pypi.org/project/webslides/ |
| WHY Advantages over Powerpoint 1. Dynamic pagelength 💡 2. Interactive content 💡 3. Any HTML content will render 💡 4. Styled Pandas Dataframes 💡 5. Super speed updates! 💡 HOW Getting Started 6. Install and Import 💡 7. Run Demo 💡 8. Hello World 💡 |
| column1 | column2 | column3 | column4 | column5 | |
|---|---|---|---|---|---|
| row1 | 99% | 31% | 70% | 92% | 86% |
| row2 | 9% | 50% | 19% | 98% | 16% |
| row3 | 90% | 8% | 63% | 71% | 47% |
| row4 | 59% | 73% | 81% | 2% | 69% |
| row5 | 9% | 68% | 96% | 45% | 8% |
| row6 | 76% | 60% | 70% | 88% | 86% |
| row7 | 99% | 82% | 64% | 87% | 97% |
| row8 | 43% | 93% | 91% | 98% | 15% |
| row9 | 91% | 70% | 82% | 29% | 22% |
| row10 | 92% | 88% | 64% | 10% | 34% |
#install package
pip install webslides
#import package
import webslides as ws#import
import webslides as ws
#create and open this demo.html in browser
ws.demo()
# imports
import webslides as ws
import plotly.graph_objects as go
# title page
title_page = {
'img_url': '',
'title': 'Title of Title Page',
'summary': {'Summary item 1': 'item text 1', 'Summary item 2': 'item text 2'},
'footer': ['- use custom title image via the img_url parameter', '- footer2']
}
# simple plotly fig
def simple_fig():
x = list(range(1, 11))
y1 = [2 * i for i in x]
y2 = [3 * i for i in x]
trace1 = go.Scatter(x=x, y=y1, mode='markers+lines', name='Line 1')
trace2 = go.Scatter(x=x, y=y2, mode='markers+lines', name='Line 2')
fig = go.Figure()
fig.add_trace(trace1)
fig.add_trace(trace2)
fig.update_layout(title='Simple Plotly Line Figure with Two Lines')
return fig
# content pages
content = {
'Topcat A': {
'Subcat X': [
{
'title': 'Page Title 1 - HTML body',
'highlights': ['- highlight 1', '- highlight 2'],
'body': 'Content 1: this is a <b>HTML string</b>',
'footer': ['- footer 1a', '- <i>italic footer 1b</i>'],
'show': True},
{
'title': 'Page Title 2 - No highlights',
'body': 'Content 2: this is a <b>HTML string</b>',
'footer': ['- Note: No highlights, so no lightbulb in the index page', '- <i>italic footer 2b</i>'],
'show': True}
],
'Subcat Y': [
{
'title': 'Page Title 3 - Plotly fig !',
'highlights': ['- highlight 3', '- note: no footer on this page'],
'body': simple_fig(),
'show': True}
]
},
'Topcat B': {
'Subcat Z': [
{
'title': 'Page Title 4 - Different topcat',
'highlights': ['- highlight 5', '- highlight 6'],
'body': 'Content 3',
'footer': ['- footer 4a', '- footer 4b'],
'show': True}
]
}
}
# MAIN
ws.create(content=content
, title_page=title_page
, fname='webslides_hello_world.html'
, open_in_browser=True
, show_index_page=True
, show_topcat=True
, show_subcat=True
, show_highlights_page=True
, show_highlights_only=False)