js

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMarkdown

func GenerateMarkdown(functions []FunctionWithDocs) string

GenerateMarkdown creates a Markdown document from the extracted function information

func GenerateMarkdownForMultipleFiles

func GenerateMarkdownForMultipleFiles(fileResults map[string][]FunctionWithDocs) string

GenerateMarkdownForMultipleFiles creates a Markdown document for multiple JavaScript files

Types

type CommentInfo

type CommentInfo struct {
	Text     string
	StartPos int  // Line position
	EndPos   int  // Line position
	IsJSDoc  bool // Indicates if this is a JSDoc comment (starts with /**)
	IsTopDoc bool // Indicates if this is a top-level docstring (first comment in file)
}

CommentInfo stores information about a JavaScript comment

type FunctionInfo

type FunctionInfo struct {
	Name       string
	Parameters []string
	Position   int // Line position
}

FunctionInfo stores information about a JavaScript function

type FunctionWithDocs

type FunctionWithDocs struct {
	Name       string
	Parameters []string
	DocString  string
	IsTopLevel bool // Indicates if this is a top-level function
	Filename   string
}

FunctionWithDocs combines function information with its docstring

func ExtractDocstrings

func ExtractDocstrings(data []byte, filename string, jsdocOnly bool) ([]FunctionWithDocs, error)

ExtractDocstrings extracts docstrings and function signatures from JavaScript code

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL