commit 629a16d6f730e9288e9e7ead7ab16c34b67f4aa6
parent 4408edbb3e867b0333d209efbfa5f08dec29a853
Author: Alex Balgavy <alex@balgavy.eu>
Date: Tue, 16 Aug 2022 13:12:18 +0200
emacs: fix tables for Zola export
Zola uses CommonMark, so tables need to be HTML.
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/emacs/config.org b/emacs/config.org
@@ -1035,12 +1035,15 @@ And here's the custom publish function that adds/removes the necessary advice:
#+begin_src emacs-lisp
(defun za/org-gfm-publish-to-gfm-zola (plist filename pub-dir)
- "Runs `org-gfm-publish-to-gfm`, advising the necessary functions to generate Zola-compatible markdown."
- (advice-add #'org-md-template :override #'za/org-md-template-zola)
- (advice-add #'org-md-link :filter-return #'za/org-md-link-zola)
- (org-gfm-publish-to-gfm plist filename pub-dir)
- (advice-remove #'org-md-link #'za/org-md-link-zola)
- (advice-remove #'org-md-template #'za/org-md-template-zola))
+ "Run `org-gfm-publish-to-gfm`, advising the necessary
+ functions to generate Zola-compatible markdown."
+ (let ((advice '((org-md-template :override za/org-md-template-zola)
+ (org-md-link :filter-return za/org-md-link-zola)
+ (org-gfm-table :override org-md--convert-to-html)))) ; Zola uses CommonMark, so doesn't support Markdown tables
+
+ (mapc (lambda (orig-type-new) (apply #'advice-add orig-type-new)) advice)
+ (org-gfm-publish-to-gfm plist filename pub-dir)
+ (mapc (lambda (orig-type-new) (advice-remove (nth 0 orig-type-new) (nth 2 orig-type-new))) advice)))
#+end_src
Finally, the list of things we can publish with their respective publishin functions: