A block-based content framework for Streamlit — styled pages, CSS Grid, diagrams, LaTeX, and more.
Project description
StreamTeX
A block-based content framework for Streamlit — build styled, structured web books with Python.
StreamTeX provides a modular "block" architecture on top of Streamlit, letting you compose rich styled pages with CSS Grid layouts, inline mixed-style text, diagrams, LaTeX, bibliography, navigation, and more — all without writing raw HTML or CSS.
Installation
pip install streamtex
Optional: enable the live code inspector sidebar:
pip install streamtex[inspector]
Quick Start
import streamlit as st
import streamtex as sx
from streamtex.styles.core import Style
st.set_page_config(page_title="My Book", layout="wide")
style = Style("color: navy; font-size: 1.2em;", "my-style")
sx.st_write(style, "Hello StreamTeX!")
Run it:
streamlit run app.py
Features
- Styled text —
st_writewith tuple support for inline mixed-style text - CSS Grid layouts —
st_gridwith responsive columns - Block containers —
st_block/st_spancontext managers - Lists —
st_listwith ul/ol, custom bullets, centered alignment - Images —
st_imagewith base64 encoding and MIME detection - Code blocks —
st_codewith Pygments syntax highlighting - Diagrams — Mermaid, PlantUML, TikZ with pan/zoom
- LaTeX — math formulas and full documents
- Bibliography — BibTeX/RIS/CSL-JSON import, citations, formatted references
- Book orchestration —
st_bookwith paginated and continuous modes - Table of Contents — auto-numbering and anchor navigation
- Navigation markers — slide-like PageUp/PageDown navigation
- Collections — multi-project hubs with TOML configuration
- HTML export — self-contained dual-rendering pipeline
- Style composition —
Styleobjects with+/-operators - Zoom controls — CSS-based width and zoom adjustments
- Block inspector — live code editor in sidebar (optional)
- Block helpers — DI-injectable helpers with 3 usage modes
Documentation
Online manuals (read & explore)
Examples (source code)
The manuals are also available as source code — clone and run them locally to study the examples:
git clone https://github.com/nicolasguelfi/streamtex-manuals
cd streamtex-manuals
uv sync
uv run streamlit run stx_manual_intro/book.py
See streamtex-manuals for the full list of example projects.
Reference
Project Structure
A StreamTeX project follows this layout:
my-project/
├── .streamlit/
│ └── config.toml # enableStaticServing = true
├── blocks/
│ ├── __init__.py # Block registry
│ └── bck_intro.py # Your blocks (build() function each)
├── static/
│ └── images/ # Static assets
├── custom/
│ └── styles.py # Project-specific styles
└── book.py # Entry point with st_book()
Requirements
- Python >= 3.10
- Streamlit >= 1.54.0
License
MIT — Copyright (c) 2026 Nicolas Guelfi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamtex-0.3.0.tar.gz.
File metadata
- Download URL: streamtex-0.3.0.tar.gz
- Upload date:
- Size: 139.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9bdd1600292d360f20a636706060a5007580e528ccc427b6b59a0f4c3ae3b1d
|
|
| MD5 |
b4af525decd14e5f7f5647e9b1fdbacd
|
|
| BLAKE2b-256 |
e205d1b1f8761e65105858ea8cdbd01dce46edfa50f5b9c0fccb2227fb023298
|
Provenance
The following attestation bundles were made for streamtex-0.3.0.tar.gz:
Publisher:
publish.yml on nicolasguelfi/streamtex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamtex-0.3.0.tar.gz -
Subject digest:
e9bdd1600292d360f20a636706060a5007580e528ccc427b6b59a0f4c3ae3b1d - Sigstore transparency entry: 1009612044
- Sigstore integration time:
-
Permalink:
nicolasguelfi/streamtex@958e42d7c48be74004156ee6beb61e48d912f7c3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nicolasguelfi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@958e42d7c48be74004156ee6beb61e48d912f7c3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file streamtex-0.3.0-py3-none-any.whl.
File metadata
- Download URL: streamtex-0.3.0-py3-none-any.whl
- Upload date:
- Size: 159.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2acb915067cf623ab3c77cb5344d18d91b5840202aad0834eaabedb2b37408
|
|
| MD5 |
8c453e8e55356b6757290164afceec84
|
|
| BLAKE2b-256 |
86201be88e43bbdd0187c60c905afdb52789aeafff3c8a0f439d033afb678d03
|
Provenance
The following attestation bundles were made for streamtex-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on nicolasguelfi/streamtex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamtex-0.3.0-py3-none-any.whl -
Subject digest:
db2acb915067cf623ab3c77cb5344d18d91b5840202aad0834eaabedb2b37408 - Sigstore transparency entry: 1009612045
- Sigstore integration time:
-
Permalink:
nicolasguelfi/streamtex@958e42d7c48be74004156ee6beb61e48d912f7c3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/nicolasguelfi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@958e42d7c48be74004156ee6beb61e48d912f7c3 -
Trigger Event:
release
-
Statement type: