Skip to main content

Static site generator for Colight visualizations

Project description

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

# Build a single file
colight-prose build src/post.py --output build/post.md

# Watch for changes
colight-prose watch src/ --output build/

# Initialize new project
colight-prose init my-blog/

File Format

.py files mix comments (markdown) with executable Python code:

# My Data Visualization
# This creates an interactive plot...

import numpy as np
x = np.linspace(0, 10, 100)

# The sine wave
np.sin(x)  # This expression generates a colight visualization

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:

# | hide-all-code

# Your content here...

Form-level pragmas

Place directly before a code block:

# | show-code
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

# %% hide-code          # Double percent format
# | show-visuals        # Pipe format
#| colight: hide-prose  # Legacy format (still supported)

Precedence

  1. Form-level pragmas (highest priority)
  2. CLI options
  3. File-level pragmas
  4. Defaults (lowest priority)

show-* pragmas always override corresponding hide-* pragmas.

Project details


Download files

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

Source Distribution

colight_prose-2025.7.2.dev202507250239.tar.gz (150.9 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file colight_prose-2025.7.2.dev202507250239.tar.gz.

File metadata

File hashes

Hashes for colight_prose-2025.7.2.dev202507250239.tar.gz
Algorithm Hash digest
SHA256 9f60795cfcc591f27ebd86d15b2c10c203e1087d557ff32c8e10a59d7c970c54
MD5 a047686b19e6ce5bcb4bcefddba88638
BLAKE2b-256 cfb3f7f57c5afeed3f1888fe0cd732a235990fbd18734e568be1d15a26138ac9

See more details on using hashes here.

File details

Details for the file colight_prose-2025.7.2.dev202507250239-py3-none-any.whl.

File metadata

File hashes

Hashes for colight_prose-2025.7.2.dev202507250239-py3-none-any.whl
Algorithm Hash digest
SHA256 330f8aa6a179bf08cd4f9f299882d911c7507503c0a0487aae75bf293cecd878
MD5 5a05b2859e50b28727eddbb4e3f6ce83
BLAKE2b-256 14f17ac635df486980e504cc909723b2a52c2c9fe411d9ae16b5b7886a278b57

See more details on using hashes here.

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