Skip to content

Latest commit

 

History

History
executable file
·
120 lines (87 loc) · 4.64 KB

README.md

File metadata and controls

executable file
·
120 lines (87 loc) · 4.64 KB

NAME

children — generates a Markdown tree list of child pages

SYNOPSIS

children [-a|--all-filetypes] [-u|--untracked] directory

DESCRIPTION

Generate a graphical relative representation of the child files and subfolders, providing hyperlinks to certain documents. By default only Markdown documents which are being tracked by git are shown, with the Markdown document title as the hyperlink text. Options, below, modify the set of documents shown.

Filtered out of results are the .git directory (the working store of the revision management system) and all .DS_Store files (used by macOS for housekeeping).

Options

-a, --all-filetypes

Provide hyperlinks to every child file.

-u, --untracked

Provide hyperlinks to files not tracked by git.

These options cannot be combined; -au is invalid.

EXAMPLES

For a directory with the following contents:

./children.sh
./untracked.txt
./README.md
./tracked.txt
./dir/subdir/subsubdir/untracked-file.txt
./dir/subdir/subsubdir/tracked.txt
./dir/subdir/README.md
./dir/README.md

The command children . generates a tree diagram of only the Markdown files (with their document titles as the link text). This behavior is designed to make it easy to provide an index into a repository containing many Markdown files.

github-markdown-child-pages
⎣ dir
    ⎢ The Top Level
    ⎣ subdir
        ⎣ Something Nested Within

Generated by github-markdown-child-pages.

The command children --all-filetypes . generates a tree diagram of all the files tracked by git:

github-markdown-child-pages
./children.sh
./dir/
⎢   ⎢ The Top Level
⎢   ⎣ ./dir/subdir/
⎢       ⎢ Something Nested Within
⎢       ⎣ ./dir/subdir/subsubdir/
⎢           ⎢ ./dir/subdir/subsubdir/tracked.txt
./tracked.txt

Generated by github-markdown-child-pages.
The command `children --all-filetypes --untracked .` generates a tree diagram of all files, whether tracked by git or not:

github-markdown-child-pages
NAME
./children.sh
./dir/
⎢   ⎢ The Top Level
⎢   ⎣ ./dir/subdir/
⎢       ⎢ Something Nested Within
⎢       ⎣ ./dir/subdir/subsubdir/
⎢           ⎢ ./dir/subdir/subsubdir/tracked.txt
⎢           ⎣ ./dir/subdir/subsubdir/untracked-file.txt
./tracked.txt
./untracked.txt

Generated by github-markdown-child-pages.

INSTALLATION

Move the script to a location on your $PATH and ensure it's executable.

mv children.sh /usr/local/bin/children
chmod +x /usr/local/bin/children

Move the man page to a location on your $MANPATH.

mv children.1 /usr/local/share/man/man1/

AUTHOR

Michael Sattler

SEE ALSO

children.sh white-paper