From 661a5a6504d314590064ba8eb2af8b33e1b42435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Ry=C3=BBk=29?= Date: Fri, 25 Mar 2022 10:02:05 +0100 Subject: [PATCH] Add colour box. --- publish.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/publish.el b/publish.el index 0c1c49d..512bf27 100644 --- a/publish.el +++ b/publish.el @@ -8,6 +8,7 @@ (package-initialize) + (use-package ox-publish :init (setq org-html-validation-link nil @@ -18,6 +19,21 @@ org-html-htmlize-output-type nil org-babel-python-command "python3") :config + (org-add-link-type + "color" + (lambda (path) + (message (concat "color " + (progn (add-text-properties + 0 (length path) + (list 'face `((t (:foreground ,path)))) + path) path)))) + (lambda (path desc format) + (cond + ((eq format 'html) + (format "%s" path desc)) + ((eq format 'latex) + (format "{\\color{%s}%s}" path desc))))) + (org-babel-do-load-languages 'org-babel-load-languages '(