From 1ff39bc2cff34cb4aef22785d0d70bbc90efa3f5 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Thu, 14 Mar 2024 16:02:18 -0300 Subject: first commit --- modules/emacs/org.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 modules/emacs/org.nix (limited to 'modules/emacs/org.nix') diff --git a/modules/emacs/org.nix b/modules/emacs/org.nix new file mode 100644 index 0000000..e5fd15c --- /dev/null +++ b/modules/emacs/org.nix @@ -0,0 +1,11 @@ +{ pkgs, from-elisp }: { + org-tangle = block-predicate: text: + let blocks = (pkgs.callPackage from-elisp { inherit pkgs; }).parseOrgModeBabel text; + block-to-str = (block: + if block-predicate { inherit (block) language flags; } then + block.body + else + "" + ); + in builtins.concatStringsSep "\n" (map block-to-str blocks); +} -- cgit v1.2.3