2007-09-01 Jürg Billeter <j@bitron.ch>
+ * configure.ac: add xsltproc as optional dependency
+ * doc/vala/: add initial structure for the Vala Reference Manual, will
+ be built and installed if xsltproc is available
+ * tests/hello.exp, tests/hello.vala: add hello world test case
+ * doc/Makefile.am, tests/Makefile.am: updated
+
+2007-09-01 Jürg Billeter <j@bitron.ch>
+
* vala/valasemanticanalyzer.vala: check arguments of methods with
ellipsis parameters
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
+AC_PATH_PROG([XSLTPROC], [xsltproc], :)
+AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
+
PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, have_enchant=yes, have_enchant=no)
AM_CONDITIONAL(HAVE_ENCHANT, test x$have_enchant = xyes)
vapi/Makefile
tests/Makefile
doc/Makefile
+ doc/vala/Makefile
gobject-introspection/Makefile
vapigen/Makefile
vapigen/gidlgen/Makefile
NULL =
+SUBDIRS = \
+ vala \
+ $(NULL)
+
if ENABLE_VAPIGEN
VAPIGEN_MANS = \
gidlgen.1 \
--- /dev/null
+bookdir=$(datadir)/devhelp/books/vala
+
+chapter_data = \
+ overview.html \
+ types.html \
+ expressions.html \
+ statements.html \
+ namespaces.html \
+ classes.html \
+ structs.html \
+ interfaces.html \
+ enums.html \
+ delegates.html \
+ $(NULL)
+
+built_data = \
+ index.html \
+ $(chapter_data) \
+ vala.devhelp2 \
+ $(NULL)
+
+if HAVE_XSLTPROC
+book_DATA = \
+ $(built_data) \
+ default.css \
+ $(NULL)
+endif
+
+index.html: $(book_sources) xhtml.xsl
+ $(XSLTPROC) --xinclude $(srcdir)/xhtml.xsl $(srcdir)/index.xml > index.html
+
+$(chapter_data): index.html
+
+vala.devhelp2: $(book_sources) devhelp.xsl
+ $(XSLTPROC) --xinclude $(srcdir)/devhelp.xsl $(srcdir)/index.xml > vala.devhelp2
+
+book_sources = \
+ index.xml \
+ overview.xml \
+ types.xml \
+ expressions.xml \
+ statements.xml \
+ namespaces.xml \
+ classes.xml \
+ structs.xml \
+ interfaces.xml \
+ enums.xml \
+ delegates.xml \
+ $(NULL)
+
+MOSTLYCLEANFILES = $(built_data)
+
+EXTRA_DIST = \
+ $(book_sources) \
+ default.css \
+ xhtml.xsl \
+ devhelp.xsl \
+ $(NULL)
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="classes">
+ <h>Classes</h>
+</section>
+
--- /dev/null
+body {
+ font-family: sans-serif;
+ margin-top: 2.8em;
+}
+
+h1, h2, h3 {
+ color: #005a9c;
+}
+
+a {
+ color: #005a9c;
+ text-decoration: none;
+}
+
+.toc {
+ font-weight: bold;
+ font-size: larger;
+}
+
+.toc li {
+ list-style-type: none;
+}
+
+.toc li li {
+ font-size: smaller;
+}
+
+h3 a {
+ /* ensure anchors don't vanish below the fixed header */
+ position: relative;
+ top: -2.8em;
+}
+
+.header {
+ background-color: #005a9c;
+ font-weight: bold;
+ padding: .35em;
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 1.4em;
+}
+
+.header a {
+ color: white;
+}
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="delegates">
+ <h>Delegates</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns="http://www.devhelp.net/book" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:template match="/">
+ <book title="{//title/text()}" link="index.html" author="" name="vala" version="2">
+ <chapters>
+ <xsl:for-each select="//body/section">
+ <sub name="{h/text()}" link="{@id}.html">
+ <xsl:for-each select="section">
+ <sub name="{h/text()}" link="{../@id}.html#{@id}"/>
+ </xsl:for-each>
+ </sub>
+ </xsl:for-each>
+ </chapters>
+ </book>
+ </xsl:template>
+</xsl:stylesheet>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="enums">
+ <h>Enums</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="expressions">
+ <h>Expressions</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<html xmlns:xi="http://www.w3.org/2001/XInclude">
+ <head>
+ <title>Vala Reference Manual</title>
+ </head>
+ <body>
+ <h>Vala Reference Manual</h>
+ <xi:include href="overview.xml"/>
+ <xi:include href="types.xml"/>
+ <xi:include href="expressions.xml"/>
+ <xi:include href="statements.xml"/>
+ <xi:include href="namespaces.xml"/>
+ <xi:include href="classes.xml"/>
+ <xi:include href="structs.xml"/>
+ <xi:include href="interfaces.xml"/>
+ <xi:include href="enums.xml"/>
+ <xi:include href="delegates.xml"/>
+ </body>
+</html>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="interfaces">
+ <h>Interfaces</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="namespaces">
+ <h>Namespaces</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="overview">
+ <h>Overview</h>
+ <p>Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.</p>
+ <section id="gettingstarted">
+ <h>Getting started</h>
+ <p>The classic "Hello, world" example in Vala:</p>
+ <blockcode>
+using GLib;
+
+public class Sample : Object {
+ public Sample () {
+ }
+
+ public void run () {
+ stdout.printf ("Hello, world!\n");
+ }
+
+ static int main (string[] args) {
+ var sample = new Sample ();
+ sample.run ();
+ return 0;
+ }
+}</blockcode>
+ <p>Store the code in a file whose name ends in ".vala", such as <code>hello.vala</code>, and compile it with the command:</p>
+ <blockcode>valac -o hello hello.vala</blockcode>
+ <p>This will produce an executable file called <code>hello</code>.</p>
+ </section>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="statements">
+ <h>Statements</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="structs">
+ <h>Structs</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<section id="types">
+ <h>Types</h>
+</section>
+
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+ <xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
+ <xsl:template match="/">
+ <xsl:apply-templates select="html"/>
+ </xsl:template>
+ <xsl:template match="html">
+ <html><xsl:apply-templates select="head|body"/></html>
+ </xsl:template>
+ <xsl:template match="head">
+ <head>
+ <xsl:apply-templates select="title"/>
+ <link rel="stylesheet" type="text/css" href="default.css"/>
+ </head>
+ </xsl:template>
+ <xsl:template match="title">
+ <title><xsl:value-of select="."/></title>
+ </xsl:template>
+ <xsl:template match="body">
+ <body>
+ <div class="header">
+ <a href="index.html"><xsl:value-of select="//title/text()"/></a>
+ </div>
+ <xsl:apply-templates select="h|p|section"/>
+ <ul class="toc">
+ <xsl:for-each select="section">
+ <li>
+ <a href="{@id}.html"><xsl:value-of select="h/text()"/></a>
+ <xsl:if test="count(section) > 0">
+ <ul>
+ <xsl:for-each select="section">
+ <li><a href="{../@id}.html#{@id}"><xsl:value-of select="h/text()"/></a></li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </body>
+ </xsl:template>
+ <xsl:template match="body/h">
+ <h1><xsl:value-of select="text()"/></h1>
+ </xsl:template>
+ <xsl:template match="body/section">
+ <xsl:document href="{@id}.html" method="xml" indent="yes">
+ <html>
+ <head>
+ <title><xsl:value-of select="h/text()"/> - <xsl:value-of select="//title/text()"/></title>
+ <link rel="stylesheet" type="text/css" href="default.css"/>
+ </head>
+ <body>
+ <div class="header">
+ <a href="index.html"><xsl:value-of select="//title/text()"/></a>
+ </div>
+ <xsl:apply-templates select="h|p|section"/>
+ </body>
+ </html>
+ </xsl:document>
+ </xsl:template>
+ <xsl:template match="body/section/h">
+ <h2><xsl:value-of select="text()"/></h2>
+ </xsl:template>
+ <xsl:template match="body/section/section">
+ <xsl:apply-templates select="h|p|blockcode|section"/>
+ </xsl:template>
+ <xsl:template match="body/section/section/h">
+ <h3><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h3>
+ </xsl:template>
+ <xsl:template match="p">
+ <p><xsl:apply-templates select="text()|code"/></p>
+ </xsl:template>
+ <xsl:template match="code">
+ <code><xsl:value-of select="text()"/></code>
+ </xsl:template>
+ <xsl:template match="blockcode">
+ <pre><xsl:value-of select="text()"/></pre>
+ </xsl:template>
+</xsl:stylesheet>
+
TESTS_ENVIRONMENT = $(srcdir)/testrunner.sh
TESTS = \
+ hello.vala \
test-001.vala \
test-002.vala \
test-003.vala \
EXTRA_DIST = \
testrunner.sh \
- test-001.vala \
- test-002.vala \
- test-003.vala \
- test-004.vala \
- test-005.vala \
- test-006.vala \
- test-007.vala \
- test-008.vala \
- test-009.vala \
- test-010.vala \
- test-011.vala \
- test-012.vala \
- test-013.vala \
- test-014.vala \
- test-015.vala \
- test-016.vala \
- test-017.vala \
- test-018.vala \
- test-019.vala \
- test-020.vala \
- test-021.vala \
- test-022.vala \
- test-023.vala \
- test-024.vala \
- test-025.vala \
- test-026.vala \
- test-027.vala \
- test-028.vala \
- test-029.vala \
- test-030.vala \
- test-031.vala \
- test-032.vala \
- test-033.vala \
- test-034.vala \
- test-035.vala \
+ $(TESTS) \
+ hello.exp \
test-001.exp \
test-002.exp \
test-003.exp \
--- /dev/null
+Hello, world!
--- /dev/null
+using GLib;
+
+public class Sample : Object {
+ public Sample () {
+ }
+
+ public void run () {
+ stdout.printf ("Hello, world!\n");
+ }
+
+ static int main (string[] args) {
+ var sample = new Sample ();
+ sample.run ();
+ return 0;
+ }
+}
+