8000 GitHub - dsbasko/code-map
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dsbasko/code-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code-Map

Code-map is a utility designed for recursively searching files in a directory and merging them into a single file with markup. It is useful for project documentation, report creation, and combining the contents of source code or other files into one markdown file.

Features

  • Recursively traverses all nested directories.
  • Filters files based on a specified pattern (regular expression).
  • Generates a project.md file with the contents of the found files wrapped in markdown format.

Usage

Run the utility:

./code-map ~/Develop/sandbox "\\.(go|json)\$"

After execution, a project.md file will be created with the contents of the project.

Arguments

  1. path — the path to the directory where the recursive search should be performed.
  2. pattern — a regular expression for filtering files by name.

Build

Ensure that Go (version 1.23 and above) is installed.

  1. Clone the repository:

    git clone https://github.com/your-repository/project-tree.git
  2. Navigate to the project directory:

    cd project-tree
  3. Build the utility:

    go build -o project-tree

Example

Suppose you have the following project structure:

project/
├── cmd/
│   └── main.go
├── internal/
│   ├── configs/
│   │   └── configs.go
│   └── repository/
│       └── postgresql.go

Contents of the files:

cmd/main.go:

package main

func main() {
    // some logic
}

internal/configs/configs.go:

package configs

func someConfigFN() {
    // some logic
}

internal/repository/postgresql.go:

package repository

func someRepositoryFN() {
    // some logic
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published
0