Colight Site
Static site generator for Colight visualizations.
Converts .py files into markdown/HTML documents where:
- Comments become narrative markdown
- Code blocks are executed to generate Colight visualizations
- Output is embedded as interactive
.colight files
Usage
colight-prose build src/post.py --output build/post.md
colight-prose watch src/ --output build/
colight-prose init my-blog/
File Format
.py files mix comments (markdown) with executable Python code:
import numpy as np
x = np.linspace(0, 10, 100)
np.sin(x)
Pragma Directives
Control the output format and visibility of content using pragma comments:
File-level pragmas
Begin with hide-all-, at the beginning of the file:
Form-level pragmas
Place directly before a code block:
x = np.array([1, 2, 3])
Available pragmas
hide-code / show-code - Hide or show code blocks
hide-statements / show-statements - Hide or show Python statements (imports, assignments)
hide-visuals / show-visuals - Hide or show results/visuals
hide-prose / show-prose - Hide or show markdown prose (comments)
format-html - Output in HTML format
format-markdown - Output in Markdown format
Pragma formats
Precedence
- Form-level pragmas (highest priority)
- CLI options
- File-level pragmas
- Defaults (lowest priority)
show-* pragmas always override corresponding hide-* pragmas.