João Cartucho João Cartucho - 6 months ago 66
HTML Question

Making a clean looking Doxygen ALIAS with HTML

I have a working Doxygen ALIAS code using HTML (via @htmlonly), that in order to display a youtube video, allows me to simply write in the (".markdown")-file:

Youtube Link:

https://www.youtube.com/watch?v=**CODE**


With ALIAS:

@youtube{**CODE**}


Without ALIAS:

@htmlonly

<div align="center">
<iframe
title="my title" width="560" height="349"
src="http://www.youtube.com/embed/**CODE**?rel=0&loop=1"
frameborder="0" allowfullscreen align="middle">
</iframe>
</div>

@endhtmlonly


By adding the following ALIAS to the Doxyfile:

ALIASES += youtube{1}="@htmlonly<div align='center'><iframe title='my title' width='560' height='349' src='http://www.youtube.com/embed/\1?rel=0&loop=1' frameborder='0' allowfullscreen align='middle'></iframe></div>@endhtmlonly"


My problem is that the macro as you can see from above is HUGE and looks really CONFUSING!

Questions:


  1. Is there a way to make it look clean?

  2. What should I do with bigger HTML raw codes?

  3. Should I be using any other Doxygen alternative to the ALIAS?


Answer

I managed to figure it out.

Instead of:

ALIASES               += youtube{1}="@htmlonly<div align='center'><iframe title='my title' width='560' height='349' src='http://www.youtube.com/embed/\1?rel=0&loop=1' frameborder='0' allowfullscreen align='middle'></iframe></div>@endhtmlonly"

I can write the HTML code in a file, example youtube.html:

<div align='center'>
<iframe 
    title='my title'width='560' height='349' 
    src='http://www.youtube.com/embed/\1?rel=0&loop=1'
    frameborder='0'
    allowfullscreen align='middle'>
</iframe>
</div>

Then add to the Doxyfile (with your own [PATH])

ALIASES               += youtube{1}="@htmlinclude youtube.html"
EXAMPLE_PATH          += [PATH]/youtube.html
Comments