feat(aspen/web/orgExportHTML): allow bringing your own config.el

`configFile` is chosen to match the terminology used in NixOS modules. I
think this is quite useful since you can do a lot via the config file
since you can not only set the HTML export setting via the org file
header, but also through various emacs variables (see
<https://orgmode.org/manual/HTML-specific-export-settings.html>).

Change-Id: If4d66348e3043f62782106e7fd34f5cf5c7071a4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12651
Reviewed-by: aspen <root@gws.fyi>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2024-10-03 21:24:30 +02:00 committed by clbot
parent bcaf9c6074
commit 7ebf6be3a3

View file

@ -8,6 +8,7 @@ opts:
let let
src = if isAttrs opts then opts.src else opts; src = if isAttrs opts then opts.src else opts;
headline = if isAttrs opts then opts.headline else null; headline = if isAttrs opts then opts.headline else null;
configFile = opts.configFile or ./config.el;
bn = builtins.baseNameOf src; bn = builtins.baseNameOf src;
filename = elemAt (splitString "." bn) 0; filename = elemAt (splitString "." bn) 0;
@ -37,7 +38,7 @@ runCommand outName { inherit src; } ''
buildFile() { buildFile() {
cp "$1" file.org cp "$1" file.org
${pkgs.emacs}/bin/emacs --batch \ ${pkgs.emacs}/bin/emacs --batch \
--load ${./config.el} \ --load ${configFile} \
--visit file.org \ --visit file.org \
--eval "(progn --eval "(progn
${escapeDoubleQuotes navToHeadline} ${escapeDoubleQuotes navToHeadline}