streamtex 0.7.71__tar.gz → 0.7.72__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streamtex-0.7.71/streamtex.egg-info → streamtex-0.7.72}/PKG-INFO +1 -1
- {streamtex-0.7.71 → streamtex-0.7.72}/pyproject.toml +1 -1
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/__init__.py +7 -1
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/book.py +8 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/export_cmd.py +2 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/deploy/stx_auth.py +1 -1
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/presentation.py +14 -3
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/slide.py +26 -72
- streamtex-0.7.72/streamtex/slide_note.py +305 -0
- {streamtex-0.7.71 → streamtex-0.7.72/streamtex.egg-info}/PKG-INFO +1 -1
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex.egg-info/SOURCES.txt +1 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/LICENSE +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/MANIFEST.in +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/README.md +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/setup.cfg +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/__main__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/config.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/generate.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/history.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/metadata.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/base.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/fal.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/google.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/openai.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/ai/providers/registry.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/auth.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/banner.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/bib.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/bib_preview.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/block_helpers.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/blocks.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/browser.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_claude_files.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_divergence.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_install_local_packs.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_shared.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_stx_toml.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/_toml_helpers.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/artifact_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/bib_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/build_check.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/cache_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/claude_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/claude_global.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/claude_project.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/commands.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/component_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/console.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/coolify.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/deploy_auth_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/deploy_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/dev_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/dev_config.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/ds_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/install_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/kit_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/main.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/base.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/compat.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/registry.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/v0_4_0.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/migrations/v0_4_6.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/pack_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/project_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/project_rules.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/publish_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/published_check.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/release_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/run_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/run_set.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/screenshot_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/shortcuts.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/status_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/sync_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/upgrade_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/validate_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/cli/workspace_cmd.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/code.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/collection.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/constants.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/container.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/_frontmatter.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/agent.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/ai_prompt.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/archetype.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/asset.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/discovery.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/guideline.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/install.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/integration.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/loaders.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/palette.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/skill.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/spec.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/artifacts/validation.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/contracts.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/discovery.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/core/validation.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/countdown.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/deeplink.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/deploy/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/enums.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/export.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/export_enrich.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/export_paginate.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/export_widgets.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/facts.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/grid.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/gsheet.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/hover_tooltip.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/i18n.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/image.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/image_crop.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/image_editor.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/image_utils.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/inspector.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/kept.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/latex.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/latex_utils.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/link_config.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/link_preview.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/list.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/loading.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/markdown.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/marker.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/marker_runtime.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/media_overlay.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/mermaid.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/overlay.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/pagewalk.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/pdf_export.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/plantuml.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/presentation_profile.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/printing.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/build.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/config.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/coolify.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/levels.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/ops.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/passwords.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/state.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/target.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/live/Dockerfile +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/live/entrypoint.sh +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/live/nginx.conf +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/live/stx-http.conf +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/live/supervisord.conf +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/10-stx-init.sh +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/20-stx-auth.sh +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/Dockerfile +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/closed.html +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/nginx.conf +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/stx-http.conf +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/release/templates/static/stx_auth.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/runtime_flags.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/scripts/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/scripts/migrate_curves_to_relative.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/search.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/space.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/spacing.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/css/stx_global.css +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/default.css +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/js/stx_countdown.js +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/js/stx_marker_observer.js +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/js/stx_scroll_spy.js +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/js/stx_video.js +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/logo-stx-tiny.png +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/static/logo-stx.png +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/__init__.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/base.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/container.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/core.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/scale.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/scale_curves.toml +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/text.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/styles/visibility.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/tikz.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/toc.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/utils.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/watch.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/write.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex/zoom.py +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex.egg-info/dependency_links.txt +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex.egg-info/entry_points.txt +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex.egg-info/requires.txt +0 -0
- {streamtex-0.7.71 → streamtex-0.7.72}/streamtex.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamtex
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.72
|
|
4
4
|
Summary: AI-powered content framework for Streamlit — create presentations, courses, and web-books with Claude or Cursor, no coding required.
|
|
5
5
|
Author-email: Nicolas Guelfi <nicolas.guelfi@laposte.net>
|
|
6
6
|
License-Expression: BUSL-1.1
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "streamtex"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.72"
|
|
8
8
|
description = "AI-powered content framework for Streamlit — create presentations, courses, and web-books with Claude or Cursor, no coding required."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -80,7 +80,10 @@ try:
|
|
|
80
80
|
set_slide_break_config, get_slide_break_config,
|
|
81
81
|
add_slide_break_options,
|
|
82
82
|
st_slide, set_slide_container, get_slide_container, SLIDE_CONTAINER,
|
|
83
|
-
set_slide_note, get_slide_note, st_slide_note,
|
|
83
|
+
set_slide_note, get_slide_note, st_slide_note,
|
|
84
|
+
)
|
|
85
|
+
from .slide_note import (
|
|
86
|
+
SlideNote, set_slide_notes, get_slide_notes, SLIDE_NOTE_STYLE,
|
|
84
87
|
)
|
|
85
88
|
|
|
86
89
|
# Presentation profiles (display configurations)
|
|
@@ -290,6 +293,7 @@ __all__ = [
|
|
|
290
293
|
"ReuseArchitectureError",
|
|
291
294
|
"SLIDE_CONTAINER",
|
|
292
295
|
"SLIDE_NOTE_STYLE",
|
|
296
|
+
"SlideNote",
|
|
293
297
|
"ScaleConfig",
|
|
294
298
|
"ScaleCurve",
|
|
295
299
|
"SlideBreakConfig",
|
|
@@ -336,6 +340,7 @@ __all__ = [
|
|
|
336
340
|
"get_slide_break_config",
|
|
337
341
|
"get_slide_container",
|
|
338
342
|
"get_slide_note",
|
|
343
|
+
"get_slide_notes",
|
|
339
344
|
"get_spacing",
|
|
340
345
|
"get_static_sources",
|
|
341
346
|
"inject_link_preview_scaffold",
|
|
@@ -385,6 +390,7 @@ __all__ = [
|
|
|
385
390
|
"set_slide_break_config",
|
|
386
391
|
"set_slide_container",
|
|
387
392
|
"set_slide_note",
|
|
393
|
+
"set_slide_notes",
|
|
388
394
|
"set_spacing",
|
|
389
395
|
"set_static_sources",
|
|
390
396
|
"set_zoom",
|
|
@@ -541,6 +541,8 @@ def _offer_export_downloads(html: str, base_name: str,
|
|
|
541
541
|
pass
|
|
542
542
|
|
|
543
543
|
html_download = apply_html_print_rule(html_download, rules) # #107
|
|
544
|
+
from .slide_note import apply_slide_notes
|
|
545
|
+
html_download = apply_slide_notes(html_download) # note3
|
|
544
546
|
collector = get_asset_collector()
|
|
545
547
|
# Served media (configure_image_path) must survive off the
|
|
546
548
|
# server: materialise them into the collector / as data
|
|
@@ -670,6 +672,8 @@ def _run_auto_exports(
|
|
|
670
672
|
_html_out = lazy_load_images( # #115
|
|
671
673
|
_html_out, st.session_state.get(_STX_CACHE_KEY, {}).get("markers"))
|
|
672
674
|
_html_out = apply_html_print_rule(_html_out, get_print_state()) # #107
|
|
675
|
+
from .slide_note import apply_slide_notes
|
|
676
|
+
_html_out = apply_slide_notes(_html_out) # note3
|
|
673
677
|
if collector:
|
|
674
678
|
# External mode: write HTML + data/ folder to disk
|
|
675
679
|
out_dir = str(_P(path).parent)
|
|
@@ -1069,6 +1073,10 @@ def _st_book_impl(module_list, toc_config: TOCConfig = None, marker_config: Mark
|
|
|
1069
1073
|
})();
|
|
1070
1074
|
</script>""", height=1)
|
|
1071
1075
|
|
|
1076
|
+
# Slide notes (note3): their rules and the notes fixed on the screen, once per page
|
|
1077
|
+
from .slide_note import st_slide_notes_page
|
|
1078
|
+
st_slide_notes_page()
|
|
1079
|
+
|
|
1072
1080
|
if st.session_state[_STX_VIEW_MODE_KEY] == "Paginated":
|
|
1073
1081
|
_paginated_book(module_list, toc_config, marker_config, separator,
|
|
1074
1082
|
export, export_title, banner_config,
|
|
@@ -329,6 +329,8 @@ def export_html(path, output, asset_mode, title, no_nav, theme_mode, theme_bg, t
|
|
|
329
329
|
html_in = lazy_load_images(html_in, nav_markers) # each output file (#115)
|
|
330
330
|
from ..printing import apply_html_print_rule
|
|
331
331
|
html_in = apply_html_print_rule(html_in, print_rules) # #107
|
|
332
|
+
from ..slide_note import apply_slide_notes
|
|
333
|
+
html_in = apply_slide_notes(html_in) # note3: in every output file
|
|
332
334
|
if no_nav or not nav_data:
|
|
333
335
|
return html_in
|
|
334
336
|
from ..export_enrich import enrich_export_html
|
|
@@ -107,7 +107,7 @@ from pathlib import Path
|
|
|
107
107
|
from urllib.parse import parse_qs, urlsplit
|
|
108
108
|
|
|
109
109
|
#: The library release this file ships with, and its interface number (#135).
|
|
110
|
-
STX_VERSION = "0.7.
|
|
110
|
+
STX_VERSION = "0.7.72"
|
|
111
111
|
AUTH_INTERFACE = 3
|
|
112
112
|
|
|
113
113
|
DEFAULT_ROOT = "/var/lib/stx-auth"
|
|
@@ -320,6 +320,15 @@ def st_presentation_footer(
|
|
|
320
320
|
if display_title
|
|
321
321
|
else ""
|
|
322
322
|
)
|
|
323
|
+
# Slide notes in the bar (note3): in place of the title, after it, before the counter
|
|
324
|
+
from .slide_note import bar_notes_html
|
|
325
|
+
in_title = bar_notes_html("bar-title")
|
|
326
|
+
if in_title:
|
|
327
|
+
title_html = f'<span class="stx-pf-title">{in_title}</span>'
|
|
328
|
+
after, before = bar_notes_html("bar-after-title"), bar_notes_html("bar-before-counter")
|
|
329
|
+
if after:
|
|
330
|
+
title_html = (f'<span class="stx-pf-left" style="display: flex; gap: 1em; align-items: center;">'
|
|
331
|
+
f"{title_html}{after}</span>")
|
|
323
332
|
|
|
324
333
|
if cfg.counter_mode == "slide":
|
|
325
334
|
prefix = "Slide"
|
|
@@ -327,13 +336,15 @@ def st_presentation_footer(
|
|
|
327
336
|
else:
|
|
328
337
|
prefix = "Bloc"
|
|
329
338
|
attr = ""
|
|
339
|
+
counter_html = f'<span class="stx-pf-counter"{attr}>{prefix} {current_slide} / {total_slides}</span>'
|
|
340
|
+
if before:
|
|
341
|
+
counter_html = (f'<span class="stx-pf-right" style="display: flex; gap: 1em; align-items: center;">'
|
|
342
|
+
f"{before}{counter_html}</span>")
|
|
330
343
|
|
|
331
344
|
html = (
|
|
332
345
|
f'<div class="stx-presentation-footer">'
|
|
333
346
|
f" {title_html}"
|
|
334
|
-
f
|
|
335
|
-
f" {prefix} {current_slide} / {total_slides}"
|
|
336
|
-
f" </span>"
|
|
347
|
+
f" {counter_html}"
|
|
337
348
|
f"</div>"
|
|
338
349
|
)
|
|
339
350
|
_render(html)
|
|
@@ -534,95 +534,48 @@ def get_slide_container() -> _Style:
|
|
|
534
534
|
return _slide_container if _slide_container is not None else SLIDE_CONTAINER
|
|
535
535
|
|
|
536
536
|
|
|
537
|
-
#: The look of a text note (:func:`set_slide_note`): a small grey line, centred.
|
|
538
|
-
SLIDE_NOTE_STYLE = _Style("font-size: 0.75rem; color: #888; text-align: center; line-height: 1.3;",
|
|
539
|
-
"stx_slide_note")
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
@dataclass(frozen=True)
|
|
543
|
-
class _TextNote:
|
|
544
|
-
text: object # a text, or a leaf {"en": …, "fr": …}
|
|
545
|
-
link: Optional[str]
|
|
546
|
-
style: _Style
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
_slide_note = None
|
|
550
|
-
_NOTE_KEY = "_stx_slide_note"
|
|
551
|
-
|
|
552
|
-
|
|
553
537
|
def set_slide_note(note=None, *, link: Optional[str] = None, style: Optional[_Style] = None) -> None:
|
|
554
|
-
"""Set
|
|
538
|
+
"""Set ONE note drawn at the foot of every :func:`st_slide` (``None`` = no note) — the 0.7.70 form.
|
|
555
539
|
|
|
556
540
|
One line in ``book.py``, before ``st_book`` (board ``note1``)::
|
|
557
541
|
|
|
558
542
|
stx.set_slide_note({"fr": "© 2026 … — lecture réservée aux participants",
|
|
559
543
|
"en": "© 2026 … — for the participants only"}, link="legal-notice")
|
|
560
544
|
|
|
561
|
-
*note* is a text or a leaf ``{"en": …, "fr": …}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
``
|
|
567
|
-
:func:`st_slide_note` draws it on a page without ``st_slide``.
|
|
568
|
-
|
|
569
|
-
Stored per session, as :func:`set_slide_container` (#122): two modules
|
|
570
|
-
served by one process do not share their note.
|
|
545
|
+
*note* is a text or a leaf ``{"en": …, "fr": …}``, drawn as one small grey line just under the
|
|
546
|
+
slide box (it adds no height), a link to the marker *link* if given (opened in a new tab) — or
|
|
547
|
+
a function drawing the note itself after every slide. It is the note
|
|
548
|
+
``SlideNote(note, place="below", link=link, opacity=1, style=style or SLIDE_NOTE_STYLE)``:
|
|
549
|
+
:func:`set_slide_notes` sets several, with their place, texts per mode, opacity and layer
|
|
550
|
+
(board ``note3``). Stored per session, as :func:`set_slide_container` (#122).
|
|
571
551
|
"""
|
|
572
|
-
|
|
552
|
+
from .slide_note import SLIDE_NOTE_STYLE, SlideNote, set_slide_notes
|
|
573
553
|
if callable(note):
|
|
574
554
|
if link is not None or style is not None:
|
|
575
555
|
raise ValueError("set_slide_note: link= and style= go with a text; a function draws its own note")
|
|
556
|
+
set_slide_notes(note)
|
|
576
557
|
elif note is not None:
|
|
577
558
|
if not isinstance(note, (str, dict)) or not note:
|
|
578
559
|
raise TypeError("set_slide_note: a text, a leaf {'en': …, 'fr': …}, a function, or None")
|
|
579
|
-
|
|
560
|
+
set_slide_notes(SlideNote(note, "below", link=link, opacity=1.0,
|
|
561
|
+
style=style if style is not None else SLIDE_NOTE_STYLE))
|
|
580
562
|
elif link is not None or style is not None:
|
|
581
563
|
raise ValueError("set_slide_note: link= and style= need a note")
|
|
582
|
-
if _in_session():
|
|
583
|
-
if note is None:
|
|
584
|
-
st.session_state.pop(_NOTE_KEY, None)
|
|
585
|
-
else:
|
|
586
|
-
st.session_state[_NOTE_KEY] = note
|
|
587
564
|
else:
|
|
588
|
-
|
|
565
|
+
set_slide_notes()
|
|
589
566
|
|
|
590
567
|
|
|
591
568
|
def get_slide_note():
|
|
592
|
-
"""The note
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
from .deeplink import marker_href
|
|
604
|
-
from .i18n import T
|
|
605
|
-
text = html.escape(T(note.text))
|
|
606
|
-
if note.link:
|
|
607
|
-
text = (f'<a href="{html.escape(marker_href(note.link))}" target="_blank" rel="noopener" '
|
|
608
|
-
f'style="color: inherit; text-decoration: none;">{text}</a>')
|
|
609
|
-
line = f'<div class="stx-slide-note" style="{note.style}">{text}</div>'
|
|
610
|
-
if not foot:
|
|
611
|
-
return line
|
|
612
|
-
# just under the box, in its bottom margin (10vh in SLIDE_CONTAINER): a wrapper of no height (p1)
|
|
613
|
-
return ('<div class="stx-slide-note-foot" style="position: relative; height: 0; overflow: visible;">'
|
|
614
|
-
f'<div style="position: absolute; left: 0; right: 0; bottom: 7vh;">{line}</div></div>')
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
def st_slide_note(*, _foot: bool = False) -> None:
|
|
618
|
-
"""Draw the note of :func:`set_slide_note` here — on a page without ``st_slide``; nothing if none."""
|
|
619
|
-
note = get_slide_note()
|
|
620
|
-
if note is None:
|
|
621
|
-
return
|
|
622
|
-
if isinstance(note, _TextNote):
|
|
623
|
-
_render(_note_html(note, _foot))
|
|
624
|
-
else:
|
|
625
|
-
note()
|
|
569
|
+
"""The first note of this session (``None``: none) — see :func:`get_slide_notes`."""
|
|
570
|
+
from .slide_note import get_slide_notes
|
|
571
|
+
notes = get_slide_notes()
|
|
572
|
+
return notes[0] if notes else None
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def st_slide_note() -> None:
|
|
576
|
+
"""Draw the slide notes here, as lines — on a page without ``st_slide``; nothing if none."""
|
|
577
|
+
from .slide_note import draw_slide_notes
|
|
578
|
+
draw_slide_notes(foot=False)
|
|
626
579
|
|
|
627
580
|
|
|
628
581
|
def _slide_marker(marker, key, roles) -> tuple[str, Optional[MarkerRoles]] | None:
|
|
@@ -682,7 +635,7 @@ def st_slide(cut: bool = False, style: Optional[_Style] = None, *,
|
|
|
682
635
|
``MarkerRoles.HIDDEN`` or ``MarkerRoles(listed=False, toc_lvl="2")``.
|
|
683
636
|
:param box: ``False`` = no box, the content flows (forms B and D).
|
|
684
637
|
|
|
685
|
-
The
|
|
638
|
+
The notes of :func:`set_slide_notes`, if any, close every slide.
|
|
686
639
|
:param zoom, spacing, config: settings of the break (``cut=True`` only),
|
|
687
640
|
as ``st_slide_break`` takes them.
|
|
688
641
|
"""
|
|
@@ -711,11 +664,12 @@ def st_slide(cut: bool = False, style: Optional[_Style] = None, *,
|
|
|
711
664
|
if explicit is not None:
|
|
712
665
|
label, r = explicit
|
|
713
666
|
st_marker(label, key=key, roles=r)
|
|
667
|
+
from .slide_note import draw_slide_notes
|
|
714
668
|
if not box:
|
|
715
669
|
yield
|
|
716
|
-
|
|
670
|
+
draw_slide_notes(foot=False)
|
|
717
671
|
return
|
|
718
672
|
container = get_slide_container()
|
|
719
673
|
with st_block(container + style if style is not None else container):
|
|
720
674
|
yield
|
|
721
|
-
|
|
675
|
+
draw_slide_notes(foot=True)
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"""Slide notes: lines the document's designer places on every slide, the screen or the bar (board ``note3``).
|
|
2
|
+
|
|
3
|
+
One or several notes, declared once in ``book.py`` before ``st_book``::
|
|
4
|
+
|
|
5
|
+
stx.set_slide_notes(
|
|
6
|
+
stx.SlideNote(text={"slides": SHORT, "document": SHORT, "html": LONG, "phone": None},
|
|
7
|
+
place="bar-before-counter", link="legal-notice"),
|
|
8
|
+
stx.SlideNote(text="© Right-On-Skill", place="across", opacity=0.08), # a watermark
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
Each note has
|
|
12
|
+
|
|
13
|
+
- a **place**:
|
|
14
|
+
- in the slide, drawn with every ``st_slide`` (app and HTML): ``below`` (just under the box, in
|
|
15
|
+
its bottom margin), ``above``, ``left``, ``right`` (vertical text, read from top to bottom),
|
|
16
|
+
``across`` (a watermark over the box);
|
|
17
|
+
- fixed on the screen, drawn once (app and HTML): ``screen-top``, ``screen-bottom``,
|
|
18
|
+
``screen-left``, ``screen-right``;
|
|
19
|
+
- in the presentation bar (the app only; the HTML has no bar): ``bar-after-title``,
|
|
20
|
+
``bar-title``, ``bar-before-counter``;
|
|
21
|
+
- a **text per display mode**: a text, a leaf ``{"en": …, "fr": …}``, or a dict of modes —
|
|
22
|
+
``slides`` (the app, paginated), ``document`` (the app, continuous), ``html`` (both HTML forms),
|
|
23
|
+
``phone`` (a screen under 600 px), ``default`` — whose values are texts, leaves, or ``None``
|
|
24
|
+
(no note in that mode); a missing mode takes ``default``;
|
|
25
|
+
- an **opacity** and a **style**, with defaults by place;
|
|
26
|
+
- a **layer**: ``under`` (default) draws the note beneath the content, so that a text of the slide
|
|
27
|
+
placed over it hides it (NG, board ``note3``); ``over`` draws it above. Under the content a
|
|
28
|
+
link stays clickable through a transparent copy of the link above it.
|
|
29
|
+
|
|
30
|
+
A slide place assumes the box of ``SLIDE_CONTAINER`` (80vh high, 10vh margins): under a slide
|
|
31
|
+
taller than the screen, the note follows the box. Stored per session, as ``set_slide_container``
|
|
32
|
+
(#122): two modules served by one process keep their own notes.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from __future__ import annotations
|
|
36
|
+
|
|
37
|
+
import html as _html
|
|
38
|
+
from dataclasses import dataclass
|
|
39
|
+
from typing import Optional
|
|
40
|
+
|
|
41
|
+
import streamlit as st
|
|
42
|
+
|
|
43
|
+
from .styles import Style
|
|
44
|
+
|
|
45
|
+
SLIDE_PLACES = ("below", "above", "left", "right", "across")
|
|
46
|
+
SCREEN_PLACES = ("screen-top", "screen-bottom", "screen-left", "screen-right")
|
|
47
|
+
BAR_PLACES = ("bar-after-title", "bar-title", "bar-before-counter")
|
|
48
|
+
PLACES = SLIDE_PLACES + SCREEN_PLACES + BAR_PLACES
|
|
49
|
+
MODES = ("slides", "document", "html", "phone", "default")
|
|
50
|
+
LAYERS = ("under", "over")
|
|
51
|
+
|
|
52
|
+
#: The look of ``set_slide_note`` (0.7.70): a small grey line, centred.
|
|
53
|
+
SLIDE_NOTE_STYLE = Style("font-size: 0.75rem; color: #888; text-align: center; line-height: 1.3;",
|
|
54
|
+
"stx_slide_note")
|
|
55
|
+
|
|
56
|
+
_LINE = "font-size: 0.75rem; color: #888; text-align: center; line-height: 1.3; white-space: nowrap;"
|
|
57
|
+
_VERTICAL = "font-size: 0.7rem; color: #888; line-height: 1.3; white-space: nowrap;"
|
|
58
|
+
#: The default look and opacity of each place.
|
|
59
|
+
_DEFAULTS = {
|
|
60
|
+
"line": (Style(_LINE, "stx_note_line"), 0.7),
|
|
61
|
+
"vertical": (Style(_VERTICAL, "stx_note_vertical"), 0.7),
|
|
62
|
+
"across": (Style("font-size: 5vw; font-weight: 700; color: #888; white-space: nowrap;", "stx_note_across"),
|
|
63
|
+
0.08),
|
|
64
|
+
"bar": (Style("", "stx_note_bar"), 0.7),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _kind(place: str) -> str:
|
|
69
|
+
if place in BAR_PLACES:
|
|
70
|
+
return "bar"
|
|
71
|
+
if place == "across":
|
|
72
|
+
return "across"
|
|
73
|
+
if place.endswith("left") or place.endswith("right"):
|
|
74
|
+
return "vertical"
|
|
75
|
+
return "line"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@dataclass(frozen=True)
|
|
79
|
+
class SlideNote:
|
|
80
|
+
"""One note: its text (per mode), place, link, opacity, style and layer (see the module)."""
|
|
81
|
+
|
|
82
|
+
text: object
|
|
83
|
+
place: str = "below"
|
|
84
|
+
link: Optional[str] = None
|
|
85
|
+
opacity: Optional[float] = None
|
|
86
|
+
style: Optional[Style] = None
|
|
87
|
+
layer: str = "under"
|
|
88
|
+
|
|
89
|
+
def __post_init__(self):
|
|
90
|
+
if self.place not in PLACES:
|
|
91
|
+
raise ValueError(f"SlideNote: place={self.place!r} — one of {', '.join(PLACES)}")
|
|
92
|
+
if self.layer not in LAYERS:
|
|
93
|
+
raise ValueError(f"SlideNote: layer={self.layer!r} — 'under' or 'over'")
|
|
94
|
+
if self.opacity is not None and not 0 <= self.opacity <= 1:
|
|
95
|
+
raise ValueError("SlideNote: opacity goes from 0 (invisible) to 1")
|
|
96
|
+
if not isinstance(self.text, (str, dict)) or not self.text:
|
|
97
|
+
raise TypeError("SlideNote: text is a text, a leaf {'en': …, 'fr': …} or a dict of modes")
|
|
98
|
+
if _by_mode(self.text):
|
|
99
|
+
unknown = set(self.text) - set(MODES)
|
|
100
|
+
if unknown:
|
|
101
|
+
raise ValueError(f"SlideNote: unknown mode(s) {sorted(unknown)} — {', '.join(MODES)}")
|
|
102
|
+
|
|
103
|
+
def text_for(self, mode: str) -> Optional[str]:
|
|
104
|
+
"""The text shown in *mode* (``None``: no note there), in the module's language."""
|
|
105
|
+
from .i18n import T
|
|
106
|
+
value = self.text
|
|
107
|
+
if _by_mode(value):
|
|
108
|
+
value = value.get(mode, value.get("default"))
|
|
109
|
+
return None if value is None else T(value)
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def look(self) -> tuple[Style, float]:
|
|
113
|
+
style, opacity = _DEFAULTS[_kind(self.place)]
|
|
114
|
+
return (self.style if self.style is not None else style,
|
|
115
|
+
self.opacity if self.opacity is not None else opacity)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _by_mode(text) -> bool:
|
|
119
|
+
return isinstance(text, dict) and any(k in MODES for k in text)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# --- Per-session storage (as set_slide_container, #122) ---------------------------------------
|
|
123
|
+
|
|
124
|
+
_notes: tuple = ()
|
|
125
|
+
_NOTES_KEY = "_stx_slide_notes"
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _in_session() -> bool:
|
|
129
|
+
from .slide import _in_session as in_session
|
|
130
|
+
return in_session()
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def set_slide_notes(*notes) -> None:
|
|
134
|
+
"""Set the notes of the module (none: no note). Each is a :class:`SlideNote`, or a function that
|
|
135
|
+
draws a note itself after every slide (``set_slide_note(function)``, 0.7.70)."""
|
|
136
|
+
global _notes
|
|
137
|
+
for n in notes:
|
|
138
|
+
if not isinstance(n, SlideNote) and not callable(n):
|
|
139
|
+
raise TypeError("set_slide_notes: SlideNote(…) or a function")
|
|
140
|
+
if _in_session():
|
|
141
|
+
if notes:
|
|
142
|
+
st.session_state[_NOTES_KEY] = tuple(notes)
|
|
143
|
+
else:
|
|
144
|
+
st.session_state.pop(_NOTES_KEY, None)
|
|
145
|
+
else:
|
|
146
|
+
_notes = tuple(notes)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def get_slide_notes() -> tuple:
|
|
150
|
+
"""The notes of this session (an empty tuple: none)."""
|
|
151
|
+
if _in_session():
|
|
152
|
+
notes = st.session_state.get(_NOTES_KEY)
|
|
153
|
+
if notes is not None:
|
|
154
|
+
return notes
|
|
155
|
+
return _notes
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# --- Rendering ------------------------------------------------------------------------------
|
|
159
|
+
|
|
160
|
+
def _app_mode() -> str:
|
|
161
|
+
try:
|
|
162
|
+
from .book import _STX_VIEW_MODE_KEY
|
|
163
|
+
view = st.session_state.get(_STX_VIEW_MODE_KEY, "Paginated") if _in_session() else "Paginated"
|
|
164
|
+
except Exception: # noqa: BLE001
|
|
165
|
+
view = "Paginated"
|
|
166
|
+
return "document" if view == "Continuous" else "slides"
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _variants(note: SlideNote) -> str:
|
|
170
|
+
"""The note's text for the app, the HTML and a phone: one span each, CSS shows the right one."""
|
|
171
|
+
from .deeplink import marker_href
|
|
172
|
+
texts = {"app": note.text_for(_app_mode()), "html": note.text_for("html"), "phone": note.text_for("phone")}
|
|
173
|
+
|
|
174
|
+
def one(text):
|
|
175
|
+
if not text:
|
|
176
|
+
return ""
|
|
177
|
+
t = _html.escape(text)
|
|
178
|
+
if note.link:
|
|
179
|
+
t = (f'<a href="{_html.escape(marker_href(note.link))}" target="_blank" rel="noopener" '
|
|
180
|
+
f'style="color: inherit; text-decoration: none;">{t}</a>')
|
|
181
|
+
return t
|
|
182
|
+
|
|
183
|
+
if len(set(texts.values())) == 1:
|
|
184
|
+
return one(texts["app"])
|
|
185
|
+
return "".join(f'<span class="stx-sn-{k}">{one(v)}</span>' for k, v in texts.items())
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
#: Where a slide place sits, from a wrapper of no height just under the box's bottom margin.
|
|
189
|
+
_SLIDE_POS = {
|
|
190
|
+
"below": "bottom: 7vh; left: 0; right: 0; text-align: center;",
|
|
191
|
+
"above": "bottom: 91vh; left: 0; right: 0; text-align: center;",
|
|
192
|
+
"left": "bottom: 10vh; height: 80vh; left: 0;",
|
|
193
|
+
"right": "bottom: 10vh; height: 80vh; right: 0;",
|
|
194
|
+
"across": "bottom: 10vh; height: 80vh; left: 0; right: 0;",
|
|
195
|
+
}
|
|
196
|
+
_SCREEN_POS = {
|
|
197
|
+
"screen-top": "top: 0; left: 0; right: 0; text-align: center;",
|
|
198
|
+
"screen-bottom": "bottom: var(--stx-sn-bottom, 0px); left: 0; right: 0; text-align: center;",
|
|
199
|
+
"screen-left": "top: 0; bottom: 0; left: 0;",
|
|
200
|
+
"screen-right": "top: 0; bottom: 0; right: 0;",
|
|
201
|
+
}
|
|
202
|
+
_FLEX = "display: flex; align-items: center; justify-content: center;"
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def _inner(note: SlideNote) -> str:
|
|
206
|
+
style, opacity = note.look
|
|
207
|
+
kind = _kind(note.place)
|
|
208
|
+
extra = ""
|
|
209
|
+
if kind == "vertical":
|
|
210
|
+
extra = " writing-mode: vertical-rl;"
|
|
211
|
+
elif kind == "across":
|
|
212
|
+
extra = " transform: rotate(-30deg);"
|
|
213
|
+
return f'<div class="stx-slide-note" style="{style} opacity: {opacity};{extra}">{_variants(note)}</div>'
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def _positioned(note: SlideNote, pos: str, fixed: bool) -> str:
|
|
217
|
+
"""The note at *pos*; under the content, its link gets a transparent copy above it."""
|
|
218
|
+
box = "position: fixed;" if fixed else "position: absolute;"
|
|
219
|
+
flex = _FLEX if _kind(note.place) in ("vertical", "across") else ""
|
|
220
|
+
inner = _inner(note)
|
|
221
|
+
if note.layer == "over":
|
|
222
|
+
return f'<div class="stx-sn-over" style="{box} {pos} {flex}">{inner}</div>'
|
|
223
|
+
out = f'<div class="stx-sn-under" style="{box} {pos} {flex}">{inner}</div>'
|
|
224
|
+
if note.link:
|
|
225
|
+
out += f'<div class="stx-sn-click" style="{box} {pos} {flex}">{inner}</div>'
|
|
226
|
+
return out
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def slide_notes_html(foot: bool) -> str:
|
|
230
|
+
"""The slide notes closing one slide: positioned around its box (*foot*), else as lines that follow
|
|
231
|
+
the content (``box=False``, :func:`st_slide_note`)."""
|
|
232
|
+
notes = [n for n in get_slide_notes() if isinstance(n, SlideNote) and n.place in SLIDE_PLACES]
|
|
233
|
+
if not notes:
|
|
234
|
+
return ""
|
|
235
|
+
if not foot:
|
|
236
|
+
return "".join(_inner(n) for n in notes)
|
|
237
|
+
inside = "".join(_positioned(n, _SLIDE_POS[n.place], fixed=False) for n in notes)
|
|
238
|
+
return ('<div class="stx-slide-note-foot" style="position: relative; height: 0; overflow: visible;">'
|
|
239
|
+
f"{inside}</div>")
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def draw_slide_notes(foot: bool) -> None:
|
|
243
|
+
"""Draw the notes closing a slide: the slide notes, then the functions of ``set_slide_note``."""
|
|
244
|
+
from .export import st_html
|
|
245
|
+
out = slide_notes_html(foot)
|
|
246
|
+
if out:
|
|
247
|
+
st_html(out)
|
|
248
|
+
for n in get_slide_notes():
|
|
249
|
+
if not isinstance(n, SlideNote):
|
|
250
|
+
n()
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def screen_notes_html() -> str:
|
|
254
|
+
"""The notes fixed on the screen (drawn once per page, not per slide)."""
|
|
255
|
+
return "".join(_positioned(n, _SCREEN_POS[n.place], fixed=True) for n in get_slide_notes()
|
|
256
|
+
if isinstance(n, SlideNote) and n.place in SCREEN_PLACES)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def bar_notes_html(place: str) -> str:
|
|
260
|
+
"""The notes of one place of the presentation bar."""
|
|
261
|
+
return "".join(_inner(n) for n in get_slide_notes() if isinstance(n, SlideNote) and n.place == place)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
#: The rules of the notes. The app's root is isolated so that a note under the content stays above
|
|
265
|
+
#: the page's background; a transparent copy of a link stays clickable above the content.
|
|
266
|
+
_CSS = (".stx-sn-under { z-index: -1; pointer-events: none; }"
|
|
267
|
+
".stx-sn-over { z-index: 900; pointer-events: none; }"
|
|
268
|
+
".stx-sn-over a, .stx-sn-click a { pointer-events: auto; }"
|
|
269
|
+
".stx-sn-click { z-index: 900; pointer-events: none; }"
|
|
270
|
+
".stx-sn-click, .stx-sn-click * { color: transparent !important; }"
|
|
271
|
+
".stx-sn-html, .stx-sn-phone { display: none; }")
|
|
272
|
+
_PHONE = ("@media (max-width: 600px) { .stx-sn-app, .stx-sn-html { display: none !important; }"
|
|
273
|
+
" .stx-sn-phone { display: inline !important; } }")
|
|
274
|
+
_APP_CSS = ".stApp { isolation: isolate; }" + _CSS + _PHONE
|
|
275
|
+
_EXPORT_CSS = ("body { isolation: isolate; }" + _CSS
|
|
276
|
+
+ ".stx-sn-app { display: none !important; } .stx-sn-html { display: inline !important; }" + _PHONE)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def st_slide_notes_page() -> None:
|
|
280
|
+
"""Once per page of the app, from ``st_book``: the rules and the notes fixed on the screen. They go
|
|
281
|
+
to the screen only: the export adds its own (:func:`apply_slide_notes`), in every page file."""
|
|
282
|
+
notes = get_slide_notes()
|
|
283
|
+
if not any(isinstance(n, SlideNote) for n in notes):
|
|
284
|
+
return
|
|
285
|
+
css = _APP_CSS
|
|
286
|
+
try:
|
|
287
|
+
from .presentation import get_presentation_config
|
|
288
|
+
cfg = get_presentation_config()
|
|
289
|
+
if cfg is not None and cfg.footer:
|
|
290
|
+
css += f":root {{ --stx-sn-bottom: {cfg.footer_height}; }}"
|
|
291
|
+
except Exception: # noqa: BLE001
|
|
292
|
+
pass
|
|
293
|
+
st.html(f"<style>{css}</style>{screen_notes_html()}")
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
def apply_slide_notes(html: str) -> str:
|
|
297
|
+
"""An exported HTML document with the notes' rules and the notes fixed on the screen, before
|
|
298
|
+
``</body>``: in the tail every page file of a paginated export shares."""
|
|
299
|
+
if not html or not any(isinstance(n, SlideNote) for n in get_slide_notes()):
|
|
300
|
+
return html
|
|
301
|
+
block = f'<style>{_EXPORT_CSS}</style><div class="stx-sn-export">{screen_notes_html()}</div>'
|
|
302
|
+
if "</body>" in html:
|
|
303
|
+
i = html.rfind("</body>")
|
|
304
|
+
return html[:i] + block + html[i:]
|
|
305
|
+
return html + block
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamtex
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.72
|
|
4
4
|
Summary: AI-powered content framework for Streamlit — create presentations, courses, and web-books with Claude or Cursor, no coding required.
|
|
5
5
|
Author-email: Nicolas Guelfi <nicolas.guelfi@laposte.net>
|
|
6
6
|
License-Expression: BUSL-1.1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|