Documentation
¶
Overview ¶
Package markdown provides Markdown/text extraction for knowledge graphs. It extracts documentation concepts that can be linked to code entities.
Index ¶
Constants ¶
const ( // Language is the canonical name for Markdown. Language = "markdown" // NodePrefix is the prefix for all Markdown node IDs. NodePrefix = "doc_" )
const ( EdgeTypeDocuments = "documents" // Doc concept documents code entity EdgeTypeDescribes = "describes" // Doc describes behavior/architecture EdgeTypeExplains = "explains" // Doc provides design rationale )
Semantic edge types for documentation relationships.
Variables ¶
This section is empty.
Functions ¶
func CollectDocFiles ¶
CollectDocFiles walks a directory and returns all documentation files.
Types ¶
type CodeRef ¶
type CodeRef struct {
Target string // Target node ID
EdgeType string // documents, describes, explains
Reason string // Why this reference exists
}
CodeRef represents a reference to code from documentation.
type Concept ¶
type Concept struct {
Title string
Level int // Heading level (1-6)
Content string // Text content under this heading
CodeRefs []CodeRef
}
Concept represents a documentation concept extracted from Markdown.
type DocFile ¶
type DocFile struct {
Path string `json:"path"`
Tokens int `json:"tokens"`
Type string `json:"type"`
}
DocFile represents a documentation file with metadata.
func ReadDocFiles ¶
ReadDocFiles reads documentation files and returns their paths and estimated tokens.
type Extractor ¶
type Extractor struct{}
Extractor implements provider.LanguageExtractor for Markdown files.
func (*Extractor) CanExtract ¶
CanExtract returns true for Markdown/text files.
func (*Extractor) DetectFramework ¶
func (e *Extractor) DetectFramework(path string) *provider.FrameworkInfo
DetectFramework returns nil for Markdown files (no framework detection).
func (*Extractor) Extensions ¶
Extensions returns Markdown file extensions.
func (*Extractor) ExtractFile ¶
ExtractFile extracts nodes and edges from a Markdown file.