From 02a75e808698b82bf4ac5356449572f1a70beec9 Mon Sep 17 00:00:00 2001 From: not manx Date: Sat, 27 Jun 2020 20:09:57 +0000 Subject: [PATCH] Comments and README changes --- README.org | 5 ++--- ox-plumhtml.el | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.org b/README.org index 1c53934..f504cce 100644 --- a/README.org +++ b/README.org @@ -1,11 +1,10 @@ * PlumHTML 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. ** Installation -You want to clone the repo into somewhere like -=~/.emacs.d/elpa/plumhtml-1.0.0/= then do ~M-x package-install-file +You want to clone the repo, cd to it then do ~M-x package-install-file ox-plumhtml.el~ ** Functions *** ~ox-plumhtml-export-as-html~ diff --git a/ox-plumhtml.el b/ox-plumhtml.el index e8b1814..86f8ebb 100644 --- a/ox-plumhtml.el +++ b/ox-plumhtml.el @@ -3,9 +3,9 @@ ;; Author: Plum ;; Created: June 2020 -;; Package-Version: 1.0.0 +;; Package-Version: 1.0.1 ;; 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")) ;; This file is not part of GNU Emacs @@ -32,6 +32,7 @@ ;; Utils (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) (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) "Transcodes an org table-row to HTML -Implements and " +Implement and " (when (eq 'standard (org-element-property :type table-row)) (let* ((open (org-export-table-row-starts-rowgroup-p table-row info)) (close (org-export-table-row-ends-rowgroup-p table-row info)) @@ -67,7 +68,7 @@ Implements and " ((or (equal '(above) open) (equal '(bottom) close) first-row) - '("" . ""))))) + '("" . "")))) (concat (and (or open first-row) (car tags)) (format "%s" contents) (and close (cdr tags)))))) @@ -80,6 +81,12 @@ Uses for table headers" (format "%s" contents) (format "%s" contents))) +(defun ox-plumhtml-code (code contents info) + (format "%s" (org-element-property :value code))) + +(defun ox-plumhtml-verbatim (verbatim contents info) + (format "%s" (org-element-property :value verbatim))) + ;; org-export backend and export/publish functions (org-export-define-derived-backend 'plumhtml 'slimhtml @@ -87,7 +94,9 @@ Uses for table headers" '((table . ox-plumhtml-table) (table-row . ox-plumhtml-table-row) (table-cell . ox-plumhtml-table-cell) - (paragraph . ox-plumhtml-paragraph))) + (paragraph . ox-plumhtml-paragraph) + (code . ox-plumhtml-code) + (verbatim . ox-plumhtml-verbatim))) ;;;###autoload (defun ox-plumhtml-publish-to-html (plist filename pub-dir)