Re: [O] New exporter: no custom timestamps
Nicolas Goaziou n.goaz...@gmail.com writes: Done. I've also added :repeater-unit for good measure. Great, thanks! -- Bastien
Re: [O] New exporter: no custom timestamps
Nicolas Goaziou n.goaz...@gmail.com writes: I tend to think that :raw-value would be a good option. Timestamps properties could be enriched. Besides common properties (:begin, :end, :post-blank) timestamps objects may accept : - :type - :year-start - :year-end - :month-start - :month-end - :day-start - :day-end - :hour-start - :hour-end - :minute-start - :minute-end - :repeater-type (a symbol among: `cumulative', 'catch-up', 'restart' corresponding to, respectively +, ++ .+ repeater marks) - :repeater-value - :raw-value :*-end properties would be the same as :*-start properties when timestamp isn't a range. Both would be nil (along with :repeater-*) when type is `diary'. By default back-ends would use :raw-value and `org-translate-time'. :range-end property would be removed. Done. I've also added :repeater-unit for good measure. Regards,
Re: [O] New exporter: no custom timestamps
Hi Nicolas, Nicolas Goaziou n.goaz...@gmail.com writes: What do you think? I think it would be great! -- Bastien
Re: [O] New exporter: no custom timestamps
Hi Jambunathan, Bastien b...@altern.org writes: I suggest to fix this in org-e-html.el with the attached patch. I have now applied the patch. Feel free to amend/edit/revert it if you think it is not good. Thanks Giovanni for reporting this. -- Bastien
Re: [O] New exporter: no custom timestamps
Hello, Bastien b...@altern.org writes: I suggest to fix this in org-e-html.el with the attached patch. There is another option: to set :raw-value for time-stamps, but this feels a bit clumsy, especially when there is a :range-end. (org-element-property :raw-value TIMESTAMP) I tend to think that :raw-value would be a good option. Timestamps properties could be enriched. Besides common properties (:begin, :end, :post-blank) timestamps objects may accept : - :type - :year-start - :year-end - :month-start - :month-end - :day-start - :day-end - :hour-start - :hour-end - :minute-start - :minute-end - :repeater-type (a symbol among: `cumulative', 'catch-up', 'restart' corresponding to, respectively +, ++ .+ repeater marks) - :repeater-value - :raw-value :*-end properties would be the same as :*-start properties when timestamp isn't a range. Both would be nil (along with :repeater-*) when type is `diary'. By default back-ends would use :raw-value and `org-translate-time'. :range-end property would be removed. What do you think? Regards, -- Nicolas Goaziou
Re: [O] New exporter: no custom timestamps
Hi Jambunathan, Jambunathan K kjambunat...@gmail.com writes: I am not sure whether (all) the exporters should be changed or just the API needs to be fixed. I suggest to fix this in org-e-html.el with the attached patch. There is another option: to set :raw-value for time-stamps, but this feels a bit clumsy, especially when there is a :range-end. (org-element-property :raw-value TIMESTAMP) Let me know what you think. diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el index f3daa17..c3d1bf2 100644 --- a/contrib/lisp/org-e-html.el +++ b/contrib/lisp/org-e-html.el @@ -2857,11 +2857,12 @@ information. Transcode a TIMESTAMP object from Org to HTML. CONTENTS is nil. INFO is a plist holding contextual information. - (let ((value (org-translate-time (org-element-property :value timestamp))) - (range-end (org-element-property :range-end timestamp))) + (let* ((f (if (eq (org-element-property :type timestamp) 'inactive) [%s] %s)) + (value (org-translate-time (format f (org-element-property :value timestamp + (range-end (org-element-property :range-end timestamp))) (format span class=\timestamp-wrapper\span class=\timestamp\%s/span/span (if (not range-end) value - (concat value ndash; (org-translate-time range-end)) + (concat value ndash; (org-translate-time (format f range-end))) Underline -- Bastien
[O] New exporter: no custom timestamps
Hello everybody, I am not able to export with custiom timestamps with the new exporter. file: --- * [2012-09-17 lun] ** [2013-04-28 dom] sunday * COMMENT s # Local Variables: # org-display-custom-times: t # org-time-stamp-custom-formats: (%d/%m/%Y %A . %d/%m/%Y %A %H:%M) # End: -- If I open the file the local variables are set. I toggle the timestamp format C-c C-x C-t and C-c C-e H exports to HTML with my custom timestamp in the headline: h2 id=sec-1span class=section-number-21/span span class=timestamp-wrapper span class=timestamp17/09/2012 lunedì/span/span/h2 Whereas with the new exporter M-x org-export-dispatch h H I get the ISO format: h2 id=sec-1span class=section-number-21/span span class=timestamp-wrapperspan class=timestamp2012-09-17 lun/span/span/h2 cheers, Giovanni
Re: [O] New exporter: no custom timestamps
Hello everybody, I am not able to export with custiom timestamps with the new exporter. `org-translate-time' expects and [] to be passed to it. I am not sure whether (all) the exporters should be changed or just the API needs to be fixed. , | *** Welcome to IELM *** Type (describe-mode) for help. | ELISP org-display-custom-times | t | ELISP org-time-stamp-custom-formats | (%d/%m/%Y %A . %d/%m/%Y %A %H:%M) | | ELISP (setq T '(timestamp | (:type inactive :value 2012-09-17 lun :range-end nil))) | (timestamp | (:type inactive :value 2012-09-17 lun :range-end nil)) | | ELISP (org-translate-time (org-element-property :value T)) | 2012-09-17 lun | ELISP (org-translate-time (format [%s] (org-element-property :value T))) | [17/09/2012 Monday] | ELISP ` file: --- * [2012-09-17 lun] ** [2013-04-28 dom] sunday * COMMENT s # Local Variables: # org-display-custom-times: t # org-time-stamp-custom-formats: (%d/%m/%Y %A . %d/%m/%Y %A %H:%M) # End: -- Use #+BIND: If I open the file the local variables are set. I toggle the timestamp format C-c C-x C-t and C-c C-e H exports to HTML with my custom timestamp in the headline: h2 id=sec-1span class=section-number-21/span span class=timestamp-wrapper span class=timestamp17/09/2012 lunedì/span/span/h2 Whereas with the new exporter M-x org-export-dispatch h H I get the ISO format: h2 id=sec-1span class=section-number-21/span span class=timestamp-wrapperspan class=timestamp2012-09-17 lun/span/span/h2 cheers, Giovanni --