Next: , Up: API  


1.1 (hygguile abstraction)

1.1.1 Procedures

Procedure: get-short-commit-sha KEY: #:cmd

Retrieve the short Git commit SHA or execute a custom version control command.

cmd

The shell command string to execute, defaulting to the command that fetches the 7-character short commit hash.

(get-short-commit-sha)
Procedure: mk-class xs

Return a sorted, space-separated string of unique class names from xs.

Takes a list of symbols xs, removes any duplicates, converts them to strings, sorts them alphabetically, and returns them as a single, space-separated string. This is useful for creating a canonical CSS class attribute value.

If xs is the empty list, an empty string is returned.

xs

A list of symbols.

(mk-class '(p-2 bg-stone-900/75))
Procedure: mk-style pairs

Convert an association list of properties and values into a CSS inline style string.

pairs

An association list or list of pairs where each element’s car is the CSS property name and its cdr is the value.

(mk-style '((background-color . "red") (color . "blue")))
Procedure: pretty-quote str

Transform explicit S-expression (quote symbol) fragments within a string into shorthand syntax.

str

The target input string containing raw code snippets or text representations.

(pretty-quote "This is a (quote example) line.")
Procedure: render-if-nempty render-func item

Apply render-func to item if item is neither empty nor false.

Returns an empty list if item evaluates to null or false.

render-func

A single-argument procedure to evaluate the layout with item.

item

The data element or fragment list to inspect.

(render-if-nempty (lambda (i) `(b ,i)) "Bold Text")
Procedure: render-if-nestring expr x

Evaluate and return the result of expr with x if x is a non-empty string.

If x is false or an empty string, returns an empty list.

expr

A single-argument procedure to apply to x.

x

The string value or condition to check.

(render-if-nestring (lambda (val) `((p ,val))) "Hello")
Procedure: syscall cmd

Execute a shell command synchronous process and capture its complete standard output.

cmd

A string designating the system command execution pipeline.

(syscall "uname -a")

Next: (hygguile components button), Up: API