Re: [O] angle brackets around timestamps in html export
Hello, Matt Price mopto...@gmail.com writes: I'm trying to get rid of angle brackets in HTML export. I've set org-export-date-timestamp-format to %a, %b %d. This variable only applies to a timestamp specified in DATE keyword. I also have timestamp overlays turned on, and the displayed custom format set to %a, %b %d (that seems unlikely to be relevant, but I've changed it just in case). This should work with: - `org-display-custom-times' set to t - `org-time-stamp-custom-formats' set to a cons cell with values without angle brackets. These variables can be buffer-local. Sorry I can't find the answer in the docs, I'm sure it's there somewhere but I'm missing it somehow! You can also use a filter on every timestamp exported and make sure any angle bracket is removed. Regards, -- Nicolas Goaziou
Re: [O] angle brackets around timestamps in html export
On Tue, Sep 3, 2013 at 9:01 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, Matt Price mopto...@gmail.com writes: I'm trying to get rid of angle brackets in HTML export. I've set org-export-date-timestamp-format to %a, %b %d. This variable only applies to a timestamp specified in DATE keyword. I also have timestamp overlays turned on, and the displayed custom format set to %a, %b %d (that seems unlikely to be relevant, but I've changed it just in case). This should work with: - `org-display-custom-times' set to t - `org-time-stamp-custom-formats' set to a cons cell with values without angle brackets. These variables can be buffer-local. Hmm. I have org-diplay-custom-times set to t. org-time-stamp-custom-formats is customized: -- org-time-stamp-custom-formats is a variable defined in `org.el'. Its value is ( %a, %b. %d . %m/%d/%y %a %H:%M) Original value was (%m/%d/%y %a . %m/%d/%y %a %H:%M) --- On html export, the following is generated: - span class=timestamp-wrapperspan class=timestamplt;Tue, Sep. 10gt;/span/span - so it looks like it's difficult to remove the brackets with those two variables. Sorry I can't find the answer in the docs, I'm sure it's there somewhere but I'm missing it somehow! You can also use a filter on every timestamp exported and make sure any angle bracket is removed. I was able to add this bit of javascript to my wordpress site to remove the brackets: --- var elements = document.getElementsByClassName(timestamp); for (var i = 0; i elements.length; ++i) { console.log(removing timestamp); elements[i].innerHTML = elements[i].innerHTML.replace(/(lt;|gt;|\[|\])/g,''); } - Is that what you mean by a filter, or should I be doing something in emacs. thank you Nicolas! Matt Regards, -- Nicolas Goaziou
Re: [O] angle brackets around timestamps in html export
Matt Price mopto...@gmail.com writes: so it looks like it's difficult to remove the brackets with those two variables. Indeed. It looks like `org-translate-time' always add brackets in the end. Sorry I can't find the answer in the docs, I'm sure it's there somewhere but I'm missing it somehow! You can also use a filter on every timestamp exported and make sure any angle bracket is removed. I was able to add this bit of javascript to my wordpress site to remove the brackets: --- var elements = document.getElementsByClassName(timestamp); for (var i = 0; i elements.length; ++i) { console.log(removing timestamp); elements[i].innerHTML = elements[i].innerHTML.replace(/(lt;|gt;|\[|\])/g,''); } - Is that what you mean by a filter, or should I be doing something in emacs. I basically meant the Elisp counterpart of this. See `org-export-filter-timestamp-functions' and 12.13 Advanced configuration in Org manual. Regards, -- Nicolas Goaziou
Re: [O] angle brackets around timestamps in html export
On Tue, Sep 3, 2013 at 9:50 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: Matt Price mopto...@gmail.com writes: You can also use a filter on every timestamp exported and make sure any angle bracket is removed. I was able to add this bit of javascript to my wordpress site to remove the brackets: --- var elements = document.getElementsByClassName(timestamp); for (var i = 0; i elements.length; ++i) { console.log(removing timestamp); elements[i].innerHTML = elements[i].innerHTML.replace(/(lt;|gt;|\[|\])/g,''); } - Is that what you mean by a filter, or should I be doing something in emacs. I basically meant the Elisp counterpart of this. See `org-export-filter-timestamp-functions' and 12.13 Advanced configuration in Org manual. thanks nicolas. If you happen to have a moment, I'm having trouble reproducing this regexp in elisp. I would think that, even if I can't figure out how to construct a single regex that matches all the characters I want to remove, omething like this ought to work: --- (defun matt-org-export-filter-timestamp-function (timestamp backend info) removes relevant brackets from a timestamp (when (org-export-derived-backend-p backend 'html) ;; unfortunatley I can't make emacs regexps work yet. sigh. (replace-regexp-in-string [][] timestamp) ;; (replace-regexp-in-string lt; timestamp) )) -- but the second (commented-out) regexp seems to break my export. Again, many thanks. matt Regards, -- Nicolas Goaziou
Re: [O] angle brackets around timestamps in html export
Matt Price mopto...@gmail.com writes: thanks nicolas. If you happen to have a moment, I'm having trouble reproducing this regexp in elisp. I would think that, even if I can't figure out how to construct a single regex that matches all the characters I want to remove, omething like this ought to work: --- (defun matt-org-export-filter-timestamp-function (timestamp backend info) removes relevant brackets from a timestamp (when (org-export-derived-backend-p backend 'html) ;; unfortunatley I can't make emacs regexps work yet. sigh. (replace-regexp-in-string [][] timestamp) ;; (replace-regexp-in-string lt; timestamp) )) -- but the second (commented-out) regexp seems to break my export. The following should work: (defun matt-org-export-filter-timestamp-function (timestamp backend info) removes relevant brackets from a timestamp (when (org-export-derived-backend-p backend 'html) (replace-regexp-in-string [lg]t;\\|[][] timestamp))) (add-to-list 'org-export-filter-timestamp-functions 'matt-org-export-filter-timestamp-function) Regards, -- Nicolas Goaziou
Re: [O] angle brackets around timestamps in html export
On Tue, Sep 3, 2013 at 10:34 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: Matt Price mopto...@gmail.com writes: The following should work: (defun matt-org-export-filter-timestamp-function (timestamp backend info) removes relevant brackets from a timestamp (when (org-export-derived-backend-p backend 'html) (replace-regexp-in-string [lg]t;\\|[][] timestamp))) (add-to-list 'org-export-filter-timestamp-functions 'matt-org-export-filter-timestamp-function) that did it! Thanks Nicolas.
[O] angle brackets around timestamps in html export
Hello again, I'm trying to get rid of angle brackets in HTML export. I've set org-export-date-timestamp-format to %a, %b %d. I also have timestamp overlays turned on, and the displayed custom format set to %a, %b %d (that seems unlikely to be relevant, but I've changed it just in case). Sorry I can't find the answer in the docs, I'm sure it's there somewhere but I'm missing it somehow! Matt