Scheme as a markup language - any experience with Skirbilo/Skribe?

Hi everyone,

I am currently considering using a scheme based static site generator and found out about Skribilo and its accompanying Skribe markup language. It seems quite powerful and interesting.

I’m curious if anyone here has hands-on experience with Skribilo/Skribe.
Any review, tips or some other sort of insight would be really helpful. If you have any examples or resources of sites using it, that would be great as well :slight_smile:

Thanks in advance

2 Likes

Hi, I started to use Skribe recently. I use it via
Haunt — dthompson.
It uses a very small subset of Skribe, and I think it is good enough as a start point.

1 Like

Hey, yeah I saw that Haunt has support for Skribe. So for now you are just using it for your website? Because I saw that it also has a outline syntax which is similar to org, so maybe someone is using it also for note taking and other things :thinking:

Is the source code for your website public?

1 Like

Hi,

I just use it for my website.
You can check it here with source.

https://liberal.codeberg.page/

1 Like

I use skribilo to write a ttrpg.

I think skribilo is quite cool even if a bit rough around the edges.

My goal is to some day be able to generate text and tables from the same data as tools like Character Generators, statistical evalutions etc.

It might be useful as examples for beginners as I am a beginner as well and don’t do anything fancy.
I also found the skribilo code itself to be quite readable.

You can check it out here:
Its under a CC license and the intention is to be a “free as in freedom” project as a ttrpg.

2 Likes

Nice. I invested some time yesterday to get started with Skribe in Haunt. It is working for now but as you said, it is only using a small subset so I probably have to expand the reader

1 Like

I have no idea how a ttrpg works but it looks cool :+1: And the code is indeed easy to read (at least in the files I checked out).

I also wanted to test the general idea of generating text based on some “raw” data

1 Like

Skriblio is kinda cool, have been looking more into GitHub - gfngfn/SATySFi: A statically-typed, functional typesetting system territory lately, it’s more influenced by OCAml than by scheme though.

As far as I understand generating text based on data or programming logic is one of the key design goals of skribilo, they call it “Document Programming”.

table-top role playing games (ttrpg) are a good usecase for this.
Books for these games combine prose, often quite similar to a fantasy novel, with descriptions of game mechanics.
Game mechanics are in a very formal language often containing many numbers which come from considerations of game design and balancing.

Being able to lets say change “the basic health value of a creature” and this is automatically put into the text and evaluated in calculated contexts like “The life drain spell of an evil wizard does damage equal to half the basic health value” is cool.

1 Like

I was recommended to take a look to evaluate as a potential Lispy markup format. I wasn’t super attracted.

Whenever someone makes a markup syntax that is very consistent with Lisp reading, but with reversed literals and code escapes, I’ll be all-in.

IMO org markup was haphazardly constructed and that is the root of every single one of its irritations.

I’d trade org for a lisp-like org mode that more closely tracks lisp read syntax in a heartbeat.

Does skribilo do what you want?

It is implemented as a custom reader.
formatting is done with scheme code.

If you want to execute code inside the text you escape the code:

[this is a text block ,(my-fancy-scheme-function) here the text continues]

I like it more. I would want to see metadata attachment to get serious. We kind of have two things in org, templating and metadata.

The metadata is the more valuable case I think. That’s how we specify all our export settings, attach data to headings for manipulation by applications etc.

We use noweb for templating in Org, and I hate it. Not sure if templating with Lisp would make templating more useful to the point that it acquires more use cases, but I like the unquote idea.

A perfect fusion of markdown and JSON but in Lisp would be my dream.

1 Like

“Templating” can be done by writing a number of special functions for your specific template. Let’s say you want a template for ACM research papers. You would write functions like “article”, “abstract”, “review”, … to insert special latex/html.

(article 
 (abstract [i am an abstract])
 (p [i am a paragraph]) ;; inherited from base skribe
)

Essentially you create your own domain specific mini language. The entire syntax can be changed.

“Metadata” is added with keywords.

(article
 :title "Important Paper"
 :organization "Systemcrafters"
 (abstract [i am an abstract])
 (p [i am a paragraph])
)

At least that is my current understanding :slight_smile:

1 Like

Small update:
Next to Skribe for Guile Scheme there is also Scribble: The Racket Documentation Tool, which seems to have a more extensive documentation + ecosystem (and a general focus on creating domain specific languages).

But so far I really like Skribe :slight_smile:

I know nothing about Org.

Can you give a short example of a use of metdata in it?
Then I can try to see how that would maybe be done in skribilio

Org attaches metadata to structural elements such as headings:

* A Heading
:PROPERTIES:
:FOO: value
:BAR: so-valuable
:END:
Regular conent again

#attr_html: width 40%
[[images/some-diagram.png]]

#keyword: value of a keyword element

:DRAWER:
some
raw
data
:END:

#+begin_src: elisp :parameter value :param-two another-value
(message "so block parameters are lisp-like, but nothing else?")
#+end_src

This is likely not all of them.

The properties drawer and affiliated keyword (#+attr_html) are the main ones. We typically do not export that content directly but instead treat it as embedded data that may specify how something is exported. We may also use it to implement the data storage for some stateful application built on top of the org format.

It should be apparent that this is very not lisp-like syntax and that there are many (to many) ways to attach metadata. Org is not lisp like. Org is not even org like. It’s kind of just a pile of things that people borrowed from other markups.

1 Like

That’s an awesome use case!

1 Like

I started an experiment (currently on hold) to rewrite the Guile course materials in Skribilo/Skribe and see a lot of promise in it, though I dunno how comfortable it would be to write compared to Org Mode.

It is very nice to be able to write your own procedures to reduce repeated patterns, though. You can basically make your own special-purpose document markup language that you write asScheme.