OpenGLBook.com

JavaScript OpenGL Function Linker

12 Apr 2011

If anyone is interested, here's a little jQuery/JavaScript function that replaces all OpenGL function names in your HTML document with a highlighted, clickable JavaScript link to the appropriate OpenGL manual page.

For example, any OpenGL function name anywhere inside of an HTML <p> element will transform, simply include the javascript file:

<script type="text/javascript" src="jsglhl.js"></script>

And call the following function somewhere after the document has loaded (if you use jQuery, use $(document).ready()).

LinkOpenGLManPages();

And your OpenGL function names will transform:

glDrawElements - as normal style paragraph text
glVertexAttrib - inside of a <code> element
glViewport - inside of a <strong> element

For more examples, see Chapter 2. It's licensed under the MIT license, so you can do with it whatever you want:
Download

Fork me on GitHub