From: Norman Walsh Date: Sun, 6 Jan 2002 19:16:48 +0000 (+0000) Subject: Literate improvements suggested by Tony Coates X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8794c0c611b7597dc51b9d684dedfdbd957f2c9a;p=docbook-dsssl Literate improvements suggested by Tony Coates --- diff --git a/litprog/example/doc.xweb b/litprog/example/doc.xweb index 8e081edb9..11d3d153c 100644 --- a/litprog/example/doc.xweb +++ b/litprog/example/doc.xweb @@ -12,8 +12,8 @@

This schema defines elements in the urn:publicid:-:Norman+Walsh:Schema Example:EN namespace.

-

This schema defines several complex types and several elements that -are instances of those types.

+

This schema defines several elements and their complex types. +

+
+

The Elements

+ +

This schema defines one element of each complex +type.

+ + + + + + +
+

The Complex Types

@@ -38,6 +51,17 @@ are instances of those types.

+
+

The role Attribute

+ +

Each of the complex types in this schema allows an optional role attribute. +The role attribute is simply a string.

+ + + + +
+

The doc Type

@@ -62,20 +86,9 @@ are instances of those types.

- -
-

The role Attribute

- -

The role attribute is an optional string.

- - - - -
-

The para Type

@@ -86,17 +99,4 @@ are instances of those types.

- -
-

The Elements

- -

This schema defines one element of each complex -type.

- - - - - - -
\ No newline at end of file diff --git a/litprog/example/fib.xweb b/litprog/example/fib.xweb index b5a5aaef2..2ba8c0c5f 100644 --- a/litprog/example/fib.xweb +++ b/litprog/example/fib.xweb @@ -13,6 +13,20 @@ implementation of the Fibonacci series in Perl. The principal motivation for this document is to demonstrate the use of Literate XML. +
Recursive Definition + +The Fibonacci series begins: 1 1 2 3 5 8 13... Each member of +the series, after the first two, is the sum of the preceding two +members. + +This can be implemented recursively by calculating the preceding +two members of the series and returning their sum: + + +&fib($n-2) + &fib($n-1); + +
+
The <function>fib</function> Function The heart of this program is the recursive function that @@ -32,24 +46,9 @@ sub fib { } } - -
Recursive Definition - -The Fibonacci series begins: 1 1 2 3 5 8 13... Each member of -the series, after the first two, is the sum of the preceding two -members. - -This can be implemented recursively by calculating the preceding -two members of the series and returning their sum: - - -&fib($n-2) + &fib($n-1); - - -
-
Preamble +
Code Preamble The program preamble simply establishes a default location for the Perl executable and informs the interpreter that we want to use