2014-02-21 22:30:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
list() {
|
2015-05-20 20:16:16 +00:00
|
|
|
root_dir=$(kickstart root-dir)
|
|
|
|
find "$root_dir"/docs -type f | sed -e 's/.md$//' | cut -c "$(wc -c <<<$root_dir/docs/)"- | tr '/' '.'
|
2014-02-21 22:30:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
show() {
|
2015-05-20 20:16:16 +00:00
|
|
|
cat "$(kickstart root-dir)"/docs/"$(echo "$1" | tr '.' '/')".md
|
2014-02-21 22:30:18 +00:00
|
|
|
}
|
|
|
|
|
2015-05-20 20:16:16 +00:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
list
|
|
|
|
else
|
|
|
|
show "$1"
|
|
|
|
fi
|