Skip to content

Big-Dao/shinystatic

Repository files navigation

shinystatic

CI Coverage Mypy

Convert Shiny Express .qmd documents to:

  • Static .qmd — render with Quarto + Typst for professional PDF output
  • Standalone Express app — debug interactively with shiny run

Install

pip install shinystatic
# or
uv add shinystatic

Quick Start

# 1. Write Typst templates
shinystatic --init

# 2. Interactive debugging
shinystatic doc.qmd --mode express
shiny run doc_express.py

# 3. Generate PDF
shinystatic doc.qmd --mode static --render

Source Conventions

Label Prefix Purpose
setup Imports & matplotlib config
params-* DEFAULTS dict (parameter definitions)
model-* @reactive.calc model function
ui-* Shiny sidebar / UI widgets (removed in PDF)
text-* @render.ui body text → {python} inline
fig-* @render.plot figures → plt.show()
tbl-* @render.data_frame tables
export-* Export/download buttons (removed in PDF)

Example

See examples/feasibility/ — a heavy/medium truck supercharger station feasibility analysis.

cd examples/feasibility
uv pip install --python ../../.venv/bin/python pyyaml jupyter numpy pandas matplotlib
PATH=../../.venv/bin:$PATH quarto check jupyter
shinystatic feasibility.qmd --mode static --render

If Quarto reports No module named 'yaml' or Jupyter is not available, it is using a Python interpreter without required runtime packages. Run Quarto with the same virtual environment used by this project (as shown above with PATH=../../.venv/bin:$PATH).

License

MIT

About

Convert Shiny Express .qmd to static Typst documents or standalone Express apps

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages