From: Nicolas Goaziou Date: Sun, 13 Jan 2013 09:41:41 +0000 (+0100) Subject: org-export-reference: Update documentation about timestamp functions X-Git-Url: http://orgmode.org/w/?p=worg.git;a=commitdiff_plain;h=4aab573830237d2e6eb2288e440c35c1885784d2 org-export-reference: Update documentation about timestamp functions --- diff --git a/dev/org-export-reference.org b/dev/org-export-reference.org index 0bc0ea4..20f5045 100644 --- a/dev/org-export-reference.org +++ b/dev/org-export-reference.org @@ -717,6 +717,22 @@ end-users are explained in the last part of this document. (integer). - ~:year-start~ :: Year part from timestamp start (integer). + Note relative to export: =org.el= provides tools to work on + timestamps objects. In particular, back-ends usually make use of + ~org-timestamp-translate~ function. Thus, in =org-e-html.el=, the + timestamp object is first translated: + + #+BEGIN_SRC emacs-lisp + (defun org-e-html-timestamp (timestamp contents info) + "Transcode a TIMESTAMP object from Org to HTML. + CONTENTS is nil. INFO is a plist holding contextual + information." + (let ((value (org-e-html-plain-text + (org-timestamp-translate timestamp) info))) + (format "%s" + (replace-regexp-in-string "--" "–" value)))) + #+END_SRC + ** Underline Recursive object. @@ -1416,17 +1432,6 @@ end-users are explained in the last part of this document. See also: [[#format-code-default][~org-export-format-code-default~]], [[#get-loc][~org-export-get-loc~]], [[#unravel-code][~org-export-unravel-code~]]. -** ~org-export-format-timestamp~ - :PROPERTIES: - :CUSTOM_ID: format-timestamp - :END: - - Format a timestamp object with an arbitrary format string. - - See also: [[#timestamp-has-time-p][~org-export-timestamp-has-time-p~]], - [[#split-timestamp-range][~org-export-split-timestamp-range~]], - [[#translate-timestamp][~org-export-translate-timestamp~]]. - ** ~org-export-get-caption~ :PROPERTIES: :CUSTOM_ID: get-caption @@ -2078,17 +2083,6 @@ end-users are explained in the last part of this document. [[#table-row-group][~org-export-table-row-group~]], [[#table-row-starts-header-p][~org-export-table-row-starts-header-p~]]. -** ~org-export-timestamp-has-time-p~ - :PROPERTIES: - :CUSTOM_ID: timestamp-has-time-p - :END: - - Non-nil when a timestamp has hours and minutes. - - It is useful to know which format strings to use for a timestampn. - - See also: [[#format-timestamp][~org-export-format-timestamp~]]. - ** ~org-export-translate~ Translate a string, i.e. "Table of Contents", according to language @@ -2097,50 +2091,6 @@ end-users are explained in the last part of this document. Refer to ~org-export-dictionary~ variable for the list of all supported strings. -** ~org-export-split-timestamp-range~ - :PROPERTIES: - :CUSTOM_ID: split-timestamp-range - :END: - - Extract the date start or end from a timestamp range. - - See also: [[#format-timestamp][~org-export-format-timestamp~]], - [[#translate-timestamp][~org-export-translate-timestamp~]]. - -** ~org-export-translate-timestamp~ - :PROPERTIES: - :CUSTOM_ID: translate-timestamp - :END: - - Apply ~org-translate-time~ on a timestamp object. - - According to ~org-time-stamp-custom-formats~ documentation: - - #+BEGIN_QUOTE - The custom formats are also honored by export commands, if custom - time display is turned on at the time of export. - #+END_QUOTE - - Therefore, this function is applied by default on timestamps in - many back-ends. For example, in =e-latex=: - - #+BEGIN_SRC emacs-lisp - (defun org-e-latex-timestamp (timestamp contents info) - "Transcode a TIMESTAMP object from Org to LaTeX. - CONTENTS is nil. INFO is a plist holding contextual - information." - (let ((value (org-e-latex-plain-text - (org-export-translate-timestamp timestamp) info))) - (case (org-element-property :type timestamp) - ((active active-range) (format org-e-latex-active-timestamp-format value)) - ((inactive inactive-range) - (format org-e-latex-inactive-timestamp-format value)) - (otherwise (format org-e-latex-diary-timestamp-format value))))) - #+END_SRC - - See also: [[#format-timestamp][~org-export-format-timestamp~]], - [[#split-timestamp-range][~org-export-split-timestamp-range~]]. - ** ~org-export-unravel-code~ :PROPERTIES: :CUSTOM_ID: unravel-code