Package for generating file trees in Markdown
Project description
MDFT - Markdown File Trees
Overview
Package for generating file trees in Markdown.
- Define file trees directly in markdown
- In-place update for existing files
- Options for output customization
Installation
MDFT can be installed from PyPI using pip:
pip install mdft
Usage
Include a definition line in a .md file with the following format:
<!-- mdft PATH [OPTIONS] -->
The file tree will be generated for the specified path and will be inserted in the line that follows the definition. If there is content following the definition line (such as a previous version of the file tree) it will get removed up to the next blank line and replaced with the updated file tree.
MDFT is executed as a module using:
python3 -m mdft FILE.md
Path
The Path is relative to the .md file. The file tree will include all of the files and folders under the specified path, but, by default, will not include an entry for the folder itself (the root folder).
Options
The Options are comma-separated values that customize the output, but may be ommited.
| Option | Description | Type | Default |
|---|---|---|---|
| filter | Exclude files listed in .gitignore |
bool | True |
| include_files | Include files (not just directories) | bool | True |
| include_hidden | Include hidden files | bool | False |
| include_root | Include the root folder in the tree | bool | False |
| keep_line | Keep the definition line in the output file | bool | True |
| link | Create links to the files | bool | True |
| max_depth | Maximum scan depth from the root folder | int | None |
Values for each option are specified in the form of option=value, e.g. max_depth=2. For bool values, you can ommit the value to make it True, or prepend a ! to make it False, e.g. !include_files.
Example
The following file tree is automatically generated based on the contents of the following definition:
<!-- mdft src/ include_files,link -->
This generates a tree based on the src/ folder (relative to the current file) including files and generating links for each entry, like follows:
Contributing
Guidelines for contributing to the project:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-name). - Open a Pull Request.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdft-0.1.6.tar.gz.
File metadata
- Download URL: mdft-0.1.6.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fee594ec551420aa75ce032e16a477cca86114543b7a40d466def6b75b3b2588
|
|
| MD5 |
5634c745f2d77ee3be48682b56b2a2ca
|
|
| BLAKE2b-256 |
ba4e2c4eea4d4873de391f35ff121a6468363517bc4dd52bbc5915eebe4b8fab
|
File details
Details for the file mdft-0.1.6-py3-none-any.whl.
File metadata
- Download URL: mdft-0.1.6-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9413854bbfb0ca56e84401c7bbed4eb5b0d3e90ef8e588a1496156b742f6219
|
|
| MD5 |
20c55637ea87fb648200d997b345eee1
|
|
| BLAKE2b-256 |
d3096d844f2c02111728caa2f5d178f6058ddc79986fadbd89cc567747a62061
|