Scribble for literate dotfiles?

35 views
Skip to first unread message

Karl Meakin

unread,
Apr 5, 2020, 6:31:10 PM4/5/20
to Racket Users
 I want to write my dotfiles in literate programming style. As far as I can tell, everyone does this using Emac's org-mode. I'd rather use a fully-fledged programming language (and not be tied to a particular editor). Is it possible to achieve this using Scribble? In particular, I'd like to be able to designate sections of text in the same input file as outputting to different output files (for example, output one section to .bashrc and another section to .vimrc).

Thanks in advance.

Ben Greenman

unread,
Apr 7, 2020, 11:03:22 PM4/7/20
to Racket Users
This is definitely possible, but maybe not easy.

I'd first try writing a racket program with Scribble submodules, and
have the outer program invoke a renderer on each submodule

```
#lang racket

(module dotfile-1 scribble/???
....)

(require (rename-in 'dotfile-1 [doc doc:1]))

(???-render doc:1)
```

If that doesn't work, then I'd try making the outer module
scribble/manual and writing a function that renders one codeblock to a
file.
Reply all
Reply to author
Forward
0 new messages