Crates.io | r2md |
lib.rs | r2md |
version | |
source | src |
created_at | 2025-01-30 05:38:49.680437 |
updated_at | 2025-02-14 07:12:37.411563 |
description | Entire codebase to single markdown or pdf file. |
homepage | |
repository | |
max_upload_size | |
id | 1536104 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
r2md is a simple tool that converts your code repositories into a well-structured Markdown file. Whether you want to document your project, create a readable code overview, or prepare content for training machine learning models, r2md makes the process easy and efficient.
After downloading the r2md binary, place it in your system's PATH to use it from anywhere in the terminal.
Once the binary is installed, you can use the r2md
command followed by various options to customize its behavior.
Convert the current directory into a Markdown file:
r2md
r2md --include 'src/**/*.rs'
r2md --include '*.js' --include '*.ts'
This will generate a r2md_output.md
file in the current directory.
Process one or more specific directories:
r2md path/to/dir1 path/to/dir2
Process one or more specific urls:
r2md https://github.com/skirdey/boss.git
Exclude certain folders from processing:
r2md -x node_modules -x target
Define a custom name for the output Markdown file:
r2md -o my_documentation.md
Create a PDF version of the Markdown output:
r2md -p
Get detailed output for troubleshooting:
r2md --debug
Create a JSON file with training data using 80 (prompt) /20 (completion) split:
r2md --train-json training_data.json
Use multiple options together:
r2md path/to/dir -x .git -o project_docs.md -p --debug --train-json training.json
Generate Markdown from Current Directory:
r2md
Output: r2md_output.md
Generate Markdown and PDF, Excluding node_modules
:
r2md -x node_modules -p
Outputs: r2md_output.md
and r2md_output.pdf
Generate Training JSON from Specific Directories:
r2md src tests --train-json training_data.json
Output: training_data.json
r2md can be customized using a YAML configuration file (r2md.yml
or r2md.yaml
). This allows you to define additional ignore patterns and other settings.
Example r2md.yml
:
ignore_patterns:
- "temp"
- "backup"
For more options and detailed information, use the help flag:
r2md --help