Generate dirtrees for LaTeX
Project description
latex-dirtree-gen
Python version of the Perl latex-dirtree-generator by Danny Koppenhagen.
In order to use output of this program in your LaTeX document, make sure you've included the dirtree
package:
\usepackage{dirtree}
Usage
usage: latex-dirtree-gen [args] directory
positional arguments:
directory project root
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-H/--include-hidden show files and directories starting with "."
(default: False)
-i/--ignore IGNORE comma separated list of directories and files to be ignored
(default: )
-d/--depth DEPTH how many directories should the program descend
(default: 5)
--color in stdout, draw directories in red (with no effect on generated LaTeX code)
(default: False)
--dots draw "\dots" inside folders at depth limit
(default: False)
Examples
Let's assume the following file structure:
. (project root)
+- .git
| '- (git files and directories)
+- pdf
| '- cover.pdf
+- text
| +- 01-introduction.tex
| +- 02-content.tex
| +- 03-literature.tex
| '- 99-other.tex
+- .gitignore
+- main.pdf
+- main.tex
'- README.md
With default settings, the program will output:
$ latex-dirtree-gen .
\dirtree{%
.1 .
.2 pdf.
.3 cover.pdf.
.2 text.
.3 01-introduction.tex.
.3 02-content.tex.
.3 03-literature.tex.
.3 99-other.tex.
.2 main.tex.
.2 main.pdf.
.2 README.md.
}
Shallow list, with the depth of one. Directories at depth limit have \dots
inside them. The argument --color
has no effect on the LaTeX output and only draws directories in red in the stdout, for easier orientation in the output (and cannot be shown here because of markdown limitations).
$ latex-dirtree-gen -d 1 --dots --color .
\dirtree{%
.1 .
.2 pdf.
.3 \dots.
.2 text.
.3 \dots.
.2 main.tex.
.2 main.pdf.
.2 README.md.
}
Show hidden .git
directory and hidden .gitignore
file, but hide pdf
directory.
$ latex-dirtree-gen -H --ignore pdf -d 1.
\dirtree{%
.1 .
.2 .git.
.3 \dots.
.2 text.
.3 \dots.
.2 .gitignore.
.2 main.tex.
.2 main.pdf.
.2 README.md.
}
Contributing
If you find an error or have an improvement idea, file an issue!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for latex_dirtree_gen-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f5043f526bbb12027a92b2cbf4b1fc7586de294b225526c8189aceac6ec156 |
|
MD5 | 5c7fccf8e68b7d3d671bb936c706513e |
|
BLAKE2b-256 | e867e06cd11f4bf3534ec339d6b55906851b991191875d3a95403d3d63942fcb |