MCPcopy Index your code
hub / github.com/antonmedv/gitmal

github.com/antonmedv/gitmal @v1.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.2 ↗ · + Follow
278 symbols 980 edges 49 files 71 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

package main

import ( "bytes" "html/template" "strings"

"github.com/antonmedv/gitmal/pkg/git"
"github.com/antonmedv/gitmal/pkg/links"

)

func readme(files []git.Blob, dirsSet, filesSet links.Set, params Params, rootHref string) template.HTML { var readmeHTML template.HTML

md := createMarkdown(params.Style)

for _, b := range files {
    nameLower := strings.ToLower(b.FileName)
    if strings.HasPrefix(nameLower, "readme") && isMarkdown(b.Path) {
        data, isBin, err := git.BlobContent(params.Ref, b.Path, params.RepoDir)
        if err != nil || isBin {
            break
        }
        var buf bytes.Buffer
        if err := md.Convert(data, &buf); err != nil {
            break
        }

        // Fix links/images relative to README location
        htmlStr := links.Resolve(
            buf.String(),
            b.Path,
            rootHref,
            params.Ref.DirName(),
            dirsSet,
            filesSet,
        )

        readmeHTML = template.HTML(htmlStr)
        break
    }
}

return readmeHTML

}

Extension points exported contracts — how you extend this code

LineReaderAt (Interface)
LineReaderAt is the interface that wraps the ReadLinesAt method. ReadLinesAt reads len(lines) into lines starting at li [1 …
pkg/gitdiff/io.go
PatchHeaderOption (FuncType)
A PatchHeaderOption modifies the behavior of ParsePatchHeader.
pkg/gitdiff/patch_header.go

Core symbols most depended-on inside this repo

Errorf
called by 135
pkg/gitdiff/parser.go
WriteByte
called by 32
pkg/gitdiff/format.go
WriteString
called by 30
pkg/gitdiff/format.go
String
called by 24
pkg/git/types.go
New
called by 22
pkg/gitdiff/gitdiff.go
DirName
called by 22
pkg/git/types.go
Close
called by 21
pkg/gitdiff/apply_text.go
Line
called by 21
pkg/gitdiff/parser.go

Shape

Function 167
Method 56
Struct 44
TypeAlias 8
Interface 2
FuncType 1

Languages

Go100%

Modules by API surface

pkg/gitdiff/file_header.go26 symbols
pkg/templates/templates.go18 symbols
pkg/gitdiff/gitdiff.go17 symbols
pkg/gitdiff/patch_header.go14 symbols
pkg/gitdiff/format.go12 symbols
pkg/gitdiff/apply.go11 symbols
pkg/gitdiff/io.go10 symbols
pkg/git/types.go10 symbols
pkg/gitdiff/parser.go9 symbols
pkg/gitdiff/apply_binary.go9 symbols
pkg/gitdiff/apply_test.go8 symbols
utils.go7 symbols

For agents

$ claude mcp add gitmal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact