aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2019-02-13 15:41:37 +0100
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2019-02-13 15:41:37 +0100
commitc70ec7fb678d3c0d3c9ae5db7b589b7c05103338 (patch)
treef34ed51b2158218fc82e670ba0c2eafa47bdb69e
parentf3c138b4952d0ed709ef4235e34f749e0e31553e (diff)
downloadembedlog-c70ec7fb678d3c0d3c9ae5db7b589b7c05103338.tar.gz
embedlog-c70ec7fb678d3c0d3c9ae5db7b589b7c05103338.tar.bz2
embedlog-c70ec7fb678d3c0d3c9ae5db7b589b7c05103338.zip
some visual tweaks to manual pages
-rwxr-xr-xgen-download-page.sh2
-rw-r--r--man/el_cleanup.32
-rw-r--r--man/el_init.36
-rw-r--r--man/el_option.36
-rw-r--r--man/el_print.334
-rwxr-xr-xman2html.sh12
-rw-r--r--www/Makefile.am1
-rw-r--r--www/custom.css5
-rwxr-xr-xwww/post-process.sh4
9 files changed, 45 insertions, 27 deletions
diff --git a/gen-download-page.sh b/gen-download-page.sh
index 0e51208..c5a7c50 100755
--- a/gen-download-page.sh
+++ b/gen-download-page.sh
@@ -22,7 +22,7 @@ exec 6>&1
exec 1<>"${out}"
echo > "${out}"
-echo "<h1>downloads</h1>"
+echo "<h1 class=\"first\">downloads</h1>"
echo "<p>"
echo "Below you can find source files and binary packages for various systems."
echo "<b>(s)</b> right of package name is a gpg signature. You can download"
diff --git a/man/el_cleanup.3 b/man/el_cleanup.3
index a60dc41..627a479 100644
--- a/man/el_cleanup.3
+++ b/man/el_cleanup.3
@@ -56,4 +56,4 @@ Passed options object is not valid
.BR el_oprint (3),
.BR el_ovprint (3),
.BR el_operror (3),
-.BR el_opmemory (3),
+.BR el_opmemory (3).
diff --git a/man/el_init.3 b/man/el_init.3
index 8b920e1..b44d57e 100644
--- a/man/el_init.3
+++ b/man/el_init.3
@@ -75,7 +75,7 @@ is invalid (null).
.PP
Note: error handling has been ommited for clarity sake
.PP
-.EX
+.nf
#include <embedlog.h>
int main(void)
@@ -100,7 +100,7 @@ Note: error handling has been ommited for clarity sake
return 0;
}
-.EE
+.fi
.SH SEE ALSO
.PP
.BR el_init (3),
@@ -120,4 +120,4 @@ Note: error handling has been ommited for clarity sake
.BR el_oprint (3),
.BR el_ovprint (3),
.BR el_operror (3),
-.BR el_opmemory (3),
+.BR el_opmemory (3).
diff --git a/man/el_option.3 b/man/el_option.3
index 4c2ac2c..4691685 100644
--- a/man/el_option.3
+++ b/man/el_option.3
@@ -330,7 +330,7 @@ lowest resolution possible.
Table will show exacly what this is about.
Example uses long timestamp, interesting part is after date after dot '.'.
.PP
-.EX
+.nf
+-----------------+-------------------------------+
| value | resulting timestamp string |
+-----------------+-------------------------------+
@@ -339,7 +339,7 @@ Example uses long timestamp, interesting part is after date after dot '.'.
| EL_TS_FRACT_US | 2018-04-17 22:02:57.070518 |
| EL_TS_FRACT_NS | 2018-04-17 22:02:57.070518782 |
+-----------------+-------------------------------+
-.EE
+.fi
.RE
.PP
.BI "EL_PRINT_LEVEL (" int " print)"
@@ -625,4 +625,4 @@ informations
.BR el_oprint (3),
.BR el_ovprint (3),
.BR el_operror (3),
-.BR el_opmemory (3),
+.BR el_opmemory (3).
diff --git a/man/el_print.3 b/man/el_print.3
index 550bda6..0a74d73 100644
--- a/man/el_print.3
+++ b/man/el_print.3
@@ -195,7 +195,7 @@ Example output can look like this.
We print all ascii table, to present printing of printable and non-printable
values.
.PP
-.EX
+.nf
0x0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................
0x0010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f ................
0x0020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f !"#$%&'()*+,-./
@@ -204,14 +204,14 @@ values.
0x0050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f PQRSTUVWXYZ[\]^_
0x0060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f `abcdefghijklmno
0x0070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f pqrstuvwxyz{|}~.
-.EE
+.fi
.PP
.BR el_pmemory_table (3)
works just like
.BR el_pmemory (3)
but also prints table-like header and footer.
.PP
-.EX
+.nf
------ ----------------------------------------------- ----------------
offset hex ascii
------ ----------------------------------------------- ----------------
@@ -224,7 +224,7 @@ but also prints table-like header and footer.
0x0060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f `abcdefghijklmno
0x0070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f pqrstuvwxyz{|}~.
------ ----------------------------------------------- ----------------
-.EE
+.fi
.PP
.BR el_pbinary (3)
is used to log binary data into block device.
@@ -241,11 +241,11 @@ uses specific format to store metadata to save as much space as possible.
All numerical values in metadata are variadic in size. Order of fields are as
follows:
.PP
-.EX
+.nf
+-------+------------+--------------+-------------+------+
| flags | ts_seconds | ts_fractions | data_length | data |
+-------+------------+--------------+-------------+------+
-.EE
+.fi
.PP
The only mandatory fields are
.BR flags ", " data_length " and " data .
@@ -254,7 +254,7 @@ determin what fields are present.
.B flags
field is always 1 byte in size and its format is
.PP
-.EX
+.nf
+------+-------+-----------------------------------------------------------+
| bits | value | description |
+------+-------+-----------------------------------------------------------+
@@ -275,7 +275,7 @@ field is always 1 byte in size and its format is
+------+-------+-----------------------------------------------------------+
| 6..7 | 0..3 | reserved |
+------+-------+-----------------------------------------------------------+
-.EE
+.fi
.PP
.BR ts_seconds ", " ts_fractions " and " data_length
are numerical values with dynamic size.
@@ -284,7 +284,7 @@ as continuation bit, if that bit is set, program should treat next byte as next
part of the same numerical value.
Below is table with example decimal values and it's encoded counterpart.
.PP
-.EX
+.nf
+---------------+--------------------------+
| decimal value | encoded hex value |
+---------------+--------------------------+
@@ -304,7 +304,7 @@ Below is table with example decimal values and it's encoded counterpart.
| 2147483647 | 0xff 0xff 0xff 0xff 0x07 |
| 4294967295 | 0xff 0xff 0xff 0xff 0x0f |
+---------------+--------------------------+
-.EE
+.fi
.PP
Encoded number are always
.BR little-endian ,
@@ -345,10 +345,10 @@ It usually is used with
.B extern
keyword like
.PP
-.EX
+.nf
extern struct el_options log_foobar;
#define EL_OPTIONS_OBJECT &log_foobar
-.EE
+.fi
.PP
It is real pain in the ass to provide information about file in every print
function. For that matter very simple macros have been provided.
@@ -379,15 +379,15 @@ and
into single, short parameter.
For example instead calling this
.PP
-.EX
+.nf
el_print(__FILE__, __LINE__, EL_NOTICE, "notice message number %d", num);
-.EE
+.fi
.PP
you can simply call
.PP
-.EX
+.nf
el_print(ELN, "notice message number %d", num);
-.EE
+.fi
.PP
This solution works both for
.B c89
@@ -489,4 +489,4 @@ and if file rotation is enabled also from
.BR el_opmemory_table (3),
.BR el_ocleanup (3),
.BR el_ooption (3),
-.BR el_opmemory (3),
+.BR el_opmemory (3).
diff --git a/man2html.sh b/man2html.sh
index 3ffd252..622a1b5 100755
--- a/man2html.sh
+++ b/man2html.sh
@@ -46,7 +46,7 @@ do
tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}"
## get table of content from file
- toc="$(sed -n '/<DL>/,/<\/DL>/p' "${ftmp}")"
+ toc="$(sed '/<DL>/,$!d;H;/<\/DL>/!d;s/.*//;x;s/\n//' "${ftmp}")"
toc="$(echo "${toc}" | sed 's/<DL>/<UL class="man-toc">/')"
toc="$(echo "${toc}" | sed 's/<\/DL>/<\/UL>/')"
@@ -66,15 +66,23 @@ do
# generate page info at bottom of page
echo "<p class=\"info left\"><a href=\"http://en.bofc.pl\">bofc.pl</a></p><p class=\"info center\">${version_info}</p><p class=\"info right\">${name}(${n})</p>" >> "${ftmp}"
- # convert all h2 into h1 headings
+ # convert all h2 into h1 headings, man2html generates .SH as h2 and we want
+ # it as h1
sed -i 's/H2>/H1>/g' "${ftmp}"
+ # convert all h3 into h2 headings, man2html generates .SS as h3 and we want
+ # it as h2
+ sed -i 's/H3>/H2>/g' "${ftmp}"
+
# remove obsolete COMPACT from dl
sed -i 's/DL COMPACT/DL/g' "${ftmp}"
# change ../man# to ./ as we have all mans in single directory
sed -i 's/\.\.\/man.\//.\//g' "${ftmp}"
+ #remove <P> right before <PRE>
+ perl -i -0pe 's/<P>\n\n<PRE>/<PRE>/g' "${ftmp}"
+
# move generated file into output directory for further processing
cp "${ftmp}" "${out}/${m}.html"
done
diff --git a/www/Makefile.am b/www/Makefile.am
index e69e9cd..d16edc3 100644
--- a/www/Makefile.am
+++ b/www/Makefile.am
@@ -2,6 +2,7 @@ EXTRA_DIST = custom.css footer.in header.in index.in index.md
www:
kursg -o out
+ ./post-process.sh
chmod a+rX out -R
make clean:
diff --git a/www/custom.css b/www/custom.css
index d7f8075..f60c90e 100644
--- a/www/custom.css
+++ b/www/custom.css
@@ -57,3 +57,8 @@ ul.man-toc
{
clear: both;
}
+
+h1.first
+{
+ margin-top: 2ch;
+}
diff --git a/www/post-process.sh b/www/post-process.sh
new file mode 100755
index 0000000..ff643d6
--- /dev/null
+++ b/www/post-process.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# add single new line before about in index.html
+sed -i 's/<h1 id="about">/<h1 id="about" class="first">/' "out/index.html"