Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Generating a homepage with decker and lilt

A topic by razetime created Nov 24, 2023 Views: 223 Replies: 3
Viewing posts 1 to 3
(2 edits) (+1)

Although decks are pretty versatile and can serve as full webpages themselves, I found myself wanting to link decks from a homepage deck. The result is at https://razetime.github.io/decks/ , and the lil based code is at https://github.com/razetime/decks/blob/main/gen.lil .

I wrote a small writeup about it on my blog for people who don’t know decker or lil too well.

Developer

Nice! This is an excellent demonstration of how Lilt can be used in concert with Decker.

Two minor notes:

  • The shell[] function is very powerful, but as you observe not necessarily portable. Lilt provides a function dir[] which is similar to shell["ls ..."], but should work anywhere. Alternatively, if you use the APE build of Lilt, Cosmopolitan provides its own posix-ey shim for shell[] that works on Windows.
  • The rtext interface has some helper functions for manipulating rich text tables- the rtext.make[] function could slightly simplify building your index.
  • Thanks, didn’t know about dir[]. Will add that to the article soon.
  • I did check rtext but I wasn’t sure how to use it with the text widget, since I was assuming that rtext tables are different from ordinary tables.
Developer

Rtext tables are completely normal table values; they just have a particular structure. Any manner of producing or manipulating a table will work, so long as it includes the appropriate columns. If some columns are missing, Decker will do a best-effort job of fixing them.