Vugu files have three sections: Markup, Style and Code
Markup is the HTML element which is the display portion of your file. More often than not it is a simple div tag, such as:
<div class="some-name"> <!-- ... --> </div>
It is displayed at the appropriate location in the document. For the
root component (by default named "root" and living in root.vugu), this is usually immediately
inside the <body>
tag of the page. The element can be of any type except
<script>
or <style>
. A full-HTML mode is also available for root
components that need access to the title, meta tags, etc.
See Markup for details.
Style is a regular <style>
tag and includes CSS which is
output with this component. To avoid collisions, styles should be appropriately
prefixed (corresponding to an id
or class
on the top level markup
element above).
Code is Go language code which is copied verbatim into the final .go file. It is put into a script tag with a specific content type, like so:
<script type="application/x-go"> // Go code here </script>
Note that JavaScript is not currently supported, only Go code. (There can be only one.)