diff --git a/ox-plumhtml.el b/ox-plumhtml.el index 8167b19..a5fbf1e 100644 --- a/ox-plumhtml.el +++ b/ox-plumhtml.el @@ -48,13 +48,14 @@ Enables linking to said headers from within the document" "This is the same as `ox-slimhtml-paragraph' but doesn't add a

before export-snippet blocks like #+begin_src .... #+end_src" (when contents - (if (or (ox-slimhtml--immediate-child-of-p paragraph 'item) - (ox-slimhtml--immediate-child-of-p paragraph 'special-block) - (ox-slimhtml--has-immediate-child-of-p paragraph 'export-snippet)) - contents - (if (ox-slimhtml--has-immediate-child-of-p paragraph 'link) - (format "

%s

" contents) - (format "%s

" (ox-slimhtml--attr paragraph) contents))))) + (cond + ((or (ox-slimhtml--immediate-child-of-p paragraph 'item) + (ox-slimhtml--immediate-child-of-p paragraph 'special-block) + (ox-slimhtml--has-immediate-child-of-p paragraph 'export-snippet)) + contents) + ((ox-slimhtml--has-immediate-child-of-p paragraph 'link) + (format "

%s

" contents)) + (t (format "%s

" (ox-slimhtml--attr paragraph) contents))))) (defun ox-plumhtml-table (table contents info) (format "%s
" contents)) @@ -104,7 +105,7 @@ Uses for table headers" (org-export-read-attribute 'attr_html `(nil (attr_html ,(split-string attributes)))))))) (when (not (org-export-low-level-p headline info)) - (if ox-plumhtml-export-header-ids + (if (plist-get info :export-header-ids) (format "%s%s" level (org-export-get-reference headline info) text level (or contents "")) (format "%s%s" level (or attributes "") text level (or contents "")))))) @@ -139,7 +140,7 @@ INFO is a plist holding contextual information." path)) attributes contents))) ((and (string= "fuzzy" link-type) - ox-plumhtml-export-header-ids) + (plist-get info :export-header-ids)) (format "%s" (org-export-get-reference (org-export-resolve-fuzzy-link link info) info) attributes contents)) @@ -148,6 +149,12 @@ INFO is a plist holding contextual information." ;; org-export backend and export/publish functions (org-export-define-derived-backend 'plumhtml 'slimhtml + :menu-entry + '(?p "Export to plumhtml" + ((?H "As plumhtml buffer" ox-slimhtml-export-as-html) + (?h "As plumhtml file" ox-slimhtml-export-to-html))) + :options-alist + '((:export-header-ids "PLUMHTML_HEADER_IDS" nil ox-plumhtml-export-header-ids t)) :translate-alist '((table . ox-plumhtml-table) (table-row . ox-plumhtml-table-row)