[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin b7c9628a4a: (elpaa--section-to-html): Use `markdown2`
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin b7c9628a4a: (elpaa--section-to-html): Use `markdown2` if available |
Date: |
Fri, 28 Oct 2022 09:24:11 -0400 (EDT) |
branch: elpa-admin
commit b7c9628a4acf1a77c50c4552223e82f97a5421ab
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
(elpaa--section-to-html): Use `markdown2` if available
* elpa-admin.el (elpaa-markdown-command): New var.
(elpaa--section-to-html): Use it.
---
elpa-admin.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index 81eb0b9f91..87803ea701 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1372,6 +1372,13 @@ which see."
:ext-plist (append '(:html-toplevel-hlevel 3)
elpaa--org-export-options)))
+(defvar elpaa-markdown-command
+ (if (executable-find "markdown2")
+ ;; Presumably https://github.com/trentm/python-markdown2.
+ ;; Stay conservative in the set of extensions we support.
+ '("markdown2" "-x" "code-friendly,tables")
+ '("markdown")))
+
(cl-defmethod elpaa--section-to-html ((section (head text/markdown)))
(with-temp-buffer
(let ((input-filename
@@ -1379,7 +1386,8 @@ which see."
(unwind-protect
(progn
(write-region (cdr section) nil input-filename)
- (elpaa--call-sandboxed t "markdown" input-filename))
+ (apply #'elpaa--call-sandboxed t
+ `(,@elpaa-markdown-command ,input-filename)))
(delete-file input-filename)))
;; Adjust headings since this HTML fragment will be inserted
;; inside an <h2> section.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] elpa-admin b7c9628a4a: (elpaa--section-to-html): Use `markdown2` if available,
Stefan Monnier <=