emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/paredit 66d6374 189/224: Tweak HTML output a little more.


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 66d6374 189/224: Tweak HTML output a little more.
Date: Sat, 7 Aug 2021 09:22:47 -0400 (EDT)

branch: elpa/paredit
commit 66d637451e2fa063b5c5e8f26f5df020f1bceb76
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>

    Tweak HTML output a little more.
---
 paredit.el | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/paredit.el b/paredit.el
index 57d7dd8..2083066 100644
--- a/paredit.el
+++ b/paredit.el
@@ -534,19 +534,26 @@ Paredit behaves badly if parentheses are unbalanced, so 
exercise
   "Insert HTML for a paredit quick reference table."
   (interactive)
   (let ((insert-lines
-         (lambda (&rest lines) (dolist (line lines) (insert line) (newline)))))
+         (lambda (&rest lines) (dolist (line lines) (insert line) (newline))))
+        (initp nil))
     (paredit-do-commands (spec keys fn examples)
-        (funcall insert-lines (concat "<h3>" spec "</h3>"))
-      (let ((name (symbol-name fn)))
-        (funcall insert-lines (concat "<h4>" name "</h4>"))
+        (progn (if initp
+                   (funcall insert-lines "</table>")
+                   (setq initp t))
+               (funcall insert-lines (concat "<h3>" spec "</h3>"))
+               (funcall insert-lines "<table>"))
+      (let ((name (symbol-name fn))
+            (keys
+             (mapconcat (lambda (key)
+                          (concat "<tt>" (paredit-html-quote key) "</tt>"))
+                        keys
+                        ", ")))
+        (funcall insert-lines "<tr>")
+        (funcall insert-lines (concat "  <th>" name "</th>"))
+        (funcall insert-lines (concat "  <th>" keys "</th>"))
+        (funcall insert-lines "</tr>")
         (funcall insert-lines
-                 "<p>Keys: "
-                 (mapconcat (lambda (key)
-                              (concat "<tt>" (paredit-html-quote key) "</tt>"))
-                            keys
-                            ", ")
-                 "</p>")
-        (funcall insert-lines "<table cellpadding=\"10\">")
+                 "<tr><td colspan=\"2\"><table cellpadding=\"10\">")
         (dolist (example examples)
           (let ((prefix "<tr><td><pre>")
                 (examples
@@ -555,7 +562,8 @@ Paredit behaves badly if parentheses are unbalanced, so 
exercise
                             (concat "</pre></td><td>&rarr;</td><td><pre>")))
                 (suffix "</pre></td></tr>"))
             (funcall insert-lines (concat prefix examples suffix))))
-        (funcall insert-lines "</table>")))))
+        (funcall insert-lines "</table></td></tr>")))
+    (funcall insert-lines "</table>")))
 
 (defun paredit-html-quote (string)
   (with-temp-buffer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]