From fa46f3f56207a5edc5c6d56a58768b34c1a4c212 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 12 Sep 2010 15:12:35 +0200 Subject: Add odb man and html pages generation --- doc/Makefile.am | 8 ++ doc/default.css | 319 +++++++++++++++++++++++++++++++++++++++++++++++++ doc/makefile | 68 +++++++++++ doc/odb-epilogue.1 | 23 ++++ doc/odb-epilogue.xhtml | 26 ++++ doc/odb-prologue.1 | 60 ++++++++++ doc/odb-prologue.xhtml | 80 +++++++++++++ makefile | 4 +- 8 files changed, 585 insertions(+), 3 deletions(-) create mode 100644 doc/Makefile.am create mode 100644 doc/default.css create mode 100644 doc/makefile create mode 100644 doc/odb-epilogue.1 create mode 100644 doc/odb-epilogue.xhtml create mode 100644 doc/odb-prologue.1 create mode 100644 doc/odb-prologue.xhtml 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 +# 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 +# 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 @@ +

DIAGNOSTICS

+ +

If the input file is not valid C++, odb + will issue diagnostic messages to STDERR and exit with non-zero exit + code.

+ +

BUGS

+ +

Send bug reports to the + odb-users@codesynthesis.com mailing list.

+ + + + + + 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 @@ + + + + + ODB 1.0.0 Compiler Command Line Manual + + + + + + + + + + + +
+
+ +

NAME

+ +

odb - object-relational mapping (ORM) compiler for C++

+ +

SYNOPSIS

+ +
+
odb [options] file [file...]
+
+ +

DESCRIPTION

+ +

Given a set of C++ classes in a header file, 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 --database option (see below).

+ +

For an input file in the form name.hxx (other + file extensions can be used instead of .hxx), + the following C++ files are generated: + name-odb.hxx (header file), + name-odb.ixx (inline file, generated unless + the --suppress-inline option is specified), and + name-odb.cxx (source file). + + Additionally, if the --generate-schema option is + specified and the target database supports it, the name.sql database + schema file is generated.

+ +

OPTIONS

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) -- cgit v1.1