I don't know that much about markdown, and I know there are many different
flavours.  pandoc can make use of title, author, and date info in a
markdown file -- from what i cna tell, it expects a "title block atthe head
of a file (http://pandoc.org/README.html#extension-pandoc_title_block)

% author
% title
% date

I have a simple, inadequate patch to ox-md-template that inserts this info.
It's a start maybe for a better patch?

m
diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index e4291e5..321539a 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -468,12 +468,26 @@ holding export options."
   ;; footnotes with at least a blank line.
   (org-trim (org-html-inner-template (concat "\n" contents "\n") info)))
 
+;;;; template
 (defun org-md-template (contents info)
   "Return complete document string after Markdown conversion.
 CONTENTS is the transcoded contents string.  INFO is a plist used
 as a communication channel."
-  contents)
-
+  (concat
+   ;;(message (concat info))
+   (and (plist-get info :with-author)
+	(let ((author (org-export-data (plist-get info :author) info)))
+	  (and (org-string-nw-p author)
+	       (concat  "\% " author "\n"))))
+   (and (plist-get info :with-title)
+	(concat "\% " (org-export-data (plist-get info :title) info) "\n"))
+   (and (plist-get info :with-date)
+	(let ((date (org-export-data (org-export-get-date info) info)))
+	  (and (org-string-nw-p date)
+	       (concat "\% " date "\n"))))
+   
+   contents)
+  )
 
 
 ;;; Interactive function

Reply via email to