Giter VIP home page Giter VIP logo

man2book's Introduction

man2book

man2book is a tool to create a custom book of installed man pages or a selection of manpage sections and / or pages.

After only one day of development the first stable code is here. At all it took me about two days thinking about to start coding my idea... Here is the result!

\o/

Hope this is useful to someone. Have fun!

FAQ

Why man pages as a book?

Because I want to read them comfortable on my ebook reader when traveling but all or some selected man pages in one or multiple books. Not more... ;)

Which manpage sections are supported by man2book?

Currently, the following manpage sections are supported, but it can support other custom sections:

  1. User commands; man-pages includes a small number of Section 1 pages that document programs supplied by the GNU C library.
  2. System calls documents the system calls provided by the Linux kernel.
  3. Library functions documents the functions provided by the standard C library.
  4. Devices documents details of various devices, most of which reside in /dev.
  5. Files describes various file formats and filesystems, and includes proc(5), which documents the /proc file system.
  6. Overviews, conventions, and miscellaneous.
  7. Superuser and system administration commands; man-pages includes a small number of Section 8 pages that document programs supplied by the GNU C library.

Source: https://www.kernel.org/doc/man-pages/

Helpful libraries and tools

Workflow

  1. Read manpage sections
  2. Create HTML file for each manpage in each section
  3. Read and store title(metadata) for in each file
  4. Remove all unneeded stuff like html, head and body in each file
  5. Create TOC for the entire ebook
  6. Create a header HTML file for the ebook containing the head tag
  7. Merge toc and content of all files for preparing the ebook
  8. Merge the header file with the prepared ebook while inserting html and body tags which should result in a valid HTML file
  9. Create ebook from the resulting HTML file using Pandoc

Future

When the above steps are done, and we could build a complete book there are some feature ideas:

  • Some kind of template for the book including a cover.
  • Image support for the cover.
  • Maybe a footer for pages and the complete book.
  • Page numbers on all pages after the table of contents. Like in real books.
  • Support all output formats of Pandoc. This should be easy since I do not do any special here. Pandoc is my base converter /generator.
  • Maybe support for other converters / generators.
  • Links to other man pages as mentioned in the footer of all man pages, e.g.: pam(8). But only if available in the current book.
  • Maybe a progress bar instead of printing for every file being processed (https://www.geeksforgeeks.org/progress-bars-in-python/).

Bugs

  • Includes in man pages does not work. Need to discover this, but I do not know how to solve this and if Pandoc supports that (maybe when setting some include path somewhere?).

Links

  • The Linux man-pages project - I found this project after researching a little for my idea and it inspired me a lot to start my project.

man2book's People

Contributors

hanez avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.