[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Announcing Guile Blocks 0.1
From: |
Richard Sent |
Subject: |
Announcing Guile Blocks 0.1 |
Date: |
Thu, 01 Aug 2024 17:09:32 -0400 |
Hi Guilers!
Over the past few months I've been working on a Guile package I call
Guile Blocks, an Org Mode inspired implementation of source blocks in
Guile Scheme! (My creativity is boundless.)
Here's the repository: https://git.sr.ht/~freakingpenguin/guile-blocks
Guile Blocks allows for creating, running, composing, highlighting, and
printing source code blocks to various output formats. (At present, SXML
and plaintext.) Here's a simple example:
--8<---------------cut here---------------start------------->8---
(block->sxml (make-block*
#:code "print 42"
#:language ruby
#:run? #t))
;; => (div (@ (class "code-block"))
;; (pre (code "print 42"))
;; (pre "Results:\n" (code "42)))
--8<---------------cut here---------------end--------------->8---
I have two posts demonstrating Guile Blocks on my website that showcase
the results of more advanced usage.
https://freakingpenguin.com/blog/guile-blocks-proof-of-concept.html
https://freakingpenguin.com/blog/guile-blocks-fleshing-out-the-concept.html
Documentation is currently provided in the project README.
I find that Guile Blocks integrates well with David Thompson's excellent
static site generator, Haunt. I also utilize his guile-syntax-highlight
package for, well, syntax highlighting. Thanks for both!
At present the following languages are supported in some form:
c, css, elisp, elixir, gnuplot, guile, latex (via latexml), python,
and ruby
For those familiar with Sourcehut I created a project hub at
https://sr.ht/~freakingpenguin/guile-blocks/. You can find a mailing
list and bug tracker there. Feel free to respond directly to this email
if you prefer! :)
This package is provided as a Guix channel. If you want to experiment
with it using Guix you can do so with the following channels.scm file:
--8<---------------cut here---------------start------------->8---
;; $ guix time-machine -C channels.scm -- shell -C guile guile-blocks
(cons*
(channel
(name 'guile-blocks)
(url "https://git.sr.ht/~freakingpenguin/guile-blocks")
(introduction
(make-channel-introduction
"3e0e66504120bce507d3151c9b5319cdcce139d6"
(openpgp-fingerprint
"0BC0 5236 B0DA D691 2F6E 1993 A2D2 1FA4 2A90 8978"))))
%default-channels)
--8<---------------cut here---------------end--------------->8---
My hope is to get feedback on the existing API and workflow so that I
can iterate on it in preparation for a 1.0 release. I'm rather proud of
the code in blocks.scm (creation, composition, and execution) but feel
like the logic and API for printing blocks needs some cleanup.
Fair warning, I'll likely be pretty spartan with API stability before
1.0 is released. :)
Thanks!
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
- Announcing Guile Blocks 0.1,
Richard Sent <=