Is there a way to insert <script> content into the Doxygen \ mainpage section?

I would like to add some javascript content <script>xxx</script>to my generated index.html to add the reddit and facebook “like” buttons to my project home page. Is there a way to do this automatically with Doxygen?

Thanks,

Setjmp

+2
source share
1 answer

You can use @mainpage in conjunction with the @htmlonly ... @endhtmlonly block. Here is an example:

/** @mainpage My Script Page

Here is an embedded script:
@htmlonly
 <script type="text/javascript">
 function displayDate()
 {
 document.getElementById("demo").innerHTML=Date();
 }
 </script>
 <div id="demo">date</div>
 <script type="text/javascript">displayDate();</script>
 <br/>
 <button type="button" onclick="displayDate()">Refresh Date</button>
@endhtmlonly

*/
+3
source

All Articles