aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-12 15:12:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-12 15:12:35 +0200
commitfa46f3f56207a5edc5c6d56a58768b34c1a4c212 (patch)
treea294e7cafe97e4a6fab9790b9361dfd8ea9d3bc4
parent93a7d00f000427aab95e0d5fe5aa712e46b36301 (diff)
Add odb man and html pages generation
-rw-r--r--doc/Makefile.am8
-rw-r--r--doc/default.css319
-rw-r--r--doc/makefile68
-rw-r--r--doc/odb-epilogue.123
-rw-r--r--doc/odb-epilogue.xhtml26
-rw-r--r--doc/odb-prologue.160
-rw-r--r--doc/odb-prologue.xhtml80
-rw-r--r--makefile4
8 files changed, 585 insertions, 3 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..c48bff1
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,8 @@
+# file : doc/Makefile.am
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+dist_doc_DATA = __file__(docs)
+dist_man_MANS = __file__(mans)
+EXTRA_DIST = __file__(extra_dist)
diff --git a/doc/default.css b/doc/default.css
new file mode 100644
index 0000000..bb3805b
--- /dev/null
+++ b/doc/default.css
@@ -0,0 +1,319 @@
+html {
+ margin : 0;
+ padding : 0;
+ background : white;
+}
+
+body {
+ font-family : "Lucida Grande", Verdana, "Bitstream Vera Sans", sans-serif;
+ font-weight : normal;
+ font-size : 13px;
+ line-height : 19px;
+
+ color : black;
+
+ margin : 0 2em 0 2em;
+ padding : 0;
+}
+
+
+body {
+ min-width: 40em;
+}
+
+#container {
+ max-width : 46em;
+ margin : 0 auto;
+ padding : 0 1em 0 1em;
+}
+
+
+
+/*
+ * Footer
+ *
+ */
+#footer {
+ color : #3a84a7;
+
+ padding : 1em 0 0.5em 0;
+
+ font-size : 10px;
+ line-height : 15px;
+
+ text-align: center;
+}
+
+#footer a:link, #footer a:visited {
+
+ color:#1d6699;
+ text-decoration: underline;
+}
+
+#footer a {
+ margin-left: 0.7em;
+ margin-right: 0.7em;
+}
+
+#footer p {
+ padding: 0;
+ margin: 0.3em 0 0 0;
+}
+
+/* Distribution terms. */
+#footer #terms {
+ text-align: justify;
+
+ font-size : 110%;
+ font-family : monospace;
+
+ padding : 1em 0 0.5em 0;
+}
+
+
+/*
+ * Content
+ *
+ */
+
+#content {
+ padding : 0em 0.1em 0 1.3em;
+ margin : 1.4em 0 0 0;
+}
+
+#content p,
+#content ol,
+#content ul,
+#content dl {
+ text-align: justify;
+}
+
+#content h1 {
+ margin-left: -0.89em;
+}
+
+a:link {
+ color:#0536d2;
+}
+
+
+/*
+ * Headings
+ *
+ */
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight : 500;
+}
+
+h1 { font-size : 155%; }
+h2 { font-size : 130%; }
+h3 { font-size : 125%; }
+h4 { font-size : 110%; }
+h5 { font-size : 106%; }
+h6 { font-size : 100%; }
+
+h1 { margin : 1.8em 0 0.8em 0;}
+h2 { margin-top : 1.4em;}
+h3 { margin-top : 1em;}
+
+p.indent {
+ margin-left : 1.5em;
+}
+
+
+/*
+ * Fix for IE 5.5 table font problem
+ *
+ */
+
+table {
+ font-size : 13px;
+}
+
+
+/*
+ * table of content
+ *
+ */
+
+ul.toc li {
+ padding : .4em 0em 0em 0em;
+}
+
+
+/* Toc links don't need to show when they are visited. */
+.toc a:visited {
+ color:#0536d2;
+}
+
+
+/*
+ * lists
+ *
+ */
+
+
+/* list of links */
+ul.menu {
+ list-style-type : none;
+}
+
+ul.menu li {
+ padding-top : 0.3em;
+ padding-bottom : 0.3em;
+}
+
+
+
+/* @@ I should probably use child selector here */
+/* list with multiline list-elements */
+ul.multiline li, ol.multiline li, dl.multiline dd {
+ padding-top : 0.16em;
+ padding-bottom : 0.16em;
+
+ font-size : 11px;
+ line-height : 15px;
+}
+
+
+
+/* C++ code snippet */
+pre.cxx {
+ margin-top : 0em;
+ margin-bottom : 2em;
+
+ margin-left : 1em;
+}
+
+
+
+/* make code snippet */
+pre.make {
+ margin-top : 0em;
+ margin-bottom : 2em;
+
+ margin-left : 1em;
+}
+
+
+
+/* terminal output */
+pre.term {
+ margin-top : 0em;
+ margin-bottom : 2em;
+
+ margin-left : 1em;
+}
+
+
+/* Images */
+div.center {
+ text-align: center;
+}
+
+/* Document info. */
+#docinfo {
+ margin-top: 4em;
+ border-top: 1px dashed #000000;
+ font-size: 70%;
+}
+
+
+/* Footnote */
+
+#footnote {
+ margin-top : 2.5em;
+}
+
+#footnote hr, hr.footnote {
+ margin-left: 0;
+ margin-bottom: 0.6em;
+ width: 8em;
+ border-top: 1px solid #000000;
+ border-right: none;
+ border-bottom: none;
+ border-left: none;
+
+}
+
+#footnote ol {
+ margin-left: 0;
+ padding-left: 1.45em;
+}
+
+#footnote li {
+ text-align : left;
+ font-size : 11px;
+ line-height : 15px;
+
+ padding : .4em 0 .4em 0;
+}
+
+
+/* Normal table with borders, etc. */
+
+table.std {
+ margin: 2em 0 2em 0;
+
+ border-collapse : collapse;
+ border : 1px solid;
+ border-color : #000000;
+
+ font-size : 11px;
+ line-height : 14px;
+}
+
+table.std th, table.std td {
+ border : 1px solid;
+ padding : 0.6em 0.8em 0.6em 0.8em;
+}
+
+table.std th {
+ background : #cde8f6;
+}
+
+table.std td {
+ text-align: left;
+}
+
+
+/*
+ * "item | description" table.
+ *
+ */
+
+table.description {
+ border-style : none;
+ border-collapse : separate;
+ border-spacing : 0;
+
+ font-size : 13px;
+
+ margin : 0.6em 0 0.6em 0;
+ padding : 0 0 0 0;
+}
+
+table.description tr {
+ padding : 0 0 0 0;
+ margin : 0 0 0 0;
+}
+
+table.description * td, table.description * th {
+ border-style : none;
+ margin : 0 0 0 0;
+ vertical-align : top;
+}
+
+table.description * th {
+ font-weight : normal;
+ padding : 0.4em 1em 0.4em 0;
+ text-align : left;
+ white-space : nowrap;
+ background : none;
+}
+
+table.description * td {
+ padding : 0.4em 0 0.4em 1em;
+ text-align : justify;
+}
diff --git a/doc/makefile b/doc/makefile
new file mode 100644
index 0000000..f0c38a3
--- /dev/null
+++ b/doc/makefile
@@ -0,0 +1,68 @@
+# file : doc/makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
+
+default := $(out_base)/
+dist := $(out_base)/.dist
+clean := $(out_base)/.clean
+
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/cli/stub.make,\
+ cli: cli,cli-rules: cli_rules)
+
+# Build.
+#
+$(default): $(out_base)/odb.xhtml $(out_base)/odb.1
+
+$(out_base)/odb.xhtml $(out_base)/odb.1: cli := $(cli)
+
+$(out_base)/odb.xhtml: $(src_root)/odb/options.cli \
+ $(src_base)/odb-prologue.xhtml \
+ $(src_base)/odb-epilogue.xhtml
+ $(call message,cli-html $<,$(cli) --generate-html --stdout \
+--html-prologue $(src_base)/odb-prologue.xhtml \
+--html-epilogue $(src_base)/odb-epilogue.xhtml $< >$@)
+
+$(out_base)/odb.1: $(src_root)/odb/options.cli \
+ $(src_base)/odb-prologue.1 \
+ $(src_base)/odb-epilogue.1
+ $(call message,cli-man $<,$(cli) --generate-man --stdout \
+--man-prologue $(src_base)/odb-prologue.1 \
+--man-epilogue $(src_base)/odb-epilogue.1 $< >$@)
+
+# Dist.
+#
+$(dist): data_dist := default.css
+$(dist): export docs := odb.xhtml
+$(dist): export mans := odb.1
+$(dist): export extra_dist := $(data_dist)
+$(dist): $(out_base)/odb.xhtml $(out_base)/odb.1
+ $(call dist-data,$(data_dist))
+ $(call dist-data,$(out_base)/odb.1)
+ $(call dist-data,$(out_base)/odb.xhtml)
+ $(call meta-automake)
+
+# Clean.
+#
+$(clean):
+ $(call message,rm $$1,rm -f $$1,$(out_base)/odb.xhtml)
+ $(call message,rm $$1,rm -f $$1,$(out_base)/odb.1)
+
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(out_base)/odb.xhtml $(out_base)/odb.1: | $(out_base)/.gitignore
+
+$(out_base)/.gitignore: files := odb.xhtml odb.1
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
+
+$(call include,$(bld_root)/dist.make)
+$(call include,$(bld_root)/meta/automake.make)
diff --git a/doc/odb-epilogue.1 b/doc/odb-epilogue.1
new file mode 100644
index 0000000..3a8d971
--- /dev/null
+++ b/doc/odb-epilogue.1
@@ -0,0 +1,23 @@
+.\"
+.\" DIAGNOSTICS
+.\"
+.SH DIAGNOSTICS
+If the input file is not valid C++,
+.B odb
+will issue diagnostic messages to STDERR and exit with non-zero exit code.
+.\"
+.\" BUGS
+.\"
+.SH BUGS
+Send bug reports to the odb-users@codesynthesis.com mailing list.
+.\"
+.\" COPYRIGHT
+.\"
+.SH COPYRIGHT
+Copyright (c) 2009-2010 Code Synthesis Tools CC.
+
+Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License,
+version 1.2; with no Invariant Sections, no Front-Cover Texts and
+no Back-Cover Texts. Copy of the license can be obtained from
+http://www.codesynthesis.com/licenses/fdl-1.3.txt
diff --git a/doc/odb-epilogue.xhtml b/doc/odb-epilogue.xhtml
new file mode 100644
index 0000000..5663c16
--- /dev/null
+++ b/doc/odb-epilogue.xhtml
@@ -0,0 +1,26 @@
+ <h1>DIAGNOSTICS</h1>
+
+ <p>If the input file is not valid C++, <code><b>odb</b></code>
+ will issue diagnostic messages to STDERR and exit with non-zero exit
+ code.</p>
+
+ <h1>BUGS</h1>
+
+ <p>Send bug reports to the
+ <a href="mailto:odb-users@codesynthesis.com">odb-users@codesynthesis.com</a> mailing list.</p>
+
+ </div>
+ <div id="footer">
+ &copy;2009-2010 <a href="http://www.codesynthesis.com">Code Synthesis Tools CC</a>
+
+ <div id="terms">
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the
+ <a href="http://codesynthesis.com/licenses/fdl-1.3.txt">GNU Free
+ Documentation License, version 1.3</a>; with no Invariant Sections,
+ no Front-Cover Texts and no Back-Cover Texts.
+ </div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/doc/odb-prologue.1 b/doc/odb-prologue.1
new file mode 100644
index 0000000..01c933f
--- /dev/null
+++ b/doc/odb-prologue.1
@@ -0,0 +1,60 @@
+.\" Process this file with
+.\" groff -man -Tascii odb.1
+.\"
+.TH ODB 1 "September 2010" "ODB 1.0.0"
+.SH NAME
+odb \- object-relational mapping (ORM) compiler for C++
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH SYNOPSIS
+.\"--------------------------------------------------------------------
+.B odb
+.B [
+.I options
+.B ]
+.I file
+.B [
+.IR file...
+.B ]
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH DESCRIPTION
+.\"--------------------------------------------------------------------
+Given a set of C++ classes in a header file,
+.B odb
+generates C++ code that allows you to persist, query, and update objects
+of these classes in a relational database (RDBMS). The relational
+database that the generated code should target is specified with the
+required
+.B --database
+option (see below).
+
+
+For an input file in the form
+.B name.hxx
+(other file extensions can be used instead of
+.BR .hxx ),
+the following C++ files are generated:
+.B name-odb.hxx
+(header file),
+.B name-odb.ixx
+(inline file, generated unless
+the
+.B --suppress-inline
+option is specified), and
+.B name-odb.cxx
+(source file). Additionally, if the
+.B --generate-schema
+option is specified and the target database supports it, the
+.B name.sql
+database schema file is generated.
+.\"
+.\"
+.\"
+.\"--------------------------------------------------------------------
+.SH OPTIONS
+.\"--------------------------------------------------------------------
diff --git a/doc/odb-prologue.xhtml b/doc/odb-prologue.xhtml
new file mode 100644
index 0000000..b1efb70
--- /dev/null
+++ b/doc/odb-prologue.xhtml
@@ -0,0 +1,80 @@
+<!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>ODB 1.0.0 Compiler Command Line Manual</title>
+
+ <meta name="copyright" content="&copy; 2009-2010 Code Synthesis Tools CC"/>
+ <meta name="keywords" content="odb,object,relational,mapping,compiler,c++"/>
+ <meta name="description" content="ODB Compiler Command Line Manual"/>
+
+ <link rel="stylesheet" type="text/css" href="default.css" />
+
+<style type="text/css">
+
+ #synopsis {
+ list-style-type: none;
+ }
+
+ #synopsis li {
+ padding-top : 0.0em;
+ padding-bottom : 0.0em;
+ }
+
+ #commands dt {
+ padding-top : 0.4em;
+ }
+
+ #commands dd {
+ padding-bottom : 0.4em;
+ padding-left : 2em;
+ }
+
+ .options dt {
+ padding-top : 0.4em;
+ }
+
+ .options dd {
+ padding-top : 0.1em;
+ padding-bottom : 0.4em;
+ padding-left : 1.4em;
+ }
+
+</style>
+</head>
+
+<body>
+<div id="container">
+ <div id="content">
+
+ <h1>NAME</h1>
+
+ <p>odb - object-relational mapping (ORM) compiler for C++</p>
+
+ <h1>SYNOPSIS</h1>
+
+ <dl id="synopsis">
+ <dt><code><b>odb</b> [<i>options</i>] <i>file</i> [<i>file</i>...]</code></dt>
+ </dl>
+
+ <h1>DESCRIPTION</h1>
+
+ <p>Given a set of C++ classes in a header file, <code><b>odb</b></code>
+ generates C++ code that allows you to persist, query, and update objects
+ of these classes in a relational database (RDBMS). The relational
+ database that the generated code should target is specified with the
+ required <code><b>--database</b></code> option (see below).</p>
+
+ <p>For an input file in the form <code><b>name.hxx</b></code> (other
+ file extensions can be used instead of <code><b>.hxx</b></code>),
+ the following C++ files are generated:
+ <code><b>name-odb.hxx</b></code> (header file),
+ <code><b>name-odb.ixx</b></code> (inline file, generated unless
+ the <code><b>--suppress-inline</b></code> option is specified), and
+ <code><b>name-odb.cxx</b></code> (source file).
+
+ Additionally, if the <code><b>--generate-schema</b></code> option is
+ specified and the target database supports it, the <code><b>name.sql</b></code> database
+ schema file is generated.</p>
+
+ <h1>OPTIONS</h1>
diff --git a/makefile b/makefile
index ff3735b..2448e2e 100644
--- a/makefile
+++ b/makefile
@@ -5,12 +5,11 @@
include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make
-dirs := odb
+dirs := odb doc
default := $(out_base)/
dist := $(out_base)/.dist
clean := $(out_base)/.clean
-cleandoc := $(out_base)/.cleandoc
$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs)))
@@ -29,7 +28,6 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs)))
$(call meta-autoconf)
$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs)))
-$(cleandoc): $(out_base)/doc/.cleandoc
$(call include,$(bld_root)/dist.make)
$(call include,$(bld_root)/meta/automake.make)