Comments and README changes

ご主人様
not manx 5 years ago
parent ef00781700
commit 02a75e8086
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

@ -1,11 +1,10 @@
* PlumHTML * PlumHTML
org-export backend for sane HTML. Basically some changes and org-export backend for sane HTML. Basically some changes and
extensions (currently just tables) to [[https://github.com/balddotcat/ox-slimhtml][ox-slimhtml]]. extensions to [[https://github.com/balddotcat/ox-slimhtml][ox-slimhtml]].
Used to publish words I write. Used to publish words I write.
** Installation ** Installation
You want to clone the repo into somewhere like You want to clone the repo, cd to it then do ~M-x package-install-file
=~/.emacs.d/elpa/plumhtml-1.0.0/= then do ~M-x package-install-file
ox-plumhtml.el~ ox-plumhtml.el~
** Functions ** Functions
*** ~ox-plumhtml-export-as-html~ *** ~ox-plumhtml-export-as-html~

@ -3,9 +3,9 @@
;; Author: Plum <boku@plum.moe> ;; Author: Plum <boku@plum.moe>
;; Created: June 2020 ;; Created: June 2020
;; Package-Version: 1.0.0 ;; Package-Version: 1.0.1
;; Keywords: org-export ;; Keywords: org-export
;; URL: https://code.plum.moe/plumhtml ;; URL: https://words.plum.moe/ox-plumhtml.html
;; Package-Requires: ((emacs "24") (ox-slimhtml "0.4.5")) ;; Package-Requires: ((emacs "24") (ox-slimhtml "0.4.5"))
;; This file is not part of GNU Emacs ;; This file is not part of GNU Emacs
@ -32,6 +32,7 @@
;; Utils ;; Utils
(defun ox-plumhtml--table-header-p (element info) (defun ox-plumhtml--table-header-p (element info)
"Returns `t' if the table has a header else `nil'"
(or (org-export-table-has-header-p element info) (or (org-export-table-has-header-p element info)
(org-export-table-has-header-p (org-export-get-parent-table element) info))) (org-export-table-has-header-p (org-export-get-parent-table element) info)))
@ -53,7 +54,7 @@
(defun ox-plumhtml-table-row (table-row contents info) (defun ox-plumhtml-table-row (table-row contents info)
"Transcodes an org table-row to HTML "Transcodes an org table-row to HTML
Implements <thead> and <tbody>" Implement <thead> and <tbody>"
(when (eq 'standard (org-element-property :type table-row)) (when (eq 'standard (org-element-property :type table-row))
(let* ((open (org-export-table-row-starts-rowgroup-p table-row info)) (let* ((open (org-export-table-row-starts-rowgroup-p table-row info))
(close (org-export-table-row-ends-rowgroup-p table-row info)) (close (org-export-table-row-ends-rowgroup-p table-row info))
@ -67,7 +68,7 @@ Implements <thead> and <tbody>"
((or (equal '(above) open) ((or (equal '(above) open)
(equal '(bottom) close) (equal '(bottom) close)
first-row) first-row)
'("<tbody>" . "</tbody>"))))) '("<tbody>" . "</tbody>"))))
(concat (and (or open first-row) (car tags)) (concat (and (or open first-row) (car tags))
(format "<tr>%s</tr>" contents) (format "<tr>%s</tr>" contents)
(and close (cdr tags)))))) (and close (cdr tags))))))
@ -80,6 +81,12 @@ Uses <th> for table headers"
(format "<th>%s</th>" contents) (format "<th>%s</th>" contents)
(format "<td>%s</td>" contents))) (format "<td>%s</td>" contents)))
(defun ox-plumhtml-code (code contents info)
(format "<code>%s</code>" (org-element-property :value code)))
(defun ox-plumhtml-verbatim (verbatim contents info)
(format "<code>%s</code>" (org-element-property :value verbatim)))
;; org-export backend and export/publish functions ;; org-export backend and export/publish functions
(org-export-define-derived-backend 'plumhtml (org-export-define-derived-backend 'plumhtml
'slimhtml 'slimhtml
@ -87,7 +94,9 @@ Uses <th> for table headers"
'((table . ox-plumhtml-table) '((table . ox-plumhtml-table)
(table-row . ox-plumhtml-table-row) (table-row . ox-plumhtml-table-row)
(table-cell . ox-plumhtml-table-cell) (table-cell . ox-plumhtml-table-cell)
(paragraph . ox-plumhtml-paragraph))) (paragraph . ox-plumhtml-paragraph)
(code . ox-plumhtml-code)
(verbatim . ox-plumhtml-verbatim)))
;;;###autoload ;;;###autoload
(defun ox-plumhtml-publish-to-html (plist filename pub-dir) (defun ox-plumhtml-publish-to-html (plist filename pub-dir)

Loading…
Cancel
Save