Thread: [Doxygen-develop] Patch: Aliases with Arguments (TODO #28)
Brought to you by:
dimitri
From: Dirk R. <re...@ca...> - 2006-09-29 22:01:32
Attachments:
aliasdiff
|
Hi Y'all (I've been living in Louisiana too long ;), I wrote a little patch to support arguments in aliases. It's very simple and not very elegant, but it works fine. Usage is trivial. In the aliases arguments need to be marked with ^<number>^, like this: ALIASES = "al1=*AL1*" \ "al2=*AL2:^1^*" \ "al3=*AL3:^1^ -> ^2^*" When using the alias the arguments are passed in parentheses after the alias (like C macros) and separated by ',' (which can be escaped if necessary): Alias with one arg: \al2(ARG) will be "*AL2:ARG*" Alias with one arg and escaped ',': \al2(ARG\,BLARG) will be "*AL2:ARG,BLARG*" Alias with two args: \al3(FOO,BAR) will be "*AL3:FOO -> BAR*" If an alias is called without () no argument substitution is done, so all existing documentation should work just fine. Currently the maximum number of arguments is fixed at 20, which hopefully is enough. The path is against current CVS. Hope you find it useful Dirk |
From: Iain B. <ia...@pc...> - 2007-05-10 04:07:24
|
Did this patch ever get into the doxygen tree? Is anyone using it? I'm about to try it out, but I think I will have to patch the source still... thanks! On Fri, 2006-09-29 at 17:01 -0500, Dirk Reiners wrote: > Hi Y'all (I've been living in Louisiana too long ;), > > I wrote a little patch to support arguments in aliases. It's very simple > and not very elegant, but it works fine. > > Usage is trivial. In the aliases arguments need to be marked with > ^<number>^, like this: > > ALIASES = "al1=*AL1*" \ > "al2=*AL2:^1^*" \ > "al3=*AL3:^1^ -> ^2^*" > > When using the alias the arguments are passed in parentheses after the > alias (like C macros) and separated by ',' (which can be escaped if > necessary): > > Alias with one arg: \al2(ARG) will be "*AL2:ARG*" > Alias with one arg and escaped ',': \al2(ARG\,BLARG) will be > "*AL2:ARG,BLARG*" > Alias with two args: \al3(FOO,BAR) will be "*AL3:FOO -> BAR*" > > If an alias is called without () no argument substitution is done, so > all existing documentation should work just fine. > > Currently the maximum number of arguments is fixed at 20, which > hopefully is enough. > > The path is against current CVS. > > Hope you find it useful > > Dirk > > > > plain text document attachment (aliasdiff) -- Iain Buchanan <iain at pcorp dot com dot au> Wilner's Observation: All conversations with a potato should be conducted in private. |
From: Robbie G. <ro...@m8...> - 2007-05-10 07:38:17
|
> Did this patch ever get into the doxygen tree? Is anyone using it? I'm > about to try it out, but I think I will have to patch the source > still... As far as i can see from my copy of the sources (the 1.5.2 release) it hasn't been - replaceAliases in commentcnv.l has the old QRegExp cmd ctor argument, and the updated lex action looks like the old version. Can you let me (via the list) know how you get on - i'm also interested in this functionality. - robbie |
From: Iain B. <ia...@pc...> - 2007-05-10 11:06:26
|
On Thu, 2007-05-10 at 17:38 +1000, Robbie Gates wrote: > > Did this patch ever get into the doxygen tree? Is anyone using it? I'm > > about to try it out, but I think I will have to patch the source > > still... > > As far as i can see from my copy of the sources (the 1.5.2 release) it > hasn't been - replaceAliases in commentcnv.l has the old QRegExp cmd > ctor argument, and the updated lex action looks like the old version. Hm, this is strange, since it is still on the TODO list. I don't know how anyone can use aliases effectively without it! > Can you let me (via the list) know how you get on - i'm also > interested in this functionality. I'm actually getting an intern to do it ;) and so far he's patched 1.4.7 successfully and made a test run ok. 1.5.x broke some latex features we were using, so I haven't bothered with that version yet. cya, -- Iain Buchanan <iain at pcorp dot com dot au> Anyone who considers protocol unimportant has never dealt with a cat. -- R. Heinlein |
From: Dimitri v. H. <do...@gm...> - 2007-05-20 09:44:58
|
On 5/10/07, Iain Buchanan <ia...@pc...> wrote: > > On Thu, 2007-05-10 at 17:38 +1000, Robbie Gates wrote: > > > Did this patch ever get into the doxygen tree? Is anyone using > it? I'm > > > about to try it out, but I think I will have to patch the source > > > still... > > > > As far as i can see from my copy of the sources (the 1.5.2 release) it > > hasn't been - replaceAliases in commentcnv.l has the old QRegExp cmd > > ctor argument, and the updated lex action looks like the old version. > > Hm, this is strange, since it is still on the TODO list. I don't know > how anyone can use aliases effectively without it! I'm working on official support for aliases with arguments at the moment. To give you an idea about the syntax, here are some examples of aliases: ALIASES = xreflist{3}="\xrefitem \1 \"\2\" \"\3\" " \ reminder="\xreflist{reminders,Reminder,Reminders}" \ l{1}="\ref \1" \ l{2}="\ref \1 \"\2\"" \ table{1}="<table border=0 cellspacing=2 cellpadding=0>\theader{\1}" \ theader{1}="<tr><th bgcolor=\"FFFF00\" colspan=3>\1" \ row3{3}="<tr><td>\1 <td>\2 <td>\3 </tr>" \ endtable="</table>" \ Bold{1}="<b>\1</b>" \ Emph{1}="<em>\1</em>" And some code using the aliases: /** \reminder This needs to be renamed * \reminder Also a redesign would be handy * See \l{Base} or \l{Base,the other class}. * A nice table: * \table{Heading} * \row3{ cell(1\,1) , cell(1\,2) , cell(1\,3) } * \row3{ cell(2\,1) , cell(2\,2) , cell(2\,3) } * \endtable * \Bold{Some \Emph{text} here} */ class Test { }; /** Some class */ class Base { }; > Can you let me (via the list) know how you get on - i'm also > > interested in this functionality. > > I'm actually getting an intern to do it ;) and so far he's patched 1.4.7 > successfully and made a test run ok. 1.5.x broke some latex features we > were using, so I haven't bothered with that version yet. > > cya, > -- > Iain Buchanan <iain at pcorp dot com dot au> > > Anyone who considers protocol unimportant has never dealt with a cat. > -- R. Heinlein > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Doxygen-develop mailing list > Dox...@li... > https://lists.sourceforge.net/lists/listinfo/doxygen-develop > |
From: Iain B. <ia...@pc...> - 2007-05-22 23:01:53
|
On Sun, 2007-05-20 at 11:44 +0200, Dimitri van Heesch wrote: > > I'm working on official support for aliases with arguments at the > moment. cool, thanks! > To give you an idea about the syntax, here are some examples of > aliases: I found that example slightly confusing :) but I'll wait to play when the "official" one is released. thanks again, -- Iain Buchanan <iain at pcorp dot com dot au> You got to be very careful if you don't know where you're going, because you might not get there. -- Yogi Berra |