emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Customizing Timestamps in html Export.
@ 2014-11-26 11:23 Ian Barton
  2014-12-01 12:11 ` Ian Barton
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2014-11-26 11:23 UTC (permalink / raw)
  To: emacs-orgmode

I can't work out how to do this. I want to customize the format of 
timestamps when I publish a project to html. There seem to be various 
variables, such as org-html-metadata-timestamp-format, which customize 
the format in pre and postambles and when using the DATE: buffer option, 
but nothing that affects the format of timestamps in the body text.

The nearest I can find is org-time-stamp-custom-formats, which works if 
org-display-custom-times is set. However, I am happy with the default 
when I am working in an org buffer and only want to customize the html 
exported timestamp.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Customizing Timestamps in html Export.
  2014-11-26 11:23 Customizing Timestamps in html Export Ian Barton
@ 2014-12-01 12:11 ` Ian Barton
  2014-12-02  9:45   ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2014-12-01 12:11 UTC (permalink / raw)
  To: emacs-orgmode

On 26/11/14 11:23, Ian Barton wrote:
> I can't work out how to do this. I want to customize the format of
> timestamps when I publish a project to html. There seem to be various
> variables, such as org-html-metadata-timestamp-format, which customize
> the format in pre and postambles and when using the DATE: buffer option,
> but nothing that affects the format of timestamps in the body text.
>
> The nearest I can find is org-time-stamp-custom-formats, which works if
> org-display-custom-times is set. However, I am happy with the default
> when I am working in an org buffer and only want to customize the html
> exported timestamp.
>
> Ian.
>
Thanks to Rick Frankel for confirming this. Sorry I can't reply 
directly, bu the cat just deleted your message:)

However, the using the minimal.el:

#+begin_src emacs-lisp
;; activate debugging
(setq debug-on-error t)
(setq debug-on-quit t)

(add-to-list 'load-path "~/.emacs.d/src/lisp")
(require 'org)

;; The following lines are always needed.  Choose your own keys.
  (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  (global-set-key "\C-cl" 'org-store-link)
  (global-set-key "\C-ca" 'org-agenda)
  (global-set-key "\C-cb" 'org-iswitchb)

(setq org-html-metadata-timestamp-format "%a %d %B %Y ")
(setq org-time-stamp-custom-formats  "%a %d %B %Y ")

#+end_src

and the following test.org:

#+begin_src

The date: [2014-12-01 Mon]

#+end_src

gives the following result with C-c C-x C-t

The date: [2014-12-01 Mon]

Since nobody else has reported this, I imagine it's a case of user 
stupidity, rather than a bug.

Can anyone point out my error?

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Customizing Timestamps in html Export.
  2014-12-01 12:11 ` Ian Barton
@ 2014-12-02  9:45   ` Nicolas Goaziou
  2014-12-03  9:03     ` Ian Barton
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-12-02  9:45 UTC (permalink / raw)
  To: Ian Barton; +Cc: ian, emacs-orgmode

Hello,

Ian Barton <lists@wilkesley.net> writes:

> However, the using the minimal.el:
>
> #+begin_src emacs-lisp
> ;; activate debugging
> (setq debug-on-error t)
> (setq debug-on-quit t)
>
> (add-to-list 'load-path "~/.emacs.d/src/lisp")
> (require 'org)
>
> ;; The following lines are always needed.  Choose your own keys.
>   (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
>   (global-set-key "\C-cl" 'org-store-link)
>   (global-set-key "\C-ca" 'org-agenda)
>   (global-set-key "\C-cb" 'org-iswitchb)
>
> (setq org-html-metadata-timestamp-format "%a %d %B %Y ")
> (setq org-time-stamp-custom-formats  "%a %d %B %Y ")
>
> #+end_src
>
> and the following test.org:
>
> #+begin_src
>
> The date: [2014-12-01 Mon]
>
> #+end_src
>
> gives the following result with C-c C-x C-t
>
> The date: [2014-12-01 Mon]
>
> Since nobody else has reported this, I imagine it's a case of user 
> stupidity, rather than a bug.
>
> Can anyone point out my error?

You need to set `org-display-custom-times' to a non-nil value, too. If
you need this feature only during export, you could use a BIND keyword:

  #+BIND: org-display-custom-times t

assuming `org-export-allow-bind-keywords' is also non-nil.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Customizing Timestamps in html Export.
  2014-12-02  9:45   ` Nicolas Goaziou
@ 2014-12-03  9:03     ` Ian Barton
  2014-12-03 16:20       ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2014-12-03  9:03 UTC (permalink / raw)
  To: emacs-orgmode

On 02/12/14 09:45, Nicolas Goaziou wrote:
> Hello,
>
> Ian Barton <lists@wilkesley.net> writes:
>
>> However, the using the minimal.el:
>>
>> #+begin_src emacs-lisp
>> ;; activate debugging
>> (setq debug-on-error t)
>> (setq debug-on-quit t)
>>
>> (add-to-list 'load-path "~/.emacs.d/src/lisp")
>> (require 'org)
>>
>> ;; The following lines are always needed.  Choose your own keys.
>>    (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
>>    (global-set-key "\C-cl" 'org-store-link)
>>    (global-set-key "\C-ca" 'org-agenda)
>>    (global-set-key "\C-cb" 'org-iswitchb)
>>
>> (setq org-html-metadata-timestamp-format "%a %d %B %Y ")
>> (setq org-time-stamp-custom-formats  "%a %d %B %Y ")
>>
>> #+end_src
>>
>> and the following test.org:
>>
>> #+begin_src
>>
>> The date: [2014-12-01 Mon]
>>
>> #+end_src
>>
>> gives the following result with C-c C-x C-t
>>
>> The date: [2014-12-01 Mon]
>>
>> Since nobody else has reported this, I imagine it's a case of user
>> stupidity, rather than a bug.
>>
>> Can anyone point out my error?
>
> You need to set `org-display-custom-times' to a non-nil value, too. If
> you need this feature only during export, you could use a BIND keyword:
>
>    #+BIND: org-display-custom-times t
>
> assuming `org-export-allow-bind-keywords' is also non-nil.

Thanks for the help. Unfortunately it still doesn't work. Using the 
following minimal.el and test files:

#+begin_src emacs-lisp
;; activate debugging
(setq debug-on-error t)
(setq debug-on-quit t)

(add-to-list 'load-path "~/.emacs.d/src/lisp")
(require 'org)

;; The following lines are always needed.  Choose your own keys.
  (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  (global-set-key "\C-cl" 'org-store-link)
  (global-set-key "\C-ca" 'org-agenda)
  (global-set-key "\C-cb" 'org-iswitchb)

(setq org-export-allow-bind-keywords t)
(setq org-display-custom-times t)
(setq org-html-metadata-timestamp-format "%a %d %B %Y")
(setq org-time-stamp-custom-formats  "%a %d %B %Y")

#+end_src

#+begin_src
#+BIND: org-display-custom-times t

The date: [2014-12-01 Mon]

#+end_src

I see the message in the mini buffer "Timestamps are overlaid with 
custom format", but the format is unchanged. I have tried both with and 
without the #+bind directive.

Using:

Emacs: 24.4.1
Org version: a712cec60fbb9a3384f209f96d43b8e3dfd2d9ce


Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Customizing Timestamps in html Export.
  2014-12-03  9:03     ` Ian Barton
@ 2014-12-03 16:20       ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2014-12-03 16:20 UTC (permalink / raw)
  To: Ian Barton; +Cc: ian, emacs-orgmode

Hello,

Ian Barton <lists@wilkesley.net> writes:

> (setq org-export-allow-bind-keywords t)
> (setq org-display-custom-times t)
> (setq org-html-metadata-timestamp-format "%a %d %B %Y")
> (setq org-time-stamp-custom-formats  "%a %d %B %Y")
>
> #+end_src
>
> #+begin_src
> #+BIND: org-display-custom-times t
>
> The date: [2014-12-01 Mon]
>
> #+end_src
>
>
> I see the message in the mini buffer "Timestamps are overlaid with 
> custom format", but the format is unchanged. I have tried both with and 
> without the #+bind directive.

This should be fixed in master. However `org-time-stamp-custom-formats'
should be a cons cell, not a string.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-03 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-26 11:23 Customizing Timestamps in html Export Ian Barton
2014-12-01 12:11 ` Ian Barton
2014-12-02  9:45   ` Nicolas Goaziou
2014-12-03  9:03     ` Ian Barton
2014-12-03 16:20       ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).