Re: question about links, macros + org-publish and "parametrization"

2024-05-31 Thread Max Nikulin
On 30/05/2024 23:33, Ihor Radchenko wrote: Max Nikulin writes: I can not figure out if it is possible with some trick to expand {{{year}}} before file:... is parsed. Not possible. Macros are not recognized in verbatim contexts like link path. I had in mind some technique like \expandafter i

Re: question about links, macros + org-publish and "parametrization"

2024-05-30 Thread Ihor Radchenko
Max Nikulin writes: > I can not figure out if it is possible with some trick to expand > {{{year}}} before file:... is parsed. Not possible. Macros are not recognized in verbatim contexts like link path. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

Re: question about links, macros + org-publish and "parametrization"

2024-05-30 Thread Max Nikulin
On 30/05/2024 12:03, Martin Steffen wrote: #+macro: year 24 #+macro: source [[file:./$1/t.org][for the year $1]] #+macro: target {{{source({{{year}}})}}} Custom link type might be more convenient (info "(org) Adding Hyperlink Types") https://orgmode.org/manual/Adding-Hyperlink-Types.html I ca

Re: question about links, macros + org-publish and "parametrization"

2024-05-30 Thread Martin Steffen
> "Fraga," == Fraga, Eric writes: Fraga,> On Thursday, 30 May 2024 at 07:03, Martin Steffen wrote: >> [...] #+macro: target {{{source({{{year}}})}}} Fraga,> So, the problem you are running into is that you cannot Fraga,> evaluate a macro with arguments that require evaluatin

Re: question about links, macros + org-publish and "parametrization"

2024-05-30 Thread Fraga, Eric
On Thursday, 30 May 2024 at 07:03, Martin Steffen wrote: > [...] > #+macro: target {{{source({{{year}}})}}} So, the problem you are running into is that you cannot evaluate a macro with arguments that require evaluating a macro. Unless you can change the order in which you evaluate these macros,

Re: question about links, macros + org-publish and "parametrization"

2024-05-29 Thread Martin Steffen
Hi, maybe my email was premature. The combination of macros and links you described is nice and useful for me (I did not much in the ways of macros in org before). However, one aspect I am after seems not to work. Your example was as follows, and it works: --8<---cut here-

Re: question about links, macros + org-publish and "parametrization"

2024-05-29 Thread Martin Steffen
> "Fraga," == Fraga, Eric writes: Fraga,> Hello, Fraga,> I'm not entirely sure if I am missing something but, in case thanks, it was more that I was missing something. I tried to combine links and macros in a naive ways (without much studying the manual), so I thought perhaps nestin

Re: question about links, macros + org-publish and "parametrization"

2024-05-29 Thread Ihor Radchenko
Martin Steffen writes: > The way I make that smooth is I define > > #LINK: exercises-web https://www.gitpages.io/somelecture/fall23/exercises > > ... > So I am happy with that, but I wonder if I could make it even more > parametrized. Like > > > combining macros with links > > > like that "

Re: question about links, macros + org-publish and "parametrization"

2024-05-29 Thread Fraga, Eric
Hello, I'm not entirely sure if I am missing something but, in case it helps, macros can themselves invoke other macros and macros can make use of [[target][desc]] syntax directly. Can you not build up a hierarchy of macros that would achieve what you want, along these lines: --8<---