Output Formats

This document demonstrates quarto-term rendering to multiple output formats from the same source.

Download this document in other formats: PDF EPUB Markdown

Basic output

echo "Hello from quarto-term"
Hello from quarto-term

State persistence

Variables carry over between cells:

export NAME="world"
echo "Hello, $NAME"
Hello, world

Multi-line commands

for i in 1 2 3 4 5; do
  echo "Item $i"
done
Item 1
Item 2
Item 3
Item 4
Item 5

ANSI colors

Full color support across all formats:

printf '\033[31mred\033[0m \033[32mgreen\033[0m \033[34mblue\033[0m \033[33mye
llow\033[0m\n'
red green blue yellow
for i ({0..15}) { print -nP "%K{$i} ${(l:2:)i} %k"; ((i%8==7))&&print }
  0   1   2   3   4   5   6   7 
  8   9  10  11  12  13  14  15 

Working with files

cat <<'EOF' > /tmp/demo.txt
name,value
alpha,1
beta,2
gamma,3
EOF

cat /tmp/demo.txt
name,value
alpha,1
beta,2
gamma,3

Piping

seq 1 10 | paste -sd+ | bc
55

Interactive commands

sleep 100
^C

echo 'Back to the prompt!'
Back to the prompt!

Per-cell styling

echo "This cell uses a different colorscheme"
This cell uses a different colorscheme