streamtex 0.7.72__tar.gz → 0.7.73__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.
Files changed (193) hide show
  1. {streamtex-0.7.72/streamtex.egg-info → streamtex-0.7.73}/PKG-INFO +1 -1
  2. {streamtex-0.7.72 → streamtex-0.7.73}/pyproject.toml +1 -1
  3. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/book.py +15 -3
  4. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/deploy/stx_auth.py +1 -1
  5. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/slide_note.py +52 -15
  6. {streamtex-0.7.72 → streamtex-0.7.73/streamtex.egg-info}/PKG-INFO +1 -1
  7. {streamtex-0.7.72 → streamtex-0.7.73}/LICENSE +0 -0
  8. {streamtex-0.7.72 → streamtex-0.7.73}/MANIFEST.in +0 -0
  9. {streamtex-0.7.72 → streamtex-0.7.73}/README.md +0 -0
  10. {streamtex-0.7.72 → streamtex-0.7.73}/setup.cfg +0 -0
  11. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/__init__.py +0 -0
  12. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/__main__.py +0 -0
  13. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/__init__.py +0 -0
  14. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/config.py +0 -0
  15. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/generate.py +0 -0
  16. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/history.py +0 -0
  17. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/metadata.py +0 -0
  18. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/__init__.py +0 -0
  19. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/base.py +0 -0
  20. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/fal.py +0 -0
  21. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/google.py +0 -0
  22. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/openai.py +0 -0
  23. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/ai/providers/registry.py +0 -0
  24. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/auth.py +0 -0
  25. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/banner.py +0 -0
  26. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/bib.py +0 -0
  27. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/bib_preview.py +0 -0
  28. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/block_helpers.py +0 -0
  29. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/blocks.py +0 -0
  30. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/browser.py +0 -0
  31. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/__init__.py +0 -0
  32. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_claude_files.py +0 -0
  33. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_divergence.py +0 -0
  34. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_install_local_packs.py +0 -0
  35. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_shared.py +0 -0
  36. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_stx_toml.py +0 -0
  37. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/_toml_helpers.py +0 -0
  38. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/artifact_cmd.py +0 -0
  39. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/bib_cmd.py +0 -0
  40. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/build_check.py +0 -0
  41. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/cache_cmd.py +0 -0
  42. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/claude_cmd.py +0 -0
  43. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/claude_global.py +0 -0
  44. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/claude_project.py +0 -0
  45. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/commands.py +0 -0
  46. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/component_cmd.py +0 -0
  47. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/console.py +0 -0
  48. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/coolify.py +0 -0
  49. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/deploy_auth_cmd.py +0 -0
  50. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/deploy_cmd.py +0 -0
  51. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/dev_cmd.py +0 -0
  52. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/dev_config.py +0 -0
  53. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/ds_cmd.py +0 -0
  54. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/export_cmd.py +0 -0
  55. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/install_cmd.py +0 -0
  56. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/kit_cmd.py +0 -0
  57. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/main.py +0 -0
  58. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/__init__.py +0 -0
  59. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/base.py +0 -0
  60. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/compat.py +0 -0
  61. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/registry.py +0 -0
  62. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/v0_4_0.py +0 -0
  63. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/migrations/v0_4_6.py +0 -0
  64. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/pack_cmd.py +0 -0
  65. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/project_cmd.py +0 -0
  66. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/project_rules.py +0 -0
  67. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/publish_cmd.py +0 -0
  68. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/published_check.py +0 -0
  69. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/release_cmd.py +0 -0
  70. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/run_cmd.py +0 -0
  71. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/run_set.py +0 -0
  72. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/screenshot_cmd.py +0 -0
  73. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/shortcuts.py +0 -0
  74. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/status_cmd.py +0 -0
  75. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/sync_cmd.py +0 -0
  76. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/upgrade_cmd.py +0 -0
  77. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/validate_cmd.py +0 -0
  78. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/cli/workspace_cmd.py +0 -0
  79. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/code.py +0 -0
  80. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/collection.py +0 -0
  81. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/constants.py +0 -0
  82. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/container.py +0 -0
  83. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/__init__.py +0 -0
  84. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/__init__.py +0 -0
  85. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/_frontmatter.py +0 -0
  86. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/agent.py +0 -0
  87. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/ai_prompt.py +0 -0
  88. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/archetype.py +0 -0
  89. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/asset.py +0 -0
  90. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/discovery.py +0 -0
  91. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/guideline.py +0 -0
  92. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/install.py +0 -0
  93. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/integration.py +0 -0
  94. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/loaders.py +0 -0
  95. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/palette.py +0 -0
  96. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/skill.py +0 -0
  97. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/spec.py +0 -0
  98. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/artifacts/validation.py +0 -0
  99. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/contracts.py +0 -0
  100. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/discovery.py +0 -0
  101. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/core/validation.py +0 -0
  102. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/countdown.py +0 -0
  103. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/deeplink.py +0 -0
  104. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/deploy/__init__.py +0 -0
  105. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/enums.py +0 -0
  106. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/export.py +0 -0
  107. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/export_enrich.py +0 -0
  108. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/export_paginate.py +0 -0
  109. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/export_widgets.py +0 -0
  110. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/facts.py +0 -0
  111. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/grid.py +0 -0
  112. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/gsheet.py +0 -0
  113. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/hover_tooltip.py +0 -0
  114. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/i18n.py +0 -0
  115. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/image.py +0 -0
  116. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/image_crop.py +0 -0
  117. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/image_editor.py +0 -0
  118. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/image_utils.py +0 -0
  119. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/inspector.py +0 -0
  120. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/kept.py +0 -0
  121. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/latex.py +0 -0
  122. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/latex_utils.py +0 -0
  123. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/link_config.py +0 -0
  124. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/link_preview.py +0 -0
  125. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/list.py +0 -0
  126. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/loading.py +0 -0
  127. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/markdown.py +0 -0
  128. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/marker.py +0 -0
  129. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/marker_runtime.py +0 -0
  130. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/media_overlay.py +0 -0
  131. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/mermaid.py +0 -0
  132. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/overlay.py +0 -0
  133. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/pagewalk.py +0 -0
  134. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/pdf_export.py +0 -0
  135. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/plantuml.py +0 -0
  136. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/presentation.py +0 -0
  137. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/presentation_profile.py +0 -0
  138. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/printing.py +0 -0
  139. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/__init__.py +0 -0
  140. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/build.py +0 -0
  141. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/config.py +0 -0
  142. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/coolify.py +0 -0
  143. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/levels.py +0 -0
  144. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/ops.py +0 -0
  145. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/passwords.py +0 -0
  146. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/state.py +0 -0
  147. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/target.py +0 -0
  148. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/live/Dockerfile +0 -0
  149. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/live/entrypoint.sh +0 -0
  150. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/live/nginx.conf +0 -0
  151. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/live/stx-http.conf +0 -0
  152. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/live/supervisord.conf +0 -0
  153. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/10-stx-init.sh +0 -0
  154. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/20-stx-auth.sh +0 -0
  155. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/Dockerfile +0 -0
  156. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/closed.html +0 -0
  157. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/nginx.conf +0 -0
  158. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/stx-http.conf +0 -0
  159. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/release/templates/static/stx_auth.py +0 -0
  160. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/runtime_flags.py +0 -0
  161. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/scripts/__init__.py +0 -0
  162. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/scripts/migrate_curves_to_relative.py +0 -0
  163. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/search.py +0 -0
  164. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/slide.py +0 -0
  165. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/space.py +0 -0
  166. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/spacing.py +0 -0
  167. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/css/stx_global.css +0 -0
  168. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/default.css +0 -0
  169. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/js/stx_countdown.js +0 -0
  170. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/js/stx_marker_observer.js +0 -0
  171. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/js/stx_scroll_spy.js +0 -0
  172. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/js/stx_video.js +0 -0
  173. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/logo-stx-tiny.png +0 -0
  174. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/static/logo-stx.png +0 -0
  175. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/__init__.py +0 -0
  176. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/base.py +0 -0
  177. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/container.py +0 -0
  178. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/core.py +0 -0
  179. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/scale.py +0 -0
  180. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/scale_curves.toml +0 -0
  181. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/text.py +0 -0
  182. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/styles/visibility.py +0 -0
  183. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/tikz.py +0 -0
  184. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/toc.py +0 -0
  185. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/utils.py +0 -0
  186. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/watch.py +0 -0
  187. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/write.py +0 -0
  188. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex/zoom.py +0 -0
  189. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex.egg-info/SOURCES.txt +0 -0
  190. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex.egg-info/dependency_links.txt +0 -0
  191. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex.egg-info/entry_points.txt +0 -0
  192. {streamtex-0.7.72 → streamtex-0.7.73}/streamtex.egg-info/requires.txt +0 -0
  193. {streamtex-0.7.72 → streamtex-0.7.73}/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.72
3
+ Version: 0.7.73
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.72"
7
+ version = "0.7.73"
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"
@@ -325,6 +325,13 @@ def _offer_export_downloads(html: str, base_name: str,
325
325
  # ── Content (applies to both formats) ────────────────
326
326
  st.markdown("**Content**")
327
327
 
328
+ # Slide notes left to the reader (note5): one box, ticked by default
329
+ from .slide_note import has_choice
330
+ want_notes = True
331
+ if has_choice():
332
+ want_notes = st.checkbox("Slide notes (watermark…)", value=True,
333
+ key=f"_stx_want_notes_{_pk}")
334
+
328
335
  # Scope (paginated view only)
329
336
  export_scope = "Full document"
330
337
  if paginated:
@@ -542,7 +549,8 @@ def _offer_export_downloads(html: str, base_name: str,
542
549
 
543
550
  html_download = apply_html_print_rule(html_download, rules) # #107
544
551
  from .slide_note import apply_slide_notes
545
- html_download = apply_slide_notes(html_download) # note3
552
+ html_download = apply_slide_notes(html_download, download=True, # note3, note5
553
+ chosen=want_notes)
546
554
  collector = get_asset_collector()
547
555
  # Served media (configure_image_path) must survive off the
548
556
  # server: materialise them into the collector / as data
@@ -586,7 +594,10 @@ def _offer_export_downloads(html: str, base_name: str,
586
594
  )
587
595
  _toc = st.session_state.get(_STX_CACHE_KEY, {}).get("toc")
588
596
  _report = PdfLoadReport()
589
- results["pdf"] = export_pdf(effective_html, config=cfg, toc=_toc,
597
+ from .slide_note import apply_slide_notes
598
+ _pdf_html = apply_slide_notes(effective_html, pdf=True, download=True,
599
+ chosen=want_notes) # note5
600
+ results["pdf"] = export_pdf(_pdf_html, config=cfg, toc=_toc,
590
601
  report=_report)
591
602
  if _report.timed_out: # shown with the download button
592
603
  results["pdf_warning"] = _report.message(cfg.load_timeout_ms)
@@ -660,7 +671,8 @@ def _run_auto_exports(
660
671
  if not pdf_cfg.base_url:
661
672
  pdf_cfg.base_url = _resolve_pdf_base_url() # issue #44
662
673
  _toc = st.session_state.get(_STX_CACHE_KEY, {}).get("toc")
663
- export_pdf(html, output_path=path, config=pdf_cfg, toc=_toc)
674
+ from .slide_note import apply_slide_notes
675
+ export_pdf(apply_slide_notes(html, pdf=True), output_path=path, config=pdf_cfg, toc=_toc)
664
676
  else:
665
677
  from pathlib import Path as _P
666
678
  collector = get_asset_collector()
@@ -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.72"
110
+ STX_VERSION = "0.7.73"
111
111
  AUTH_INTERFACE = 3
112
112
 
113
113
  DEFAULT_ROOT = "/var/lib/stx-auth"
@@ -20,9 +20,13 @@ Each note has
20
20
  ``bar-title``, ``bar-before-counter``;
21
21
  - a **text per display mode**: a text, a leaf ``{"en": …, "fr": …}``, or a dict of modes —
22
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``;
23
+ ``phone`` (a screen under 600 px), ``pdf``, ``default`` — whose values are texts, leaves, or
24
+ ``None`` (no note in that mode); a missing mode takes ``default`` (``pdf``: ``html``, then
25
+ ``default``). A ``\n`` in a text starts a new line;
25
26
  - an **opacity** and a **style**, with defaults by place;
27
+ - **downloads** (board ``note5``): whether the note goes into a file downloaded from the app
28
+ ("Download as…", HTML and PDF) — ``always`` (default), ``never``, or ``choice`` (a box in the
29
+ panel, ticked by default). The published HTML always carries it;
26
30
  - a **layer**: ``under`` (default) draws the note beneath the content, so that a text of the slide
27
31
  placed over it hides it (NG, board ``note3``); ``over`` draws it above. Under the content a
28
32
  link stays clickable through a transparent copy of the link above it.
@@ -46,8 +50,9 @@ SLIDE_PLACES = ("below", "above", "left", "right", "across")
46
50
  SCREEN_PLACES = ("screen-top", "screen-bottom", "screen-left", "screen-right")
47
51
  BAR_PLACES = ("bar-after-title", "bar-title", "bar-before-counter")
48
52
  PLACES = SLIDE_PLACES + SCREEN_PLACES + BAR_PLACES
49
- MODES = ("slides", "document", "html", "phone", "default")
53
+ MODES = ("slides", "document", "html", "phone", "pdf", "default")
50
54
  LAYERS = ("under", "over")
55
+ DOWNLOADS = ("always", "never", "choice")
51
56
 
52
57
  #: The look of ``set_slide_note`` (0.7.70): a small grey line, centred.
53
58
  SLIDE_NOTE_STYLE = Style("font-size: 0.75rem; color: #888; text-align: center; line-height: 1.3;",
@@ -85,12 +90,15 @@ class SlideNote:
85
90
  opacity: Optional[float] = None
86
91
  style: Optional[Style] = None
87
92
  layer: str = "under"
93
+ downloads: str = "always"
88
94
 
89
95
  def __post_init__(self):
90
96
  if self.place not in PLACES:
91
97
  raise ValueError(f"SlideNote: place={self.place!r} — one of {', '.join(PLACES)}")
92
98
  if self.layer not in LAYERS:
93
99
  raise ValueError(f"SlideNote: layer={self.layer!r} — 'under' or 'over'")
100
+ if self.downloads not in DOWNLOADS:
101
+ raise ValueError(f"SlideNote: downloads={self.downloads!r} — 'always', 'never' or 'choice'")
94
102
  if self.opacity is not None and not 0 <= self.opacity <= 1:
95
103
  raise ValueError("SlideNote: opacity goes from 0 (invisible) to 1")
96
104
  if not isinstance(self.text, (str, dict)) or not self.text:
@@ -105,6 +113,8 @@ class SlideNote:
105
113
  from .i18n import T
106
114
  value = self.text
107
115
  if _by_mode(value):
116
+ if mode == "pdf" and "pdf" not in value:
117
+ mode = "html" # the PDF is made from the HTML (note5)
108
118
  value = value.get(mode, value.get("default"))
109
119
  return None if value is None else T(value)
110
120
 
@@ -169,12 +179,13 @@ def _app_mode() -> str:
169
179
  def _variants(note: SlideNote) -> str:
170
180
  """The note's text for the app, the HTML and a phone: one span each, CSS shows the right one."""
171
181
  from .deeplink import marker_href
172
- texts = {"app": note.text_for(_app_mode()), "html": note.text_for("html"), "phone": note.text_for("phone")}
182
+ texts = {"app": note.text_for(_app_mode()), "html": note.text_for("html"),
183
+ "phone": note.text_for("phone"), "pdf": note.text_for("pdf")}
173
184
 
174
185
  def one(text):
175
186
  if not text:
176
187
  return ""
177
- t = _html.escape(text)
188
+ t = _html.escape(text).replace("\n", "<br>") # a new line (note5)
178
189
  if note.link:
179
190
  t = (f'<a href="{_html.escape(marker_href(note.link))}" target="_blank" rel="noopener" '
180
191
  f'style="color: inherit; text-decoration: none;">{t}</a>')
@@ -202,6 +213,11 @@ _SCREEN_POS = {
202
213
  _FLEX = "display: flex; align-items: center; justify-content: center;"
203
214
 
204
215
 
216
+ def _tag(note: SlideNote) -> str:
217
+ """The note's number among the session's notes: a download leaves out a note by it (note5)."""
218
+ return f' data-stx-note="{get_slide_notes().index(note)}"'
219
+
220
+
205
221
  def _inner(note: SlideNote) -> str:
206
222
  style, opacity = note.look
207
223
  kind = _kind(note.place)
@@ -210,7 +226,8 @@ def _inner(note: SlideNote) -> str:
210
226
  extra = " writing-mode: vertical-rl;"
211
227
  elif kind == "across":
212
228
  extra = " transform: rotate(-30deg);"
213
- return f'<div class="stx-slide-note" style="{style} opacity: {opacity};{extra}">{_variants(note)}</div>'
229
+ return (f'<div class="stx-slide-note"{_tag(note)} style="{style} opacity: {opacity};{extra}">'
230
+ f"{_variants(note)}</div>")
214
231
 
215
232
 
216
233
  def _positioned(note: SlideNote, pos: str, fixed: bool) -> str:
@@ -218,11 +235,12 @@ def _positioned(note: SlideNote, pos: str, fixed: bool) -> str:
218
235
  box = "position: fixed;" if fixed else "position: absolute;"
219
236
  flex = _FLEX if _kind(note.place) in ("vertical", "across") else ""
220
237
  inner = _inner(note)
238
+ tag = _tag(note)
221
239
  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>'
240
+ return f'<div class="stx-sn-over"{tag} style="{box} {pos} {flex}">{inner}</div>'
241
+ out = f'<div class="stx-sn-under"{tag} style="{box} {pos} {flex}">{inner}</div>'
224
242
  if note.link:
225
- out += f'<div class="stx-sn-click" style="{box} {pos} {flex}">{inner}</div>'
243
+ out += f'<div class="stx-sn-click"{tag} style="{box} {pos} {flex}">{inner}</div>'
226
244
  return out
227
245
 
228
246
 
@@ -268,12 +286,15 @@ _CSS = (".stx-sn-under { z-index: -1; pointer-events: none; }"
268
286
  ".stx-sn-over a, .stx-sn-click a { pointer-events: auto; }"
269
287
  ".stx-sn-click { z-index: 900; pointer-events: none; }"
270
288
  ".stx-sn-click, .stx-sn-click * { color: transparent !important; }"
271
- ".stx-sn-html, .stx-sn-phone { display: none; }")
289
+ ".stx-sn-html, .stx-sn-phone, .stx-sn-pdf { display: none; }")
272
290
  _PHONE = ("@media (max-width: 600px) { .stx-sn-app, .stx-sn-html { display: none !important; }"
273
291
  " .stx-sn-phone { display: inline !important; } }")
274
292
  _APP_CSS = ".stApp { isolation: isolate; }" + _CSS + _PHONE
275
293
  _EXPORT_CSS = ("body { isolation: isolate; }" + _CSS
276
294
  + ".stx-sn-app { display: none !important; } .stx-sn-html { display: inline !important; }" + _PHONE)
295
+ #: A PDF shows the pdf texts, whatever the page's width (note5).
296
+ _PDF_CSS = (_EXPORT_CSS + ".stx-sn-app, .stx-sn-html, .stx-sn-phone { display: none !important; }"
297
+ " .stx-sn-pdf { display: inline !important; }")
277
298
 
278
299
 
279
300
  def st_slide_notes_page() -> None:
@@ -293,12 +314,28 @@ def st_slide_notes_page() -> None:
293
314
  st.html(f"<style>{css}</style>{screen_notes_html()}")
294
315
 
295
316
 
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()):
317
+ def has_choice() -> bool:
318
+ """Whether a note leaves its download to the reader (a box in "Download as…", note5)."""
319
+ return any(isinstance(n, SlideNote) and n.downloads == "choice" for n in get_slide_notes())
320
+
321
+
322
+ def apply_slide_notes(html: str, *, pdf: bool = False, download: bool = False, chosen: bool = True) -> str:
323
+ """An exported document with the notes' rules and the notes fixed on the screen, before
324
+ ``</body>``: in the tail every page file of a paginated export shares.
325
+
326
+ *pdf*: the document a PDF is made from (the pdf texts). *download*: a file downloaded from the
327
+ app ("Download as…", note5) — a note with ``downloads="never"`` is left out, and one with
328
+ ``"choice"`` unless the reader kept the box ticked (*chosen*).
329
+ """
330
+ notes = get_slide_notes()
331
+ if not html or not any(isinstance(n, SlideNote) for n in notes):
300
332
  return html
301
- block = f'<style>{_EXPORT_CSS}</style><div class="stx-sn-export">{screen_notes_html()}</div>'
333
+ css = _PDF_CSS if pdf else _EXPORT_CSS
334
+ if download:
335
+ out = [i for i, n in enumerate(notes) if isinstance(n, SlideNote)
336
+ and (n.downloads == "never" or (n.downloads == "choice" and not chosen))]
337
+ css += "".join(f'[data-stx-note="{i}"] {{ display: none !important; }}' for i in out)
338
+ block = f'<style>{css}</style><div class="stx-sn-export">{screen_notes_html()}</div>'
302
339
  if "</body>" in html:
303
340
  i = html.rfind("</body>")
304
341
  return html[:i] + block + html[i:]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamtex
3
- Version: 0.7.72
3
+ Version: 0.7.73
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