Make margins wider and page narrower

This commit is contained in:
Anthony Rose 2025-03-03 22:03:51 +00:00
parent 74fce98e2b
commit 9fa980c2e4

View file

@ -2,16 +2,19 @@
set -e set -e
command -v cmark >/dev/null || (echo "cmark: command not found" >&2 && exit 1) command -v cmark >/dev/null || (echo "cmark: command not found" >&2 && exit 1)
test -n "$2" || (echo "Usage: $(basename "$0") \"Document title\" filename1 [filename2...]" >&2 && exit 1) test -n "$2" || (echo "Usage: $(basename "$0") \"Document title\" filename1 [filename2...]" >&2 && exit 1)
# A 160 mm width means a 25 mm margin on each side of a 210 mm A4 sheet of paper.
cat << __EOF__ cat << __EOF__
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>$1</title> <title>$1</title>
<style>body{font-family:sans-serif;font-size:12pt;margin:auto;width:180mm;}</style> <style>body{font-family:sans-serif;font-size:12pt;margin:auto;width:160mm;}</style>
</head> </head>
<body> <body>
__EOF__ __EOF__
while shift while shift
do do
test -n "$1" || break # No more files. test -n "$1" || break # No more files.
@ -19,6 +22,7 @@ do
cmark --to html --nobreaks --unsafe --smart --validate-utf8 $1 cmark --to html --nobreaks --unsafe --smart --validate-utf8 $1
echo '</article>' echo '</article>'
done done
cat << __EOF__ cat << __EOF__
</body> </body>
</html> </html>