Skip to main content

Generate dirtrees for LaTeX

Project description

latex-dirtree-gen

LaTeX dirtree generator, inspired by the Perl version 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.
}

Following command will display shallow list with the depth of one. Directories at depth limit will 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.
}

You can show the .git directory and .gitignore file, but hide the 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

latex-dirtree-gen-0.4.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latex_dirtree_gen-0.4.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file latex-dirtree-gen-0.4.1.tar.gz.

File metadata

  • Download URL: latex-dirtree-gen-0.4.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for latex-dirtree-gen-0.4.1.tar.gz
Algorithm Hash digest
SHA256 879dc3536075d499806a77b214f8ea2da6c9df1e1de7f7655bbe74423fa26718
MD5 e17fb46d2351e469bdb8b09b25e54997
BLAKE2b-256 2b2caf215e5db3f50e4769b34fad84aff7cd8819384bd9d0a35d828eb0450e65

See more details on using hashes here.

File details

Details for the file latex_dirtree_gen-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: latex_dirtree_gen-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for latex_dirtree_gen-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca942df03aa96dd8267ce45d02e9d7731812511e0d83022e384d329c9fdfcdf7
MD5 a24dd04d6e17470b29d6d8093c7e39a1
BLAKE2b-256 4337d296411250457bd49374739c3dee21e4da32c646edbf7b12745496a1cfab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page