{"modulePath":"github.com/JordanCoin/docmap","version":"v0.6.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package render\n\n## Functions\n\n```go\nfunc AtLine(doc *parser.Document, line int)\n```\nAtLine answers \"what's at line N?\" It finds the tightest containing node in the typed AST and prints its kind, location, containing section breadcrumb, and a short preview. Useful when an agent has a line number from elsewhere (a grep hit, a diff, an error) and needs to know what construct lives there.\n\n```go\nfunc ChangedSince(doc *parser.Document, changed map[int]bool, ref string)\n```\nChangedSince renders the sections and notables that intersect any line in \\`changed\\`. It's the CLI answer to \"what changed in these docs since ref X?\" — each hit shows its breadcrumb and the specific constructs that sit on changed lines.\n\n```go\nfunc ExpandAtLine(doc *parser.Document, line int)\n```\nExpandAtLine dumps the section that contains the given line.\n\n```go\nfunc ExpandSection(doc *parser.Document, name string)\n```\nExpandSection prints the original markdown for a named section, including nested headings, with a file:line-range locator agents can jump to.\n\n```go\nfunc FilteredTree(doc *parser.Document, filter string)\n```\nFilteredTree shows only sections matching the filter\n\n```go\nfunc MultiTree(docs []*parser.Document, dirName string)\n```\nMultiTree renders multiple documents as a combined directory view with aggregated inventory summary at the top and a per-file one-liner that surfaces each file's most signal-dense notables.\n\n```go\nfunc RefsTree(docs []*parser.Document, dirName string)\n```\nRefsTree renders document references (links to other .md files)\n\n```go\nfunc SearchResults(docs []*parser.Document, query string)\n```\nSearchResults searches all docs for sections matching the query and renders them best first, each with the lines that matched:\n\n\tdocs/HOOKS.md \u003e Hooks \u003e Why This Matters (93)\n\t  :41  files imported by 3+ others are hub files\n\nso the reader can jump to file:line without expanding the section first.\n\n```go\nfunc SectionNotFound(docs []*parser.Document, name string)\n```\nSectionNotFound prints the not-found line plus the closest titles, so the next attempt does not have to start with a full tree.\n\n```go\nfunc Tree(doc *parser.Document)\n```\nTree renders the full document map\n\n```go\nfunc TypeFilter(doc *parser.Document, kindName string)\n```\nTypeFilter drills down into a single node kind across the whole document. Equivalent to TypeFilterFiltered with no sub-filter.\n\n```go\nfunc TypeFilterDocs(docs []*parser.Document, kindName, lang, variant string)\n```\nTypeFilterDocs is TypeFilterFiltered across a directory: every document that has the construct, skipping the ones that do not, then a total. \"Where are the bash examples in these docs\" is a directory question.\n\n```go\nfunc TypeFilterFiltered(doc *parser.Document, kindName, lang, variant string)\n```\nTypeFilterFiltered narrows the --type view further by an optional --lang (for code blocks) or --kind (for callout variants). Unmatched sub-filters are silently ignored when the kind doesn't support them.\n\n## Types\n\n```go\ntype LineHit = parser.LineHit\n```\nLineHit is one source line that matches a search query.\n\n```go\ntype SearchResult struct {\n\tFilename   string\n\tPath       string // e.g. \"endpoints \u003e Ban Member\"\n\tSection    *parser.Section\n\tTitleMatch bool\n\t// WholeWord is true when the query matched as a word of its own, not\n\t// only inside a longer one (\"hub\" in \"github\").\n\tWholeWord bool\n\t// Hits are the matching lines among the section's own lines (not its\n\t// subsections'), in order. Count is how many there are; Hits holds at\n\t// most maxHitsPerSection of them. Both are empty when the section\n\t// matched only by title or by a typed construct (a code language, a\n\t// callout kind), or when the document has no line-addressable source.\n\tHits  []LineHit\n\tCount int\n}\n```\nSearchResult holds a matched section with its file context\n\n```go\nfunc FindSearchResults(docs []*parser.Document, query string) []SearchResult\n```\nFindSearchResults returns sections matching query using the same title, content, and typed-AST matching as the human renderer, in document order.\n\n```go\nfunc RankSearchResults(results []SearchResult) []SearchResult\n```\nRankSearchResults orders results by usefulness: sections whose title matches first, then whole-word matches before matches inside a longer word, then by number of matching lines, keeping document order among equals.\n\n","path":"github.com/JordanCoin/docmap/render","name":"render","synopsis":"","isRedistributable":true}
