Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

60%
+1 −0
Q&A Writing a programming book: how to present directory structures

I would go with option 2. However, you do not need to manually build the structure. I instead recommend using a tool such as Tree which should handle the pretty-printing for you as below: $ tree -...

posted 12y ago by coleopterist‭  ·  last activity 4y ago by System‭

Answer
#3: Attribution notice added by user avatar System‭ · 2019-12-08T02:27:42Z (over 4 years ago)
Source: https://writers.stackexchange.com/a/6086
License name: CC BY-SA 3.0
License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision by user avatar coleopterist‭ · 2019-12-08T02:27:42Z (over 4 years ago)
I would go with option 2. However, you do not need to manually build the structure. I instead recommend using a tool such as [Tree](http://mama.indstate.edu/users/ice/tree/) which should handle the pretty-printing for you as below:

    $ tree -d /var
    var
    |-- backups
    |-- cache
    | |-- app-install
    | |-- apt
    | | `-- archives
    | | `-- partial
    | |-- apt-xapian-index
    | | |-- index.1
    | | `-- index.2
    | |-- cups
    | | `-- rss
    | |-- debconf
    | |-- dictionaries-common
    | |-- flashplugin-installer
    | |-- fontconfig
    | |-- hald
    | |-- jockey
    | |-- ldconfig [error opening dir]
    | |-- man

The script should be available as a package in your distro. I can confirm that it is in Ubuntu.

I also suggest that you contact your editor to get his/her opinion. The publisher very likely has its own style guidelines for such matters (with layout in mind). If you do go ahead with a text representation, I recommend that you add a sticky somewhere reminding you to check the indentation in the final - whitespace often gets messed up when the book is laid out.

P.S. ... and your editor will prefer a textual representation as well - saves ink ;)

#1: Imported from external source by user avatar System‭ · 2012-07-22T12:42:21Z (almost 12 years ago)
Original score: 8