Initial commit of the idea.

This commit is contained in:
Johannes Findeisen 2022-10-17 04:40:13 +02:00
commit 4c671cb840
4 changed files with 339 additions and 1 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.idea/
man2ebook.iml

View file

@ -1,3 +1,24 @@
# man2ebook
A tool to convert all installed man pages to a simple ebook with contents in the head.
A tool to convert all installed man pages to a simple ebook with contents in the head.
Maybe this could be only a small shell script but if not I will use Python.
## Why man pages as ebook?
Because I want to read them comfortable on my ebook when traveling. Not more... ;)
## Helpful libraries and tools
- https://pandoc.org/ - Haskell and then maybe make use of https://pypi.org/project/pypandoc/.
(very mature features for document conversion like direct manpage input and epub output,
but I don't know much about pandoc, so I need to discover this. (https://pypi.org/project/pandoc/))
- https://www.gnu.org/software/groff/
(man -Thtml df > df.html)
- https://linux.die.net/man/1/man2html
(is nice because it must not generate html, head and body)
- https://pypi.org/project/epubmaker/ - Python
(maybe nice but unmaintained)
- https://docutils.sourceforge.io/ - Python
(as I can see now it only converts from .rst files.)
- https://github.com/hanez/aov-html2epub - Bash

17
idea.mmd Normal file
View file

@ -0,0 +1,17 @@
Mind Map generated by NB MindMap plugin
> __version__=`1.1`,showJumps=`true`
---
# man page
## "pandoc", "man2html" or "man \-Thtml df \> df\.html"
### maybe create a metadata file
### create contents and index files
### cleanup contents and index files
### merge contents and index files
### create epub file \(pandoc\)

298
tmp/df.html Normal file
View file

@ -0,0 +1,298 @@
<!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Mon Oct 17 01:28:34 2022 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>DF</title>
</head>
<body>
<h1 align="center">DF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#REPORTING BUGS">REPORTING BUGS</a><br>
<a href="#COPYRIGHT">COPYRIGHT</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">df &minus;
report file system space usage</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>df</b>
[<i>OPTION</i>]... [<i>FILE</i>]...</p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">This manual
page documents the GNU version of <b>df</b>. <b>df</b>
displays the amount of space available on the file system
containing each file name argument. If no file name is
given, the space available on all currently mounted file
systems is shown. Space is shown in 1K blocks by default,
unless the environment variable POSIXLY_CORRECT is set, in
which case 512-byte blocks are used.</p>
<p style="margin-left:11%; margin-top: 1em">If an argument
is the absolute file name of a device node containing a
mounted file system, <b>df</b> shows the space available on
that file system rather than on the file system containing
the device node. This version of <b>df</b> cannot show the
space available on unmounted file systems, because on most
kinds of systems doing so requires very nonportable intimate
knowledge of file system structures.</p>
<h2>OPTIONS
<a name="OPTIONS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Show
information about the file system on which each FILE
resides, or all file systems by default.</p>
<p style="margin-left:11%; margin-top: 1em">Mandatory
arguments to long options are mandatory for short options
too. <b><br>
&minus;a</b>, <b>&minus;&minus;all</b></p>
<p style="margin-left:22%;">include pseudo, duplicate,
inaccessible file systems</p>
<p style="margin-left:11%;"><b>&minus;B</b>,
<b>&minus;&minus;block&minus;size</b>=<i>SIZE</i></p>
<p style="margin-left:22%;">scale sizes by SIZE before
printing them; e.g., &rsquo;&minus;BM&rsquo; prints sizes in
units of 1,048,576 bytes; see SIZE format below</p>
<p style="margin-left:11%;"><b>&minus;h</b>,
<b>&minus;&minus;human&minus;readable</b></p>
<p style="margin-left:22%;">print sizes in powers of 1024
(e.g., 1023M)</p>
<p style="margin-left:11%;"><b>&minus;H</b>,
<b>&minus;&minus;si</b></p>
<p style="margin-left:22%;">print sizes in powers of 1000
(e.g., 1.1G)</p>
<p style="margin-left:11%;"><b>&minus;i</b>,
<b>&minus;&minus;inodes</b></p>
<p style="margin-left:22%;">list inode information instead
of block usage</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>&minus;k</b></p></td>
<td width="8%"></td>
<td width="30%">
<p>like <b>&minus;&minus;block&minus;size</b>=<i>1K</i></p></td>
<td width="48%">
</td></tr>
</table>
<p style="margin-left:11%;"><b>&minus;l</b>,
<b>&minus;&minus;local</b></p>
<p style="margin-left:22%;">limit listing to local file
systems</p>
<p style="margin-left:11%;"><b>&minus;&minus;no&minus;sync</b></p>
<p style="margin-left:22%;">do not invoke sync before
getting usage info (default)</p>
<p style="margin-left:11%;"><b>&minus;&minus;output</b>[=<i>FIELD_LIST</i>]</p>
<p style="margin-left:22%;">use the output format defined
by FIELD_LIST, or print all fields if FIELD_LIST is
omitted.</p>
<p style="margin-left:11%;"><b>&minus;P</b>,
<b>&minus;&minus;portability</b></p>
<p style="margin-left:22%;">use the POSIX output format</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p><b>&minus;&minus;sync</b></p></td>
<td width="2%"></td>
<td width="56%">
<p>invoke sync before getting usage info</p></td>
<td width="22%">
</td></tr>
</table>
<p style="margin-left:11%;"><b>&minus;&minus;total</b></p>
<p style="margin-left:22%;">elide all entries insignificant
to available space, and produce a grand total</p>
<p style="margin-left:11%;"><b>&minus;t</b>,
<b>&minus;&minus;type</b>=<i>TYPE</i></p>
<p style="margin-left:22%;">limit listing to file systems
of type TYPE</p>
<p style="margin-left:11%;"><b>&minus;T</b>,
<b>&minus;&minus;print&minus;type</b></p>
<p style="margin-left:22%;">print file system type</p>
<p style="margin-left:11%;"><b>&minus;x</b>,
<b>&minus;&minus;exclude&minus;type</b>=<i>TYPE</i></p>
<p style="margin-left:22%;">limit listing to file systems
not of type TYPE</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p><b>&minus;v</b></p></td>
<td width="2%"></td>
<td width="40%">
<p>(ignored)</p></td>
<td width="38%">
</td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p><b>&minus;&minus;help</b></p></td>
<td width="2%"></td>
<td width="40%">
<p>display this help and exit</p></td>
<td width="38%">
</td></tr>
</table>
<p style="margin-left:11%;"><b>&minus;&minus;version</b></p>
<p style="margin-left:22%;">output version information and
exit</p>
<p style="margin-left:11%; margin-top: 1em">Display values
are in units of the first available SIZE from
<b>&minus;&minus;block&minus;size</b>, and the
DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment
variables. Otherwise, units default to 1024 bytes (or 512 if
POSIXLY_CORRECT is set).</p>
<p style="margin-left:11%; margin-top: 1em">The SIZE
argument is an integer and optional unit (example: 10K is
10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or
KB,MB,... (powers of 1000). Binary prefixes can be used,
too: KiB=K, MiB=M, and so on.</p>
<p style="margin-left:11%; margin-top: 1em">FIELD_LIST is a
comma&minus;separated list of columns to be included. Valid
field names are: &rsquo;source&rsquo;, &rsquo;fstype&rsquo;,
&rsquo;itotal&rsquo;, &rsquo;iused&rsquo;,
&rsquo;iavail&rsquo;, &rsquo;ipcent&rsquo;,
&rsquo;size&rsquo;, &rsquo;used&rsquo;, &rsquo;avail&rsquo;,
&rsquo;pcent&rsquo;, &rsquo;file&rsquo; and
&rsquo;target&rsquo; (see info page).</p>
<h2>AUTHOR
<a name="AUTHOR"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Written by
Torbjorn Granlund, David MacKenzie, and Paul Eggert.</p>
<h2>REPORTING BUGS
<a name="REPORTING BUGS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">GNU coreutils
online help: &lt;https://www.gnu.org/software/coreutils/&gt;
<br>
Report any translation bugs to
&lt;https://translationproject.org/team/&gt;</p>
<h2>COPYRIGHT
<a name="COPYRIGHT"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Copyright
&copy; 2022 Free Software Foundation, Inc. License GPLv3+:
GNU GPL version 3 or later
&lt;https://gnu.org/licenses/gpl.html&gt;. <br>
This is free software: you are free to change and
redistribute it. There is NO WARRANTY, to the extent
permitted by law.</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Full
documentation
&lt;https://www.gnu.org/software/coreutils/df&gt; <br>
or available locally via: info '(coreutils) df
invocation'</p>
<hr>
</body>
</html>