[seed] docs: Add docbook rewrite of readline docs



commit 4c0167b52c7b41176b8089b0b9a119c3a4385417
Author: Robert Carr <racarr svn gnome org>
Date:   Mon May 18 19:21:34 2009 -0400

    docs: Add docbook rewrite of readline docs
---
 configure.ac                          |    1 -
 doc/modules/Makefile.am               |   14 ++++++++++
 doc/modules/book.xml                  |   15 ++++++++++
 doc/modules/readline/Makefile.am      |   17 +++++++++---
 doc/modules/readline/readline.html.in |   41 -----------------------------
 doc/modules/readline/readline.js      |   27 +++++++++++++++++++
 doc/modules/readline/readline.xml     |   46 +++++++++++++++++++++++++++++++++
 7 files changed, 115 insertions(+), 46 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5d4ef02..b6d34ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -319,7 +319,6 @@ doc/tutorial-standalone/tutorial.html
 
 doc/modules/canvas/canvas.html
 doc/modules/multiprocessing/multiprocessing.html
-doc/modules/readline/readline.html
 doc/modules/sqlite/sqlite.html
 doc/modules/sandbox/sandbox.html
 
diff --git a/doc/modules/Makefile.am b/doc/modules/Makefile.am
index 01b8606..6c103d9 100644
--- a/doc/modules/Makefile.am
+++ b/doc/modules/Makefile.am
@@ -1,3 +1,17 @@
 SUBDIRS=canvas multiprocessing readline sandbox sqlite
 
+if ENABLE_GTK_DOC
+html/index.html:
+	mkdir -p html;
+	gtkdoc-mkhtml "Seed" book.xml;
+	mv *.html *.css *.png *.sgml *.devhelp* html
+
+
+bookdir = $(datadir)/doc/seed/modules/html
+book_DATA = html/index.html
+
+install-data-local:
+	cp -r html $(datadir)/doc/seed/modules
+endif 
+
 
diff --git a/doc/modules/book.xml b/doc/modules/book.xml
new file mode 100644
index 0000000..b1a9de6
--- /dev/null
+++ b/doc/modules/book.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude";>
+ <bookinfo>
+    <title>Seed Modules Reference Manual</title>
+    <releaseinfo>
+      Documentation for Seed 0.7.
+      The latest version of this documentation can be found on-line at
+      <ulink role="online-location" url="http://www.gnome.org/~racarr/seed/gtk-\
+doc/index.html">http://www.gnome.org/~racarr/seed/modules/</ulink>.
+    </releaseinfo>
+  </bookinfo>
+ 
+ <xi:include href="readline/readline.xml"/>
+
+</book>
diff --git a/doc/modules/readline/Makefile.am b/doc/modules/readline/Makefile.am
index 188e05a..0469ee7 100644
--- a/doc/modules/readline/Makefile.am
+++ b/doc/modules/readline/Makefile.am
@@ -1,5 +1,14 @@
-modulesdir = $(datadir)/doc/seed/modules
-modules_DATA = \
-	readline.html
 EXTRA_DIST = \
-	readline.html.in
+	readline.js
+
+readline-funcs.xml:
+	../make-functions.js readline.js > readline-funcs.xml
+
+readlinedocsdir = \
+	$(datadir)/doc/seed/modules/readline/html
+
+#index.html: readline-funcs.xml
+#	gtkdoc-mkhtml "readline" readline.xml;
+#	mv *.html *.css *.png html
+
+#readlinedocs_DATA = html/*
diff --git a/doc/modules/readline/readline.html.in b/doc/modules/readline/readline.html.in
deleted file mode 100644
index 20bda88..0000000
--- a/doc/modules/readline/readline.html.in
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
-<head>
-	<title>Seed readline Module Documentation</title>
-	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-	<link rel="stylesheet" href="../style.css" type="text/css" charset="utf-8" />
-	<script type="text/javascript" src="../sh.js"></script>
-    <script type="text/javascript" src="../sh_js.js"></script>
-    <link type="text/css" rel="stylesheet" href="../sh.css" />
-</head>
-<body onload="sh_highlightDocument();">
-<div id="header">Seed <i>readline</i> Module</div>
-<div id="subheader">v  VERSION@</div>
-<div class="section"><b>Usage</b></div>
-<p>
-In order to use functions from the readline module, you must first import it:
-</p>
-<pre class="sh_javascript">
-readline = imports.readline;
-</pre>
-<div class="section"><b>readline.readline</b>(prompt)</div>
-<p><i>Returns: user input</i></p>
-<p>
-Uses the GNU Readline library to display a prompt (using the <i>prompt</i> argument) and then wait for input from the user. The readline prompt provides history (using the up and down arrow keys) within a single Seed process.
-</p>
-<pre class="sh_javascript">
-var input = readline.readline("prompt> ");
-Seed.print(input);
-</pre>
-<div class="section"><b>readline.readline_bind</b>(key, function)</div>
-<p>
-Binds <i>key</i>, any valid ASCII character, to <i>function</i>. If the given key is then pressed while at a <b>readline.readline</b> prompt, the passed function will be called.
-</p>
-<pre class="sh_javascript">
-readline.readline_bind("q", function () { Seed.quit() });
-var num = readline.readline("Enter a number, or q to quit:");
-readline.print(num);
-</pre>
-</body>
-</html>
diff --git a/doc/modules/readline/readline.js b/doc/modules/readline/readline.js
new file mode 100644
index 0000000..551d684
--- /dev/null
+++ b/doc/modules/readline/readline.js
@@ -0,0 +1,27 @@
+funcs = [{id: "readline-readline",
+	  title: "readline.readline (prompt)",
+	  description: "Prompts for one line of input on standard input using <parameter>prompt</parameter> as the prompt.",
+	  params: [
+	      {name: "prompt", description: "A string to use as the readline prompt"}
+	  ],
+	  returns: "A string entered on standard input."},
+	 {id: "readline-bind",
+	  title: "readline.bind (key, function)",
+	  description: "Binds <parameter>key</parameter> to <parameter>function</parameter> causing the function to be invokved whenever <parameter>key</parameter> is pressed",
+	  params: [
+	      {name: "key", description: "A string specifying the key to bind"},
+	      {name: "function", description: "The function to invoke when <parameter>key</parameter> is pressed"}
+	  ]},
+	 {id: "readline-done",
+	  title: "readline.done ()",
+	  description: "Indicates that readline should finish the current line, and return from <parameter>readline.readline</parameter>. Can be used in callbacks to implement features like multiline editing"},
+	 {id: "readline-buffer",
+	  title: "readline.buffer()",
+	  description: "Retrieve the current readline buffer",
+	  returns: "The current readline buffer"},
+	 {id: "readline-insert",
+	  title: "readline.insert (string)",
+	  description: "Inserts <parameter>string</parameter> in to the current readline buffer",
+	  params: [
+	      {name: "string", description: "The string to insert"}
+	  ]}];
diff --git a/doc/modules/readline/readline.xml b/doc/modules/readline/readline.xml
new file mode 100644
index 0000000..60f28cf
--- /dev/null
+++ b/doc/modules/readline/readline.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<chapter id="readline-module" xmlns:xi="http://www.w3.org/2003/XInclude";>
+    <chapterinfo>
+    <author>
+      <firstname>Robert</firstname>
+      <surname>Carr</surname>
+      <affiliation>
+	<address>
+	  <email>racarr@<parameter>gnome.org</parameter></email>
+	</address>
+      </affiliation>
+    </author>
+  </chapterinfo>
+  <title> Seed readline module documentation. </title>
+
+  <section>
+    <title>API Reference</title>
+    <para>
+      The readline module allows for basic usage of the GNU readline library, in Seed. More advanced features may be added a a later time. In order to use the readline module it must be first imported.
+      <programlisting>
+	readline = imports.readline;
+      </programlisting>
+    </para>
+    
+    <xi:include href="readline-funcs.xml"/>
+  </section>
+  <section>
+    <title>Examples</title>
+    <para>Below are several examples of using the Seed readline module. For additional resources, consult the examples/ folder of the Seed source</para>
+    <example id="readline-repl-example">
+      <para>This demonstrates a simple REPL using the readline module</para>
+      <programlisting>
+readline = imports.readline;
+while (1){
+  try{
+    eval(readline.readline("> "));
+  }
+  catch(e) {
+    Seed.print(e.name + " " + e.message);
+  }
+}
+      </programlisting>
+    </example>
+  </section>
+</chapter>
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]