|
@@ -233,6 +233,16 @@ the variable to
|
|
|
:group 'org-export-docbook
|
|
|
:type 'string)
|
|
|
|
|
|
+(defcustom org-export-docbook-keywords-markup "<literal>%s</literal>"
|
|
|
+ "A printf format string to be applied to keywords by DocBook exporter."
|
|
|
+ :group 'org-export-docbook
|
|
|
+ :type 'string)
|
|
|
+
|
|
|
+(defcustom org-export-docbook-timestamp-markup "<emphasis>%s</emphasis>"
|
|
|
+ "A printf format string to be applied to time stamps by DocBook exporter."
|
|
|
+ :group 'org-export-docbook
|
|
|
+ :type 'string)
|
|
|
+
|
|
|
;;; Autoload functions:
|
|
|
|
|
|
;;;###autoload
|
|
@@ -728,9 +738,13 @@ publishing directory."
|
|
|
(org-solidify-link-text (match-string 1 line)))
|
|
|
t t line)))))
|
|
|
|
|
|
- ;; Replace "&" by "&", "<" and ">" by "<" and ">"
|
|
|
- ;; handle @<..> HTML tags (replace "@>..<" by "<..>")
|
|
|
- ;; Also handle sub_superscripts and checkboxes
|
|
|
+ ;; Put time stamps and related keywords into special mark-up
|
|
|
+ ;; elements.
|
|
|
+ (setq line (org-export-docbook-handle-time-stamps line))
|
|
|
+
|
|
|
+ ;; Replace "&", "<" and ">" by "&", "<" and ">".
|
|
|
+ ;; Handle @<..> HTML tags (replace "@>..<" by "<..>").
|
|
|
+ ;; Also handle sub_superscripts and check boxes.
|
|
|
(or (string-match org-table-hline-regexp line)
|
|
|
(setq line (org-docbook-expand line)))
|
|
|
|
|
@@ -1321,6 +1335,38 @@ TABLE is a string containing the HTML code generated by
|
|
|
(setq string (replace-match (match-string 1 string) t t string)))
|
|
|
string))
|
|
|
|
|
|
+(defun org-export-docbook-protect-tags (string)
|
|
|
+ "Change ``<...>'' in string STRING into ``@<...>''.
|
|
|
+This is normally needed when STRING contains DocBook elements
|
|
|
+that need to be preserved in later phase of DocBook exporting."
|
|
|
+ (let ((start 0))
|
|
|
+ (while (string-match "<\\([^>]*\\)>" string start)
|
|
|
+ (setq string (replace-match
|
|
|
+ "@<\\1>" t nil string)
|
|
|
+ start (match-end 0)))
|
|
|
+ string))
|
|
|
+
|
|
|
+(defun org-export-docbook-handle-time-stamps (line)
|
|
|
+ "Format time stamps in string LINE."
|
|
|
+ (let (replaced
|
|
|
+ (kw-markup (org-export-docbook-protect-tags
|
|
|
+ org-export-docbook-keywords-markup))
|
|
|
+ (ts-markup (org-export-docbook-protect-tags
|
|
|
+ org-export-docbook-timestamp-markup)))
|
|
|
+ (while (string-match org-maybe-keyword-time-regexp line)
|
|
|
+ (setq replaced
|
|
|
+ (concat replaced
|
|
|
+ (substring line 0 (match-beginning 0))
|
|
|
+ (if (match-end 1)
|
|
|
+ (format kw-markup
|
|
|
+ (match-string 1 line)))
|
|
|
+ " "
|
|
|
+ (format ts-markup
|
|
|
+ (substring (org-translate-time
|
|
|
+ (match-string 3 line)) 1 -1)))
|
|
|
+ line (substring line (match-end 0))))
|
|
|
+ (concat replaced line)))
|
|
|
+
|
|
|
(provide 'org-docbook)
|
|
|
|
|
|
;;; org-docbook.el ends here
|