Browse Source

ox: Propagate property drawer changes to back-ends in contrib/

* contrib/lisp/ox-confluence.el (org-confluence-property-drawer): New
  function.
* contrib/lisp/ox-groff.el (org-groff-node-property,
  org-groff-property-drawer): New functions.
Nicolas Goaziou 11 years ago
parent
commit
28e33598e4
2 changed files with 28 additions and 1 deletions
  1. 6 0
      contrib/lisp/ox-confluence.el
  2. 22 1
      contrib/lisp/ox-groff.el

+ 6 - 0
contrib/lisp/ox-confluence.el

@@ -46,6 +46,7 @@
 		     (headline . org-confluence-headline)
 		     (italic . org-confluence-italic)
 		     (link . org-confluence-link)
+		     (property-drawer . org-confluence-property-drawer)
 		     (section . org-confluence-section)
 		     (src-block . org-confluence-src-block)
 		     (strike-through . org-confluence-strike-through)
@@ -93,6 +94,11 @@
              (t
               raw-link))
             "]")))
+
+(defun org-confluence-property-drawer (property-drawer contents info)
+  (and (org-string-nw-p contents)
+       (format "\{\{%s\}\}" contents)))
+
 (defun org-confluence-section (section contents info)
   contents)
 

+ 22 - 1
contrib/lisp/ox-groff.el

@@ -70,11 +70,12 @@
     (keyword . org-groff-keyword)
     (line-break . org-groff-line-break)
     (link . org-groff-link)
+    (node-property . org-groff-node-property)
     (paragraph . org-groff-paragraph)
     (plain-list . org-groff-plain-list)
     (plain-text . org-groff-plain-text)
     (planning . org-groff-planning)
-    (property-drawer . (lambda (&rest args) ""))
+    (property-drawer . org-groff-property-drawer)
     (quote-block . org-groff-quote-block)
     (quote-section . org-groff-quote-section)
     (radio-target . org-groff-radio-target)
@@ -1316,6 +1317,17 @@ INFO is a plist holding contextual information.  See
      ;; No path, only description.  Try to do something useful.
      (t (format org-groff-link-with-unknown-path-format desc)))))
 
+;;; Node Property
+
+(defun org-groff-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to Groff.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
 ;;; Paragraph
 
 (defun org-groff-paragraph (paragraph contents info)
@@ -1426,6 +1438,15 @@ information."
     "")
    ""))
 
+;;;; Property Drawer
+
+(defun org-groff-property-drawer (property-drawer contents info)
+  "Transcode a PROPERTY-DRAWER element from Org to Groff.
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format "\\fC\n%s\\fP" contents)))
+
 ;;; Quote Block
 
 (defun org-groff-quote-block (quote-block contents info)