Skip to main content

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 textst_write with tuple support for inline mixed-style text
  • CSS Grid layoutsst_grid with responsive columns
  • Block containersst_block / st_span context managers
  • Listsst_list with ul/ol, custom bullets, centered alignment
  • Imagesst_image with base64 encoding and MIME detection
  • Code blocksst_code with 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 orchestrationst_book with 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 compositionStyle objects 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

This version

0.3.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamtex-0.3.0.tar.gz (139.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamtex-0.3.0-py3-none-any.whl (159.7 kB view details)

Uploaded Python 3

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

Hashes for streamtex-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e9bdd1600292d360f20a636706060a5007580e528ccc427b6b59a0f4c3ae3b1d
MD5 b4af525decd14e5f7f5647e9b1fdbacd
BLAKE2b-256 e205d1b1f8761e65105858ea8cdbd01dce46edfa50f5b9c0fccb2227fb023298

See more details on using hashes here.

Provenance

The following attestation bundles were made for streamtex-0.3.0.tar.gz:

Publisher: publish.yml on nicolasguelfi/streamtex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for streamtex-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db2acb915067cf623ab3c77cb5344d18d91b5840202aad0834eaabedb2b37408
MD5 8c453e8e55356b6757290164afceec84
BLAKE2b-256 86201be88e43bbdd0187c60c905afdb52789aeafff3c8a0f439d033afb678d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for streamtex-0.3.0-py3-none-any.whl:

Publisher: publish.yml on nicolasguelfi/streamtex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page