sqlpostgres 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +8 -0
- data/Gemfile.lock +22 -0
- data/LICENSE.md +23 -0
- data/README.rdoc +59 -0
- data/Rakefile +32 -0
- data/VERSION +1 -0
- data/doc/BUGS +2 -0
- data/doc/examples/README +6 -0
- data/doc/examples/connection.rb +16 -0
- data/doc/examples/connection_auto.rb +22 -0
- data/doc/examples/connection_ctor.rb +18 -0
- data/doc/examples/connection_default.rb +15 -0
- data/doc/examples/connection_exec.rb +18 -0
- data/doc/examples/connection_manual.rb +12 -0
- data/doc/examples/connection_wrapped_new.rb +13 -0
- data/doc/examples/connection_wrapped_open.rb +13 -0
- data/doc/examples/cursor.rb +38 -0
- data/doc/examples/include_module.rb +9 -0
- data/doc/examples/include_module2.rb +12 -0
- data/doc/examples/insert.rb +30 -0
- data/doc/examples/insert2.rb +36 -0
- data/doc/examples/insert_bytea.rb +16 -0
- data/doc/examples/insert_bytea_array.rb +17 -0
- data/doc/examples/insert_default_values.rb +16 -0
- data/doc/examples/insert_insert.rb +16 -0
- data/doc/examples/insert_insert_default.rb +16 -0
- data/doc/examples/insert_insert_select.rb +20 -0
- data/doc/examples/insert_select.rb +20 -0
- data/doc/examples/interval.rb +17 -0
- data/doc/examples/savepoint.rb +38 -0
- data/doc/examples/select.rb +33 -0
- data/doc/examples/select2.rb +36 -0
- data/doc/examples/select_cross_join.rb +18 -0
- data/doc/examples/select_distinct.rb +18 -0
- data/doc/examples/select_distinct_on +19 -0
- data/doc/examples/select_for_update.rb +18 -0
- data/doc/examples/select_from.rb +17 -0
- data/doc/examples/select_from_subselect.rb +20 -0
- data/doc/examples/select_group_by.rb +19 -0
- data/doc/examples/select_having.rb +20 -0
- data/doc/examples/select_join_on.rb +18 -0
- data/doc/examples/select_join_using.rb +18 -0
- data/doc/examples/select_limit.rb +19 -0
- data/doc/examples/select_natural_join.rb +18 -0
- data/doc/examples/select_offset.rb +19 -0
- data/doc/examples/select_order_by.rb +20 -0
- data/doc/examples/select_select.rb +30 -0
- data/doc/examples/select_select_alias.rb +30 -0
- data/doc/examples/select_select_expression.rb +31 -0
- data/doc/examples/select_select_literal.rb +24 -0
- data/doc/examples/select_union.rb +21 -0
- data/doc/examples/select_where_array.rb +18 -0
- data/doc/examples/select_where_in.rb +18 -0
- data/doc/examples/select_where_string.rb +18 -0
- data/doc/examples/simple.rb +34 -0
- data/doc/examples/transaction.rb +30 -0
- data/doc/examples/transaction_abort.rb +30 -0
- data/doc/examples/transaction_commit.rb +34 -0
- data/doc/examples/translate_substitute_values.rb +17 -0
- data/doc/examples/update.rb +32 -0
- data/doc/examples/update2.rb +44 -0
- data/doc/examples/update_only.rb +17 -0
- data/doc/examples/update_set.rb +17 -0
- data/doc/examples/update_set_array.rb +16 -0
- data/doc/examples/update_set_bytea.rb +16 -0
- data/doc/examples/update_set_expression.rb +16 -0
- data/doc/examples/update_set_subselect.rb +20 -0
- data/doc/examples/update_where.rb +17 -0
- data/doc/examples/use_prefix.rb +8 -0
- data/doc/examples/use_prefix2.rb +11 -0
- data/doc/index.html +31 -0
- data/doc/insertexamples.rb +9 -0
- data/doc/makemanual +4 -0
- data/doc/makerdoc +5 -0
- data/doc/manual.dbk +622 -0
- data/lib/sqlpostgres/Connection.rb +198 -0
- data/lib/sqlpostgres/Cursor.rb +157 -0
- data/lib/sqlpostgres/Delete.rb +67 -0
- data/lib/sqlpostgres/Exceptions.rb +15 -0
- data/lib/sqlpostgres/Insert.rb +279 -0
- data/lib/sqlpostgres/NullConnection.rb +22 -0
- data/lib/sqlpostgres/PgBit.rb +73 -0
- data/lib/sqlpostgres/PgBox.rb +37 -0
- data/lib/sqlpostgres/PgCidr.rb +21 -0
- data/lib/sqlpostgres/PgCircle.rb +75 -0
- data/lib/sqlpostgres/PgInet.rb +21 -0
- data/lib/sqlpostgres/PgInterval.rb +208 -0
- data/lib/sqlpostgres/PgLineSegment.rb +37 -0
- data/lib/sqlpostgres/PgMacAddr.rb +21 -0
- data/lib/sqlpostgres/PgPath.rb +64 -0
- data/lib/sqlpostgres/PgPoint.rb +65 -0
- data/lib/sqlpostgres/PgPolygon.rb +56 -0
- data/lib/sqlpostgres/PgTime.rb +77 -0
- data/lib/sqlpostgres/PgTimeWithTimeZone.rb +98 -0
- data/lib/sqlpostgres/PgTimestamp.rb +93 -0
- data/lib/sqlpostgres/PgTwoPoints.rb +54 -0
- data/lib/sqlpostgres/PgType.rb +34 -0
- data/lib/sqlpostgres/PgWrapper.rb +41 -0
- data/lib/sqlpostgres/Savepoint.rb +98 -0
- data/lib/sqlpostgres/Select.rb +855 -0
- data/lib/sqlpostgres/Transaction.rb +120 -0
- data/lib/sqlpostgres/Translate.rb +436 -0
- data/lib/sqlpostgres/Update.rb +188 -0
- data/lib/sqlpostgres.rb +67 -0
- data/test/Assert.rb +72 -0
- data/test/Connection.test.rb +246 -0
- data/test/Cursor.test.rb +190 -0
- data/test/Delete.test.rb +68 -0
- data/test/Insert.test.rb +123 -0
- data/test/MockPGconn.rb +62 -0
- data/test/NullConnection.test.rb +32 -0
- data/test/PgBit.test.rb +98 -0
- data/test/PgBox.test.rb +108 -0
- data/test/PgCidr.test.rb +61 -0
- data/test/PgCircle.test.rb +107 -0
- data/test/PgInet.test.rb +61 -0
- data/test/PgInterval.test.rb +180 -0
- data/test/PgLineSegment.test.rb +108 -0
- data/test/PgMacAddr.test.rb +61 -0
- data/test/PgPath.test.rb +106 -0
- data/test/PgPoint.test.rb +100 -0
- data/test/PgPolygon.test.rb +95 -0
- data/test/PgTime.test.rb +120 -0
- data/test/PgTimeWithTimeZone.test.rb +117 -0
- data/test/PgTimestamp.test.rb +134 -0
- data/test/RandomThings.rb +25 -0
- data/test/Savepoint.test.rb +286 -0
- data/test/Select.test.rb +930 -0
- data/test/Test.rb +62 -0
- data/test/TestConfig.rb +21 -0
- data/test/TestSetup.rb +13 -0
- data/test/TestUtil.rb +92 -0
- data/test/Transaction.test.rb +275 -0
- data/test/Translate.test.rb +354 -0
- data/test/Update.test.rb +227 -0
- data/test/roundtrip.test.rb +565 -0
- data/test/test +34 -0
- data/tools/exampleinserter/ExampleInserter.rb +177 -0
- data/tools/rdoc/ChangeLog +796 -0
- data/tools/rdoc/EXAMPLE.rb +48 -0
- data/tools/rdoc/MANIFEST +58 -0
- data/tools/rdoc/Makefile +27 -0
- data/tools/rdoc/NEW_FEATURES +226 -0
- data/tools/rdoc/README +390 -0
- data/tools/rdoc/ToDo +6 -0
- data/tools/rdoc/contrib/Index +6 -0
- data/tools/rdoc/contrib/xslfo/ChangeLog +181 -0
- data/tools/rdoc/contrib/xslfo/README +106 -0
- data/tools/rdoc/contrib/xslfo/TODO +10 -0
- data/tools/rdoc/contrib/xslfo/convert.xsl +151 -0
- data/tools/rdoc/contrib/xslfo/demo/README +21 -0
- data/tools/rdoc/contrib/xslfo/demo/rdocfo +99 -0
- data/tools/rdoc/contrib/xslfo/fcm.xsl +54 -0
- data/tools/rdoc/contrib/xslfo/files.xsl +62 -0
- data/tools/rdoc/contrib/xslfo/labeled-lists.xsl +66 -0
- data/tools/rdoc/contrib/xslfo/lists.xsl +44 -0
- data/tools/rdoc/contrib/xslfo/modules.xsl +152 -0
- data/tools/rdoc/contrib/xslfo/rdoc.xsl +75 -0
- data/tools/rdoc/contrib/xslfo/source.xsl +66 -0
- data/tools/rdoc/contrib/xslfo/styles.xsl +69 -0
- data/tools/rdoc/contrib/xslfo/tables.xsl +67 -0
- data/tools/rdoc/contrib/xslfo/utils.xsl +21 -0
- data/tools/rdoc/debian/changelog +33 -0
- data/tools/rdoc/debian/compat +1 -0
- data/tools/rdoc/debian/control +20 -0
- data/tools/rdoc/debian/copyright +10 -0
- data/tools/rdoc/debian/dirs +2 -0
- data/tools/rdoc/debian/docs +2 -0
- data/tools/rdoc/debian/rdoc.1 +252 -0
- data/tools/rdoc/debian/rdoc.manpages +1 -0
- data/tools/rdoc/debian/rdoc.pod +149 -0
- data/tools/rdoc/debian/rules +9 -0
- data/tools/rdoc/dot/dot.rb +255 -0
- data/tools/rdoc/etc/rdoc.dtd +203 -0
- data/tools/rdoc/install.rb +137 -0
- data/tools/rdoc/markup/install.rb +43 -0
- data/tools/rdoc/markup/sample/sample.rb +42 -0
- data/tools/rdoc/markup/simple_markup/fragments.rb +323 -0
- data/tools/rdoc/markup/simple_markup/inline.rb +348 -0
- data/tools/rdoc/markup/simple_markup/lines.rb +147 -0
- data/tools/rdoc/markup/simple_markup/preprocess.rb +68 -0
- data/tools/rdoc/markup/simple_markup/to_html.rb +281 -0
- data/tools/rdoc/markup/simple_markup.rb +474 -0
- data/tools/rdoc/markup/test/AllTests.rb +2 -0
- data/tools/rdoc/markup/test/TestInline.rb +151 -0
- data/tools/rdoc/markup/test/TestParse.rb +411 -0
- data/tools/rdoc/rdoc/code_objects.rb +536 -0
- data/tools/rdoc/rdoc/diagram.rb +331 -0
- data/tools/rdoc/rdoc/generators/chm_generator.rb +112 -0
- data/tools/rdoc/rdoc/generators/html_generator.rb +1268 -0
- data/tools/rdoc/rdoc/generators/template/chm/chm.rb +86 -0
- data/tools/rdoc/rdoc/generators/template/html/html.rb +705 -0
- data/tools/rdoc/rdoc/generators/template/html/kilmer.rb +377 -0
- data/tools/rdoc/rdoc/generators/template/xml/rdf.rb +110 -0
- data/tools/rdoc/rdoc/generators/template/xml/xml.rb +110 -0
- data/tools/rdoc/rdoc/generators/xml_generator.rb +130 -0
- data/tools/rdoc/rdoc/options.rb +451 -0
- data/tools/rdoc/rdoc/parsers/parse_c.rb +287 -0
- data/tools/rdoc/rdoc/parsers/parse_f95.rb +118 -0
- data/tools/rdoc/rdoc/parsers/parse_rb.rb +2311 -0
- data/tools/rdoc/rdoc/parsers/parse_simple.rb +37 -0
- data/tools/rdoc/rdoc/parsers/parserfactory.rb +75 -0
- data/tools/rdoc/rdoc/rdoc.rb +219 -0
- data/tools/rdoc/rdoc/template.rb +234 -0
- data/tools/rdoc/rdoc/tokenstream.rb +25 -0
- data/tools/rdoc/rdoc.rb +9 -0
- metadata +291 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: convert.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
7
|
+
version="1.0">
|
|
8
|
+
|
|
9
|
+
<xsl:include href="utils.xsl"/>
|
|
10
|
+
|
|
11
|
+
<xsl:template match="/">
|
|
12
|
+
<xsl:apply-templates/>
|
|
13
|
+
</xsl:template>
|
|
14
|
+
|
|
15
|
+
<xsl:template match="*">
|
|
16
|
+
<xsl:copy>
|
|
17
|
+
<xsl:copy-of select="@*"/>
|
|
18
|
+
<xsl:apply-templates/>
|
|
19
|
+
</xsl:copy>
|
|
20
|
+
</xsl:template>
|
|
21
|
+
|
|
22
|
+
<!-- file: name, id -->
|
|
23
|
+
<xsl:template match="file-list/file">
|
|
24
|
+
<xsl:element name="file">
|
|
25
|
+
<xsl:attribute name="id">
|
|
26
|
+
<xsl:value-of select="generate-id()"/>
|
|
27
|
+
</xsl:attribute>
|
|
28
|
+
<xsl:attribute name="name">
|
|
29
|
+
<xsl:value-of select="file-info/path"/>
|
|
30
|
+
</xsl:attribute>
|
|
31
|
+
<xsl:apply-templates/>
|
|
32
|
+
</xsl:element>
|
|
33
|
+
</xsl:template>
|
|
34
|
+
|
|
35
|
+
<xsl:template match="file-info">
|
|
36
|
+
<xsl:element name="file-info">
|
|
37
|
+
<xsl:apply-templates select="*[name() != 'path']"/>
|
|
38
|
+
</xsl:element>
|
|
39
|
+
</xsl:template>
|
|
40
|
+
|
|
41
|
+
<!-- Class|Module: name, id -->
|
|
42
|
+
<xsl:template match="Class|Module">
|
|
43
|
+
<xsl:element name="{name()}">
|
|
44
|
+
<xsl:attribute name="id">
|
|
45
|
+
<xsl:value-of select="generate-id()"/>
|
|
46
|
+
</xsl:attribute>
|
|
47
|
+
<xsl:for-each select="@*[name() != 'id']">
|
|
48
|
+
<xsl:copy-of select="."/>
|
|
49
|
+
</xsl:for-each>
|
|
50
|
+
<xsl:apply-templates/>
|
|
51
|
+
</xsl:element>
|
|
52
|
+
</xsl:template>
|
|
53
|
+
|
|
54
|
+
<!-- superclass: href or name -->
|
|
55
|
+
<xsl:template match="superclass|infile">
|
|
56
|
+
<xsl:variable name="href">
|
|
57
|
+
<xsl:call-template name="no-hash-mark">
|
|
58
|
+
<xsl:with-param name="string" select="a/@href"/>
|
|
59
|
+
</xsl:call-template>
|
|
60
|
+
</xsl:variable>
|
|
61
|
+
<xsl:copy>
|
|
62
|
+
<xsl:choose>
|
|
63
|
+
<xsl:when test="string-length($href)">
|
|
64
|
+
<xsl:attribute name="href">
|
|
65
|
+
<xsl:value-of select="generate-id(//*[@id = $href])"/>
|
|
66
|
+
</xsl:attribute>
|
|
67
|
+
</xsl:when>
|
|
68
|
+
<xsl:otherwise>
|
|
69
|
+
<xsl:attribute name="name">
|
|
70
|
+
<xsl:value-of select="."/>
|
|
71
|
+
</xsl:attribute>
|
|
72
|
+
</xsl:otherwise>
|
|
73
|
+
</xsl:choose>
|
|
74
|
+
</xsl:copy>
|
|
75
|
+
</xsl:template>
|
|
76
|
+
|
|
77
|
+
<!-- required-file|included-module: href or name -->
|
|
78
|
+
<xsl:template match="required-file|included-module">
|
|
79
|
+
<xsl:variable name="href">
|
|
80
|
+
<xsl:call-template name="no-hash-mark">
|
|
81
|
+
<xsl:with-param name="string" select="@href"/>
|
|
82
|
+
</xsl:call-template>
|
|
83
|
+
</xsl:variable>
|
|
84
|
+
<xsl:copy>
|
|
85
|
+
<xsl:choose>
|
|
86
|
+
<xsl:when test="string-length($href)">
|
|
87
|
+
<xsl:attribute name="href">
|
|
88
|
+
<xsl:value-of select="generate-id(//*[@id = $href])"/>
|
|
89
|
+
</xsl:attribute>
|
|
90
|
+
</xsl:when>
|
|
91
|
+
<xsl:otherwise>
|
|
92
|
+
<xsl:copy-of select="@name"/>
|
|
93
|
+
</xsl:otherwise>
|
|
94
|
+
</xsl:choose>
|
|
95
|
+
</xsl:copy>
|
|
96
|
+
</xsl:template>
|
|
97
|
+
|
|
98
|
+
<!-- method: id, source-ref, legacy attributes -->
|
|
99
|
+
<xsl:template match="method">
|
|
100
|
+
<xsl:element name="method">
|
|
101
|
+
<xsl:attribute name="id">
|
|
102
|
+
<xsl:value-of select="generate-id()"/>
|
|
103
|
+
</xsl:attribute>
|
|
104
|
+
<xsl:attribute name="href">
|
|
105
|
+
<xsl:value-of select="generate-id(source-code-listing)"/>
|
|
106
|
+
</xsl:attribute>
|
|
107
|
+
<xsl:for-each select="@*[name() != 'id']">
|
|
108
|
+
<xsl:copy-of select="."/>
|
|
109
|
+
</xsl:for-each>
|
|
110
|
+
<xsl:apply-templates/>
|
|
111
|
+
</xsl:element>
|
|
112
|
+
</xsl:template>
|
|
113
|
+
|
|
114
|
+
<!-- source-code-listing: id -->
|
|
115
|
+
<xsl:template match="source-code-listing">
|
|
116
|
+
<xsl:element name="source-code-listing">
|
|
117
|
+
<xsl:attribute name="id">
|
|
118
|
+
<xsl:value-of select="generate-id()"/>
|
|
119
|
+
</xsl:attribute>
|
|
120
|
+
<xsl:apply-templates/>
|
|
121
|
+
</xsl:element>
|
|
122
|
+
</xsl:template>
|
|
123
|
+
|
|
124
|
+
<!-- Determine type of link, for insertion later into fo:basic-link -->
|
|
125
|
+
<xsl:template match="description//a">
|
|
126
|
+
<xsl:variable name="href">
|
|
127
|
+
<xsl:call-template name="no-hash-mark">
|
|
128
|
+
<xsl:with-param name="string" select="@href"/>
|
|
129
|
+
</xsl:call-template>
|
|
130
|
+
</xsl:variable>
|
|
131
|
+
<xsl:variable name="target">
|
|
132
|
+
<xsl:value-of select="generate-id(//*[@id = $href])"/>
|
|
133
|
+
</xsl:variable>
|
|
134
|
+
<xsl:element name="a">
|
|
135
|
+
<xsl:choose>
|
|
136
|
+
<xsl:when test="string-length($target)">
|
|
137
|
+
<xsl:attribute name="internal-destination">
|
|
138
|
+
<xsl:value-of select="$target"/>
|
|
139
|
+
</xsl:attribute>
|
|
140
|
+
</xsl:when>
|
|
141
|
+
<xsl:otherwise>
|
|
142
|
+
<xsl:attribute name="external-destination">
|
|
143
|
+
<xsl:value-of select="$href"/>
|
|
144
|
+
</xsl:attribute>
|
|
145
|
+
</xsl:otherwise>
|
|
146
|
+
</xsl:choose>
|
|
147
|
+
<xsl:apply-templates/>
|
|
148
|
+
</xsl:element>
|
|
149
|
+
</xsl:template>
|
|
150
|
+
|
|
151
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The "rdocfo" script will create XSL-FO output -- by default (i.e.,
|
|
2
|
+
with no command-line arguments) for the RDoc installation itself.
|
|
3
|
+
You need Saxon (the command "saxon" in your path), or you can hack
|
|
4
|
+
the script to use a different XSLT processor.
|
|
5
|
+
|
|
6
|
+
Assuming "saxon" works, just run:
|
|
7
|
+
|
|
8
|
+
rdocfo
|
|
9
|
+
|
|
10
|
+
and you should end up with a file called "rdoc.fo".
|
|
11
|
+
|
|
12
|
+
You can also do "rdocfo --help" to see the options available; you can
|
|
13
|
+
use those options to use rdocfo more generally.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
David Alan Black
|
|
17
|
+
dblack@candle.superlink.net
|
|
18
|
+
|
|
19
|
+
---------------------------------------------
|
|
20
|
+
$Id: README,v 1.1 2003/10/10 08:00:05 wconrad Exp $
|
|
21
|
+
$Author: wconrad $
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby -w
|
|
2
|
+
#
|
|
3
|
+
# rdocfo
|
|
4
|
+
|
|
5
|
+
require 'getoptlong'
|
|
6
|
+
require 'tempfile'
|
|
7
|
+
require 'rdoc/rdoc'
|
|
8
|
+
|
|
9
|
+
def help
|
|
10
|
+
$stderr.print <<EOM
|
|
11
|
+
|
|
12
|
+
rdocfo -- utility to semi-automate XSL-FO output from RDoc processor
|
|
13
|
+
(using Saxon)
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
|
|
17
|
+
-d, -dir <directory>
|
|
18
|
+
specify directory to run RDoc on
|
|
19
|
+
-f, --xmlfile <filename>
|
|
20
|
+
use specified RDoc XML file instead of running rdoc
|
|
21
|
+
-h, --help
|
|
22
|
+
print this message
|
|
23
|
+
-i, --interfile <filename>
|
|
24
|
+
use this intermediate XML file
|
|
25
|
+
-o, --fofile <filename>
|
|
26
|
+
specify XSL-FO output file (default: rdoc.fo)
|
|
27
|
+
-x, --xsldir <directory>
|
|
28
|
+
specify location of XSL stylesheets
|
|
29
|
+
|
|
30
|
+
- Defaults are set up to run from rdoc/contrib/xslfo/demo and operate
|
|
31
|
+
on the rdoc installation.
|
|
32
|
+
|
|
33
|
+
- Directories and files are assumed to be relative to current directory,
|
|
34
|
+
unless they start with "#{File::Separator}".
|
|
35
|
+
|
|
36
|
+
EOM
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
opts = GetoptLong.new(
|
|
40
|
+
[ "--dir", "-d", GetoptLong::REQUIRED_ARGUMENT ],
|
|
41
|
+
[ "--xsldir", "-x", GetoptLong::REQUIRED_ARGUMENT ],
|
|
42
|
+
[ "--xmlfile", "-f", GetoptLong::REQUIRED_ARGUMENT ],
|
|
43
|
+
[ "--interfile", "-i", GetoptLong::REQUIRED_ARGUMENT ],
|
|
44
|
+
[ "--fofile", "-o", GetoptLong::REQUIRED_ARGUMENT ],
|
|
45
|
+
[ "--help", "-h", GetoptLong::NO_ARGUMENT ]
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
opthash = {}
|
|
49
|
+
opts.each {|opt,arg| opthash[opt] = arg}
|
|
50
|
+
|
|
51
|
+
if opthash["--help"]
|
|
52
|
+
help
|
|
53
|
+
exit
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# The defaults are as per running this from rdoc/contrib/xslfo/demo.
|
|
57
|
+
rdocdir = opthash["--dir"] || "../../.."
|
|
58
|
+
fofile = opthash["--fofile"] || "rdoc.fo"
|
|
59
|
+
xmlfile = opthash["--xmlfile"]
|
|
60
|
+
interfile = opthash["--interfile"]
|
|
61
|
+
xsldir = opthash["--xsldir"] || "../../../contrib/xslfo"
|
|
62
|
+
|
|
63
|
+
(fofile,xmlfile,interfile,xsldir) = [fofile, xmlfile, interfile,xsldir].map do |file|
|
|
64
|
+
if file &&! /^#{File::Separator}/.match(file)
|
|
65
|
+
Dir.pwd + "/" + file
|
|
66
|
+
else
|
|
67
|
+
file
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
Dir.chdir(rdocdir)
|
|
72
|
+
|
|
73
|
+
out1 = if xmlfile then File.new(xmlfile) else Tempfile.new("out1") end
|
|
74
|
+
out2 = if interfile then File.new(interfile) else Tempfile.new("out2") end
|
|
75
|
+
|
|
76
|
+
unless xmlfile
|
|
77
|
+
$stdout = out1
|
|
78
|
+
|
|
79
|
+
# Inline version of the rdoc script.
|
|
80
|
+
begin
|
|
81
|
+
r = RDoc::RDoc.new
|
|
82
|
+
r.document(%w{--fmt xml})
|
|
83
|
+
rescue RDoc::RDocError => e
|
|
84
|
+
$stderr.puts e.message
|
|
85
|
+
exit(1)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
out1.close(false)
|
|
89
|
+
out1.open
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
system "saxon #{out1.path} #{xsldir}/convert.xsl > #{out2.path}"
|
|
93
|
+
|
|
94
|
+
unless interfile
|
|
95
|
+
out2.close(false)
|
|
96
|
+
out2.open
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
system "saxon #{out2.path} #{xsldir}/rdoc.xsl > #{fofile}"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: fcm.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
7
|
+
version="1.0">
|
|
8
|
+
|
|
9
|
+
<!-- Handling for file, Class, or Module, from their
|
|
10
|
+
respective lists -->
|
|
11
|
+
|
|
12
|
+
<xsl:template match="file-list/file|Class|Module">
|
|
13
|
+
<fo:block space-after="24pt">
|
|
14
|
+
<xsl:attribute name="id">
|
|
15
|
+
<xsl:value-of select="@id"/>
|
|
16
|
+
</xsl:attribute>
|
|
17
|
+
<xsl:call-template name="hr"/>
|
|
18
|
+
<fo:inline font-family="monospace" font-weight="bold">
|
|
19
|
+
<xsl:value-of select="@name"/>
|
|
20
|
+
</fo:inline>
|
|
21
|
+
<fo:block start-indent="6pt">
|
|
22
|
+
<xsl:apply-templates select="*[name() != 'description']"/>
|
|
23
|
+
<xsl:apply-templates select="*[name() = 'description']"/>
|
|
24
|
+
</fo:block>
|
|
25
|
+
</fo:block>
|
|
26
|
+
</xsl:template>
|
|
27
|
+
|
|
28
|
+
<xsl:template match="description">
|
|
29
|
+
<fo:block space-before="12pt" space-after="6pt" font-weight="bold"
|
|
30
|
+
start-indent="0pt">
|
|
31
|
+
<xsl:call-template name="labeled-list">
|
|
32
|
+
<xsl:with-param name="label">Description</xsl:with-param>
|
|
33
|
+
<xsl:with-param name="style">normal</xsl:with-param>
|
|
34
|
+
</xsl:call-template>
|
|
35
|
+
</fo:block>
|
|
36
|
+
<fo:block margin-right="36pt" font-size="9pt"
|
|
37
|
+
text-align="justify">
|
|
38
|
+
<xsl:apply-templates/>
|
|
39
|
+
</fo:block>
|
|
40
|
+
</xsl:template>
|
|
41
|
+
|
|
42
|
+
<xsl:template match="file/contents">
|
|
43
|
+
<fo:block start-indent="0pt">
|
|
44
|
+
<xsl:apply-templates/>
|
|
45
|
+
</fo:block>
|
|
46
|
+
</xsl:template>
|
|
47
|
+
|
|
48
|
+
<xsl:template match="Class/contents|Module/contents">
|
|
49
|
+
<fo:block>
|
|
50
|
+
<xsl:apply-templates/>
|
|
51
|
+
</fo:block>
|
|
52
|
+
</xsl:template>
|
|
53
|
+
|
|
54
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: files.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
7
|
+
version="1.0">
|
|
8
|
+
|
|
9
|
+
<xsl:template match="file-list">
|
|
10
|
+
<xsl:call-template name="top-level-file-list">
|
|
11
|
+
<xsl:with-param name="files" select="./file"/>
|
|
12
|
+
</xsl:call-template>
|
|
13
|
+
<xsl:apply-templates select="file">
|
|
14
|
+
<xsl:sort select="@name"/>
|
|
15
|
+
</xsl:apply-templates>
|
|
16
|
+
</xsl:template>
|
|
17
|
+
|
|
18
|
+
<xsl:template match="file-info">
|
|
19
|
+
<fo:block space-before="18pt" start-indent="0pt">
|
|
20
|
+
<xsl:call-template name="labeled-list">
|
|
21
|
+
<xsl:with-param name="label">Created</xsl:with-param>
|
|
22
|
+
<xsl:with-param name="items" select="dtm-created"/>
|
|
23
|
+
</xsl:call-template>
|
|
24
|
+
<xsl:call-template name="labeled-list">
|
|
25
|
+
<xsl:with-param name="label">Modified</xsl:with-param>
|
|
26
|
+
<xsl:with-param name="items" select="dtm-modified"/>
|
|
27
|
+
</xsl:call-template>
|
|
28
|
+
</fo:block>
|
|
29
|
+
</xsl:template>
|
|
30
|
+
|
|
31
|
+
<xsl:template match="required-file-list">
|
|
32
|
+
<xsl:call-template name="labeled-list">
|
|
33
|
+
<xsl:with-param name="label">Required files</xsl:with-param>
|
|
34
|
+
<xsl:with-param name="items" select="required-file"/>
|
|
35
|
+
</xsl:call-template>
|
|
36
|
+
</xsl:template>
|
|
37
|
+
|
|
38
|
+
<xsl:template name="top-level-file-list">
|
|
39
|
+
<xsl:param name="files"/>
|
|
40
|
+
<fo:block break-before="page" break-after="page">
|
|
41
|
+
<fo:block font-size="18pt" font-family="Helvetica" space-after="18pt">
|
|
42
|
+
<xsl:text>Files</xsl:text>
|
|
43
|
+
</fo:block>
|
|
44
|
+
<fo:block font-family="monospace">
|
|
45
|
+
<xsl:for-each select="$files">
|
|
46
|
+
<xsl:sort select="@name"/>
|
|
47
|
+
<fo:block start-indent="18pt">
|
|
48
|
+
<fo:inline>
|
|
49
|
+
<fo:basic-link color="purple">
|
|
50
|
+
<xsl:attribute name="internal-destination">
|
|
51
|
+
<xsl:value-of select="@id"/>
|
|
52
|
+
</xsl:attribute>
|
|
53
|
+
<xsl:apply-templates select="@name"/>
|
|
54
|
+
</fo:basic-link>
|
|
55
|
+
</fo:inline>
|
|
56
|
+
</fo:block>
|
|
57
|
+
</xsl:for-each>
|
|
58
|
+
</fo:block>
|
|
59
|
+
</fo:block>
|
|
60
|
+
</xsl:template>
|
|
61
|
+
|
|
62
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: labeled-lists.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
7
|
+
version="1.0">
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
The labeled-list template handles a lot of the work.
|
|
11
|
+
|
|
12
|
+
Each item in the node-list $items has a @name
|
|
13
|
+
and/or an @href. If it has an @href and no @name,
|
|
14
|
+
then the name comes from the name of the thing ref'd to.
|
|
15
|
+
(Failing that, it comes from the item contents itself.)
|
|
16
|
+
The @href value is used for the internal-destination
|
|
17
|
+
of the <fo:basic-link>.
|
|
18
|
+
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
<xsl:template name="labeled-list">
|
|
22
|
+
<xsl:param name="label"/>
|
|
23
|
+
<xsl:param name="labellee"/>
|
|
24
|
+
<xsl:param name="items"/>
|
|
25
|
+
<xsl:param name="style" select="'italic'"/>
|
|
26
|
+
<xsl:if test="$label">
|
|
27
|
+
<fo:block start-indent="0pt">
|
|
28
|
+
<fo:inline>
|
|
29
|
+
<xsl:attribute name="font-style">
|
|
30
|
+
<xsl:value-of select="$style"/>
|
|
31
|
+
</xsl:attribute>
|
|
32
|
+
<xsl:value-of select="concat($label,': ')"/>
|
|
33
|
+
</fo:inline>
|
|
34
|
+
<xsl:if test="$labellee">
|
|
35
|
+
<xsl:apply-templates select="$labellee"/>
|
|
36
|
+
</xsl:if>
|
|
37
|
+
</fo:block>
|
|
38
|
+
</xsl:if>
|
|
39
|
+
<xsl:if test="$items">
|
|
40
|
+
<xsl:for-each select="$items">
|
|
41
|
+
<xsl:sort select="@name"/>
|
|
42
|
+
<xsl:sort select="@name|key('id',@href)/@name"/>
|
|
43
|
+
<xsl:variable name="name" select="@name|key('id',@href)/@name"/>
|
|
44
|
+
<fo:block font-family="monospace" start-indent="12pt">
|
|
45
|
+
<xsl:choose>
|
|
46
|
+
<xsl:when test="@href">
|
|
47
|
+
<fo:basic-link color="purple">
|
|
48
|
+
<xsl:attribute name="internal-destination">
|
|
49
|
+
<xsl:value-of select="@href"/>
|
|
50
|
+
</xsl:attribute>
|
|
51
|
+
<xsl:value-of select="$name"/>
|
|
52
|
+
</fo:basic-link>
|
|
53
|
+
</xsl:when>
|
|
54
|
+
<xsl:when test="string-length($name)">
|
|
55
|
+
<xsl:value-of select="$name"/>
|
|
56
|
+
</xsl:when>
|
|
57
|
+
<xsl:otherwise>
|
|
58
|
+
<xsl:value-of select="."/>
|
|
59
|
+
</xsl:otherwise>
|
|
60
|
+
</xsl:choose>
|
|
61
|
+
</fo:block>
|
|
62
|
+
</xsl:for-each>
|
|
63
|
+
</xsl:if>
|
|
64
|
+
</xsl:template>
|
|
65
|
+
|
|
66
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: lists.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet
|
|
6
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
7
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
8
|
+
|
|
9
|
+
<xsl:template match="ul">
|
|
10
|
+
<fo:block start-indent="0pt">
|
|
11
|
+
<fo:list-block margin-left="18pt" space-after="12pt" margin-right="36pt"
|
|
12
|
+
provisional-distance-between-starts="18pt"
|
|
13
|
+
provisional-label-separation="9pt">
|
|
14
|
+
<xsl:apply-templates select="li"/>
|
|
15
|
+
</fo:list-block>
|
|
16
|
+
</fo:block>
|
|
17
|
+
</xsl:template>
|
|
18
|
+
|
|
19
|
+
<xsl:template match="method/description/ul">
|
|
20
|
+
<fo:block start-indent="0pt">
|
|
21
|
+
<fo:list-block margin-left="48pt" space-after="12pt" margin-right="36pt"
|
|
22
|
+
provisional-distance-between-starts="18pt"
|
|
23
|
+
provisional-label-separation="9pt">
|
|
24
|
+
<xsl:apply-templates select="li"/>
|
|
25
|
+
</fo:list-block>
|
|
26
|
+
</fo:block>
|
|
27
|
+
</xsl:template>
|
|
28
|
+
|
|
29
|
+
<xsl:template match="li">
|
|
30
|
+
<fo:list-item>
|
|
31
|
+
<fo:list-item-label end-indent="label-end()">
|
|
32
|
+
<fo:block text-align="start">
|
|
33
|
+
<xsl:text>•</xsl:text>
|
|
34
|
+
</fo:block>
|
|
35
|
+
</fo:list-item-label>
|
|
36
|
+
<fo:list-item-body>
|
|
37
|
+
<fo:block font-weight="normal" space-after="3pt">
|
|
38
|
+
<xsl:apply-templates/>
|
|
39
|
+
</fo:block>
|
|
40
|
+
</fo:list-item-body>
|
|
41
|
+
</fo:list-item>
|
|
42
|
+
</xsl:template>
|
|
43
|
+
|
|
44
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- $Id: modules.xsl,v 1.1 2003/10/10 08:00:05 wconrad Exp $ -->
|
|
3
|
+
<!-- $Author: wconrad $ -->
|
|
4
|
+
|
|
5
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
|
7
|
+
version="1.0">
|
|
8
|
+
|
|
9
|
+
<xsl:template match="class-module-list">
|
|
10
|
+
<xsl:call-template name="c-or-m-list">
|
|
11
|
+
<xsl:with-param name="label">Classes</xsl:with-param>
|
|
12
|
+
<xsl:with-param name="items" select="Class"/>
|
|
13
|
+
</xsl:call-template>
|
|
14
|
+
<xsl:call-template name="c-or-m-list">
|
|
15
|
+
<xsl:with-param name="label">Modules</xsl:with-param>
|
|
16
|
+
<xsl:with-param name="items" select="Module"/>
|
|
17
|
+
</xsl:call-template>
|
|
18
|
+
</xsl:template>
|
|
19
|
+
|
|
20
|
+
<xsl:template name="c-or-m-list">
|
|
21
|
+
<xsl:param name="items"/>
|
|
22
|
+
<xsl:param name="label"/>
|
|
23
|
+
<xsl:call-template name="top-level-cm-list">
|
|
24
|
+
<xsl:with-param name="label" select="$label"/>
|
|
25
|
+
<xsl:with-param name="items" select="$items"/>
|
|
26
|
+
</xsl:call-template>
|
|
27
|
+
<xsl:apply-templates select="$items">
|
|
28
|
+
<xsl:sort select="@name"/>
|
|
29
|
+
</xsl:apply-templates>
|
|
30
|
+
<xsl:call-template name="source-code">
|
|
31
|
+
<xsl:with-param name="label" select="$label"/>
|
|
32
|
+
<xsl:with-param name="method-list" select="$items/contents/method-list"/>
|
|
33
|
+
</xsl:call-template>
|
|
34
|
+
</xsl:template>
|
|
35
|
+
|
|
36
|
+
<xsl:template match="classmod-info">
|
|
37
|
+
<fo:block space-before="18pt">
|
|
38
|
+
<xsl:call-template name="labeled-list">
|
|
39
|
+
<xsl:with-param name="label">Defined in</xsl:with-param>
|
|
40
|
+
<xsl:with-param name="items" select="./infiles/infile"/>
|
|
41
|
+
</xsl:call-template>
|
|
42
|
+
<xsl:if test="superclass">
|
|
43
|
+
<xsl:call-template name="labeled-list">
|
|
44
|
+
<xsl:with-param name="label">Superclass</xsl:with-param>
|
|
45
|
+
<xsl:with-param name="items" select="superclass"/>
|
|
46
|
+
</xsl:call-template>
|
|
47
|
+
</xsl:if>
|
|
48
|
+
</fo:block>
|
|
49
|
+
</xsl:template>
|
|
50
|
+
|
|
51
|
+
<xsl:template match="included-module-list">
|
|
52
|
+
<xsl:call-template name="labeled-list">
|
|
53
|
+
<xsl:with-param name="label">Included modules</xsl:with-param>
|
|
54
|
+
<xsl:with-param name="items" select="./included-module"/>
|
|
55
|
+
</xsl:call-template>
|
|
56
|
+
</xsl:template>
|
|
57
|
+
|
|
58
|
+
<xsl:template match="method-list">
|
|
59
|
+
<xsl:call-template name="labeled-list">
|
|
60
|
+
<xsl:with-param name="label">Methods</xsl:with-param>
|
|
61
|
+
</xsl:call-template>
|
|
62
|
+
<xsl:apply-templates select="method"/>
|
|
63
|
+
</xsl:template>
|
|
64
|
+
|
|
65
|
+
<xsl:template name="top-level-cm-list">
|
|
66
|
+
<xsl:param name="label"/>
|
|
67
|
+
<xsl:param name="items"/>
|
|
68
|
+
<fo:block break-before="page" break-after="page">
|
|
69
|
+
<fo:block font-size="18pt" font-family="Helvetica" space-after="18pt">
|
|
70
|
+
<xsl:value-of select="$label"/>
|
|
71
|
+
</fo:block>
|
|
72
|
+
<fo:block font-family="monospace">
|
|
73
|
+
<xsl:for-each select="$items">
|
|
74
|
+
<xsl:sort select="@name"/>
|
|
75
|
+
<fo:block start-indent="18pt">
|
|
76
|
+
<fo:basic-link color="purple">
|
|
77
|
+
<xsl:attribute name="internal-destination">
|
|
78
|
+
<xsl:value-of select="@id"/>
|
|
79
|
+
</xsl:attribute>
|
|
80
|
+
<xsl:apply-templates select="@name"/>
|
|
81
|
+
</fo:basic-link>
|
|
82
|
+
</fo:block>
|
|
83
|
+
</xsl:for-each>
|
|
84
|
+
</fo:block>
|
|
85
|
+
</fo:block>
|
|
86
|
+
</xsl:template>
|
|
87
|
+
|
|
88
|
+
<xsl:template match="method">
|
|
89
|
+
<xsl:call-template name="labeled-list">
|
|
90
|
+
<xsl:with-param name="items" select="."/>
|
|
91
|
+
</xsl:call-template>
|
|
92
|
+
<xsl:if test="description">
|
|
93
|
+
<xsl:apply-templates select="description"/>
|
|
94
|
+
</xsl:if>
|
|
95
|
+
</xsl:template>
|
|
96
|
+
|
|
97
|
+
<xsl:template match="methodx">
|
|
98
|
+
<fo:block start-indent="12pt">
|
|
99
|
+
<fo:basic-link color="purple">
|
|
100
|
+
<xsl:attribute name="internal-destination">
|
|
101
|
+
<xsl:value-of select="@href"/>
|
|
102
|
+
</xsl:attribute>
|
|
103
|
+
<fo:inline font-family="monospace">
|
|
104
|
+
<xsl:value-of select="@name"/>
|
|
105
|
+
</fo:inline>
|
|
106
|
+
</fo:basic-link>
|
|
107
|
+
</fo:block>
|
|
108
|
+
<xsl:if test="description">
|
|
109
|
+
<xsl:apply-templates select="description"/>
|
|
110
|
+
</xsl:if>
|
|
111
|
+
</xsl:template>
|
|
112
|
+
|
|
113
|
+
<xsl:template match="attribute-list">
|
|
114
|
+
<xsl:variable name="read" select="./attribute[attribute-rw = 'R']"/>
|
|
115
|
+
<xsl:variable name="rw" select="./attribute[attribute-rw = 'W']"/>
|
|
116
|
+
<xsl:if test="$read">
|
|
117
|
+
<xsl:call-template name="labeled-list">
|
|
118
|
+
<xsl:with-param name="label" select="'Attributes (read-only)'"/>
|
|
119
|
+
</xsl:call-template>
|
|
120
|
+
<xsl:apply-templates select="$read">
|
|
121
|
+
<xsl:sort select="@name"/>
|
|
122
|
+
</xsl:apply-templates>
|
|
123
|
+
</xsl:if>
|
|
124
|
+
<xsl:if test="$rw">
|
|
125
|
+
<xsl:call-template name="labeled-list">
|
|
126
|
+
<xsl:with-param name="label" select="'Attributes (read/write)'"/>
|
|
127
|
+
</xsl:call-template>
|
|
128
|
+
<xsl:apply-templates select="$rw">
|
|
129
|
+
<xsl:sort select="@name"/>
|
|
130
|
+
</xsl:apply-templates>
|
|
131
|
+
</xsl:if>
|
|
132
|
+
</xsl:template>
|
|
133
|
+
|
|
134
|
+
<xsl:template match="attribute">
|
|
135
|
+
<fo:block start-indent="18pt">
|
|
136
|
+
<fo:block font-family="monospace">
|
|
137
|
+
<xsl:value-of select="@name"/>
|
|
138
|
+
</fo:block>
|
|
139
|
+
<xsl:if test="description">
|
|
140
|
+
<xsl:apply-templates select="description"/>
|
|
141
|
+
</xsl:if>
|
|
142
|
+
</fo:block>
|
|
143
|
+
</xsl:template>
|
|
144
|
+
|
|
145
|
+
<xsl:template match="attribute/description|method/description">
|
|
146
|
+
<fo:block start-indent="12pt" end-indent="48pt"
|
|
147
|
+
font-size="9pt" font-style="italic">
|
|
148
|
+
<xsl:apply-templates/>
|
|
149
|
+
</fo:block>
|
|
150
|
+
</xsl:template>
|
|
151
|
+
|
|
152
|
+
</xsl:stylesheet>
|