Skip to content

Commit 8aa5776

Browse files
committed
docs: Import podwrapper from nbdkit.
1 parent 9c3e912 commit 8aa5776

File tree

8 files changed

+731
-1
lines changed

8 files changed

+731
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ Makefile.in
2424
/config.sub
2525
/configure
2626
/depcomp
27+
/docs/libnbd.3
2728
/examples/threaded-reads-and-writes
2829
/examples/simple-fetch-first-sector
2930
/examples/simple-reads-and-writes
3031
/generator/stamp-generator
32+
/html/*.?.html
3133
/include/libnbd.h
3234
/lib/api.c
3335
/lib/libnbd.syms
@@ -43,6 +45,7 @@ Makefile.in
4345
/m4/ltversion.m4
4446
/m4/lt~obsolete.m4
4547
/missing
48+
/podwrapper.pl
4649
/python/libnbdmod.c
4750
/python/methods.c
4851
/python/methods.h

Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ include $(top_srcdir)/common-rules.mk
1919

2020
ACLOCAL_AMFLAGS = -I m4
2121

22+
EXTRA_DIST = \
23+
html/pod.css
24+
2225
SUBDIRS = \
2326
generator \
2427
include \

README

+2
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ Optional:
2020
* The nbdkit command, nbdkit-sh-plugin and nbdkit development headers
2121
are recommended as they are needed to run the test suite.
2222

23+
* Perl Pod::Man and Pod::Simple to generate the documentation.
24+
2325
* Python >= 3.3 to build the Python 3 bindings and NBD shell (nbdsh).

configure.ac

+20
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ AS_IF([test "x$NBDKIT" != "x"], [
8181
])
8282
AM_CONDITIONAL([HAVE_NBDKIT], [test "x$NBDKIT" != "x" && test "x$have_nbdkit_devel" = "xyes" && test "x$have_nbdkit_sh_plugin" = "xyes"])
8383

84+
dnl Check we have enough to run podwrapper.
85+
AC_CHECK_PROG([PERL],[perl],[perl],[no])
86+
AS_IF([test "x$PERL" != "xno"],[
87+
AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple])
88+
AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[
89+
enable_pod=yes
90+
],[
91+
enable_pod=no
92+
])
93+
AC_MSG_RESULT([$enable_pod])
94+
])
95+
AM_CONDITIONAL([HAVE_POD],
96+
[test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"])
97+
98+
dnl Define the path to the podwrapper program.
99+
PODWRAPPER="$PERL $(pwd)/podwrapper.pl"
100+
AC_SUBST([PODWRAPPER])
101+
84102
dnl Python, optional for the Python bindings and shell.
85103
PYTHON_PREFIX=
86104
PYTHON_VERSION=
@@ -156,6 +174,8 @@ AM_CONDITIONAL([HAVE_PYTHON],
156174
dnl Produce output files.
157175
AC_CONFIG_HEADERS([config.h])
158176

177+
AC_CONFIG_FILES([podwrapper.pl],
178+
[chmod +x,-w podwrapper.pl])
159179
AC_CONFIG_FILES([python/run-python-tests],
160180
[chmod +x,-w python/run-python-tests])
161181
AC_CONFIG_FILES([run],

docs/Makefile.am

+13
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,16 @@ include $(top_srcdir)/subdir-rules.mk
1919

2020
EXTRA_DIST = \
2121
libnbd.pod
22+
23+
if HAVE_POD
24+
25+
man_MANS = \
26+
libnbd.3
27+
CLEANFILES += $(man_MANS)
28+
29+
libnbd.3: libnbd.pod
30+
$(PODWRAPPER) --section=3 --man $@ \
31+
--html $(top_builddir)/html/$@.html \
32+
$<
33+
34+
endif HAVE_POD

docs/libnbd.pod

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=head1 NAME
22

3-
libnbd - NBD client library in userspace
3+
libnbd - network block device (NBD) client library in userspace
44

55
=head1 SYNOPSIS
66

@@ -157,3 +157,23 @@ until the connection becomes ready:
157157
}
158158
}
159159

160+
161+
162+
163+
164+
165+
166+
167+
168+
=head1 SEE ALSO
169+
170+
L<nbdkit(1)>,
171+
L<qemu(1)>.
172+
173+
=head1 AUTHORS
174+
175+
Richard W.M. Jones
176+
177+
=head1 COPYRIGHT
178+
179+
Copyright (C) 2019 Red Hat Inc.

html/pod.css

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* CSS to make pod2html files look a little bit better. */
2+
3+
body {
4+
margin-left: 4em;
5+
}
6+
7+
body p, body ul, ol, body dl {
8+
margin-left: 2em;
9+
width: 31em;
10+
}
11+
12+
pre {
13+
width: 31em;
14+
}
15+
16+
li {
17+
padding-bottom: 0.5em;
18+
}
19+
20+
/* Code sections. */
21+
22+
pre {
23+
background-color: #f8f8f8;
24+
color: rgb(204,0,0);
25+
font-weight: 550;
26+
border-left: 6px solid rgb(204,64,64);
27+
padding: 6px;
28+
margin-left: 1em;
29+
font-size: 120%;
30+
}
31+
32+
/* Bold, italic in man pages. */
33+
b, strong {
34+
color: rgb(204,0,0);
35+
}
36+
37+
i, em {
38+
color: rgb(204,0,0);
39+
}
40+
41+
/* Name heading. */
42+
43+
body > h1:first-of-type {
44+
display: none;
45+
}
46+
47+
body > h1:first-of-type + p {
48+
font-size: 125%;
49+
font-weight: bold;
50+
color: rgb(204,0,0);
51+
margin-left: -32px;
52+
}
53+
54+
/* Warning heading in man pages. */
55+
a[name="warning"] {
56+
-moz-border-radius-topleft: 5px;
57+
-moz-border-radius-topright: 5px;
58+
border-radius-topleft: 5px;
59+
border-radius-topright: 5px;
60+
61+
color: white;
62+
background-color: rgb(204,0,0);
63+
}
64+
a[name="warning"]:before {
65+
content: "\00a0\00a0\00a0";
66+
}
67+
a[name="warning"]:after {
68+
content: "\00a0\00a0\00a0";
69+
}
70+
71+
/* Put the index on the right hand side in a floating box. */
72+
ul[id="index"] {
73+
float: right;
74+
width: 18em;
75+
border-left: 3em solid white;
76+
background-color: #fcfcfc;
77+
margin-top: 32px;
78+
padding-top: 0px;
79+
margin-left: 1em;
80+
padding-left: 1em;
81+
padding-right: 1em;
82+
font-size: 90%;
83+
}
84+
85+
ul[id="index"] a[href] {
86+
text-decoration: none;
87+
}
88+
89+
ul[id="index"] a[href]:hover {
90+
text-decoration: underline;
91+
}
92+
93+
ul[id="index"] a[href]:before {
94+
content: '#\00a0';
95+
color: rgb(204,0,0);
96+
font-size: x-small;
97+
}
98+
99+
ul[id="index"] {
100+
width: 17em;
101+
list-style: none;
102+
margin-left: 0px;
103+
margin-right: 0px;
104+
padding-left: 0px;
105+
padding-right: 0px;
106+
}
107+
108+
ul[id="index"] > li {
109+
margin-bottom: 0.5em;
110+
}
111+
112+
ul[id="index"] > li ul {
113+
width: 16em;
114+
list-style: none;
115+
margin-left: 0px;
116+
margin-right: 0px;
117+
padding-left: 0px;
118+
padding-right: 0px;
119+
margin-bottom: 0.5em;
120+
}
121+
122+
ul[id="index"] > li ul li {
123+
display: inline;
124+
margin-right: 1em;
125+
}
126+
127+
/*
128+
ul[id="index"] > li ul li:after {
129+
color: #ccc;
130+
content: '\2014';
131+
}
132+
*/
133+
134+
/* Get rid of those horrible <hr>'s :-( */
135+
hr { display: none; }
136+
137+
/* Demote <h1>'s and set rest of headers relative. */
138+
h1 {
139+
font-size: 100%;
140+
color: black;
141+
border-bottom: solid 1px rgb(204,0,0);
142+
}
143+
144+
h2 {
145+
font-size: 95%;
146+
border-bottom: none;
147+
}
148+
149+
h3 {
150+
font-size: 90%;
151+
}
152+
153+
h4 {
154+
font-size: 85%;
155+
}

0 commit comments

Comments
 (0)