Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/terminal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
23 lines
525 B
Plaintext
23 lines
525 B
Plaintext
package main
|
|
|
|
import "strconv"
|
|
|
|
func figCaptionText(n uint64, caption string) string {
|
|
base := "[fig." + strconv.FormatUint(n, 10)
|
|
if caption == "" {
|
|
return base + "]"
|
|
}
|
|
return base + " " + caption + "]"
|
|
}
|
|
|
|
templ terminalImageComponent(src, alt, caption string, n uint64) {
|
|
<figure class="ascii-frame">
|
|
if src != "" {
|
|
<img src={ src } alt={ alt }/>
|
|
} else {
|
|
<div class="terminal-mono" style="padding: 1rem;">{ "[ no image ]" }</div>
|
|
}
|
|
<figcaption>{ figCaptionText(n, caption) }</figcaption>
|
|
</figure>
|
|
}
|