emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>
Cc: Uwe Brauer <oub@mat.ucm.es>, emacs-orgmode@gnu.org
Subject: Re: export to html, colored dates: org-mime export works but org to html does not
Date: Sat, 11 Feb 2023 11:05:54 +0100	[thread overview]
Message-ID: <63e76884.5d0a0220.ef6c0.6d06@mx.google.com> (raw)
In-Reply-To: <87ttzsvac8.fsf@mat.ucm.es>

Uwe Brauer <oub@mat.ucm.es> writes:

>>>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:
>
>> Uwe Brauer <oub@mat.ucm.es> writes:
>> ..
>
>>> (add-to-list 'org-export-filter-plain-text-functions 'my-html-red)
>> ..
>
>>> But if I have 
>>> #<2023-02-11>#
>>> in an org file and export it to html, no color is added to the timestamp.
>>> 
>>> I don't know how to debug this.
>>> 
>>> Any idea?
>
>> In org, "<2023-02-11>" is a date, not plain text. Thus, your function
>> doesn't get called with a text matching your date.
>
>> Note that using macros, you could get almost what you want. 
>
>> #+MACRO: IDATE @@html:<span style="color: red">$1</span>@@
>
>> {{{IDATE(<2023-02-11>)}}}
>
>> And maybe ther is a way to also customize date format to get rid of the
>> brackets.
>
> Thanks, did you test it?
> I am asking because for me


I even did! :-)

You need to call the macro named 'IDATE' like this:

     * Title {{{IDATE(2023-02-11)}}}
     {{{IDATE(2023-02-11)}}}

See:
   (info "(org) Macro Replacement")

And it will work for you too.

Bruno
   

>
> #+LANGUAGE: 
> #+EXPORT_FILE_NAME: /home/oub/Desktop/testdate.html
> #+OPTIONS: toc:nil  
> #+HTML_HEAD_EXTRA: <style> body {font-size:150%}</style>
> #+MACRO: IDATE @@html:<span style="color: red">$1</span>@@
>
> * Title {{{<2023-02-11>}}}
> {{{(<2023-02-11>)}}}
>
>
> Does not work when exporting to html, and I have recent developer org
> version installed
>
> Uwe 
> -- 
> Warning: Content may be disturbing to some audiences
> I strongly condemn Putin's war of aggression against the Ukraine.
> I support to deliver weapons to Ukraine's military. 
> I support the ban of Russia from SWIFT.
> I support the EU membership of the Ukraine. 
> https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


      parent reply	other threads:[~2023-02-11 10:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  8:27 export to html, colored dates: org-mime export works but org to html does not Uwe Brauer
2023-02-11  8:54 ` Bruno Barbier
2023-02-11  9:07   ` Uwe Brauer
2023-02-11  9:58     ` Ihor Radchenko
2023-02-11 10:16       ` Uwe Brauer
2023-02-11 10:34         ` Ihor Radchenko
2023-02-11 11:08           ` Uwe Brauer
2023-02-11 11:41             ` Ihor Radchenko
     [not found]               ` <8846480D-F028-4660-B3E8-26FF99F54F23@mat.ucm.es>
2023-02-11 14:13                 ` Ihor Radchenko
2023-02-11 14:20                   ` Uwe Brauer
2023-02-11 10:05     ` Bruno Barbier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63e76884.5d0a0220.ef6c0.6d06@mx.google.com \
    --to=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=oub@mat.ucm.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).