cp_docs
cp_docs is a small Rust command-line tool.
It recursively finds all docs/ directories within a specified path and copies their contents to a target directory, preserving the original folder structure.
Dependencies
- Rust (https://www.rust-lang.org/)
- Cargo (Rust's package manager)
cp_docs
Install from crates
Install from source
Usage
# OR cargo run
# src dir
# target dir
Docker Usage (untested)
Prefer cargo install or cargo run Over docker
To use docs-helper within a Docker container, follow these steps:
-
Build the Docker image: Navigate to the root of your
docs-helperproject (where theDockerfileis located) in your terminal and run:This command builds a Docker image named
cp_docs. -
Run the Docker container: You'll need to mount your source and target directories from your host machine into the container using volume mounts (
-v).Example: If your project with
docs/folders is inmy_project_rooton your host and you want the output inmy_project_root/dist:# From your 'my_project_root' directory-
-v $(pwd):/app/source_code: Mounts your current host directory ($(pwd)) as/app/source_codeinside the container. This should be the root path wherecp_docswill start searching fordocs/directories. -
-v $(pwd)/dist:/app/output_docs: Mounts your host'sdistdirectory as/app/output_docsinside the container. This is where the processed documentation will be written. -
cp_docs: The name of the Docker image you built. -
/app/source_code /app/output_docs: These are the arguments passed to thecp_docsexecutable inside the container, specifying the root to scan and the target output directory, respectively.
-