-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqlite2html.1
146 lines (146 loc) · 3.74 KB
/
sqlite2html.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.\" $Id$
.\"
.\" Copyright (c) 2016 Kristaps Dzonsons <[email protected]>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: June 30 2016 $
.Dt SQLITE2HTML 1
.Os
.Sh NAME
.Nm sqlite2html
.Nd convert sqlite3 schema to an HTML5 fragment
.\" .Sh LIBRARY
.\" For sections 2, 3, and 9 only.
.\" Not used in OpenBSD.
.Sh SYNOPSIS
.Nm sqlite2html
.Op Fl v
.Op Fl p Ar prefix
.Op Ar schema
.Sh DESCRIPTION
The
.Nm
utility converts an
.Xr sqlite3 1
schema file to an HTML5 fragment.
Its options are as follows:
.Bl -tag -width Ds
.It Fl v
Causes the parser to emit informational messages on stderr.
.It Fl p Ar prefix
Prefix to use for creating HTML ID tags.
.It Ar schema
An SQLite schema file.
.Pp
The outputted HTML5 fragment consists of a
.Li <dl class="tabs">
list consisting of tables; and then for each table, a
.Li <dl class="cols">
list of columns.
The
.Li <dt>
for each list entry consists of the name of the table or column and has
its ID attribute set to the transformed name.
The
.Li <dd>
for each list begins with a
.Li <div class="comment">
if the table or column is preceeded by comments
For columns with a foreign key reference, this will be preceeded by
.Li <div class="foreign">
containing an anchor to the key having a text node of the endpoint.
.Pp
The
.Li @
character within a comment is special: the following table name and
optional column name will be transformed into an HTML link to the
identifier.
Thus,
.Li @foo.bar
will point to the
.Dq bar
column in table
.Dq foo .
If this identifier is not followed by white-space, you may quote the
identifier to prevent subsequent characters from being pulled into the
identifier, e.g.,
.Li @"foo.bar" .
If you wish to print a standalone
.Li @ ,
you may escape it with a backslash
.Pq Dq \e .
.Pp
The
.Li [
character is similar, as it encloses general-purpose links in a manner
similar to Markdown.
Links are formatted as follows:
.Bl -item
.It
.Li [link text](http://link)
.It
.Li [http://link]
.El
.Pp
You can escape the
.Li [
character as well, to prevent this behaviour.
.Pp
The following sequences are also special:
.Bl -tag -width Ds
.It Li --
Print an formatted n-dash.
.It Li ---
Print an formatted m-dash.
.It Li ``
Print formatted left-double quotes.
.It Li ''
Print formatted right-double quotes.
.El
.Pp
Any of these may be escaped with the backslash to have it print as-is.
If you wish to print a backslash, you must escape it, for example,
.Li the \e\e-character---and an \e@-sign .
.Pp
Lastly, a blank (without any white-space but the newline!) one-line
comment line is considered to be a paragraph break, for example:
.Bd -literal
-- Hello, world.
--
-- And after the break...
.Ed
.Pp
In multi-line comment, this can be affected with a blank line in the
comment stream:
.Bd -literal
/*
* Hello, world.
*
* That was another line break.
*/
.Ed
.Sh SEE ALSO
.Xr sqlite2dot 1 ,
.Xr sqlite3 1
.\" .Sh STANDARDS
.\" .Sh HISTORY
.\" .Sh AUTHORS
.Sh CAVEATS
The schema language accepted by
.Nm
is currently limited to the table declaration with a subset of the
column specification.
.\" .Sh BUGS
.\" .Sh SECURITY CONSIDERATIONS
.\" Not used in OpenBSD.