Skip to content

trashhalo/astro-command

Repository files navigation

Astro Command

Astro component for static rendering of commands. This allows you build components in any language.

Demo

Usage

---
import { Command } from "astro-command";
---
<Command caller={import.meta.url} command="Component.py" message="from python!" />

Component.py

#!/usr/bin/env python 

import sys, json

data = json.load(sys.stdin)
print(f'<h1> Hello {data["message"]} </h1>')
  • caller: url of the caller so we can use it to look up relative paths
  • command: name of the command to execute. relative path from the caller
  • props: all props are passed to command as json via stdin
  • html: generated html sent out via stdout embedded

About

run commands as astro components

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published