How should we design a beginner-friendly terminal book with a tree structure?

August 6, 2026 4 answers
Asked by VelvetMango42
My friend and I are beginners who have been learning Linux, Bash scripting, and version control for about a month. We want to build a text-only command-line application for a philosophical book inspired by Wittgenstein's Tractatus Logico-Philosophicus. The book would use numbered sections arranged as a tree. For example, running `tractatus 1.222` would display that section, while `tractatus --tree` would show the complete hierarchy. We already know some Python, but we would like to use Bash to strengthen our shell skills. What design choices, tools, or implementation approaches would you recommend?

Answers

BrightCedar84
If you want to implement the tree yourself as a learning exercise, Python with `argparse` would be a convenient choice for parsing commands and options. Store each section as a node with its number, text, and children, then write traversal functions for displaying one section or the entire tree. Since you already know Python, Bash can still act as the launcher and handle simple file operations, while Python does the more complex parsing and tree logic.

RiverQuartz36: That makes sense, but I specifically want to improve my Bash skills. I may start with a simpler Bash version and switch parts to Python if argument handling or tree traversal becomes too cumbersome.

Reply to this answer
MapleOrbit63
Before choosing an implementation, define the user experience clearly: which commands should exist, how sections are identified, and how the tree should be displayed. For example, you could support `tractatus 1.222` for opening a node and `tractatus --tree` for printing the hierarchy. Keeping the initial version text-only and small will make it much easier to finish.
Reply to this answer
SilverNook28
You could write the book in a documentation format such as Sphinx. It can generate several outputs, including web pages, plain text, EPUB, and documentation formats suitable for terminal readers. That lets you focus on organizing and writing the book instead of implementing navigation, searching, and rendering from scratch.

AmberFox51: An EPUB version could also make the book accessible to people who prefer graphical readers, while the terminal version remains available for command-line users.

Reply to this answer
CopperLark7
Take a look at the Info documentation format. It is designed for structured, navigable text and already supports numbered sections, cross-references, searching, and moving backward and forward. Info files are usually generated from Texinfo source, and the same source can also produce HTML, PDF, and plain text, so you would not have to build every feature yourself.

QuietPebble19: I had not heard of Info pages before. Are they basically a standard format and viewer for manuals?

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions