开发者

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

开发者 https://www.devze.com 2023-04-02 10:22 出处:网络
I would like to introduce some javascript <script>xxx</script> content into my generated index.html in order to add reddit and facebook \"like\" buttons to my project\'s main page.Is there

I would like to introduce some javascript <script>xxx</script> content into my generated index.html in order to add reddit and facebook "like" buttons to my project's main page. Is there a way to accomplish this automat开发者_StackOverflow社区ically using Doxygen?

Thanks,

SetJmp


You can use @mainpage in combination with an @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

*/
0

精彩评论

暂无评论...
验证码 换一张
取 消