glossary

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package glossary parses glossary definitions and highlights terms in HTML.

GLOSSARY.md 格式:

# Glossary

## API
Application Programming Interface,应用程序编程接口。

## Markdown
一种轻量级标记语言。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Glossary

type Glossary struct {
	Terms []Term
}

Glossary stores parsed glossary terms.

func ParseFile

func ParseFile(path string) (*Glossary, error)

ParseFile parses a glossary from GLOSSARY.md.

func (*Glossary) ProcessHTML

func (g *Glossary) ProcessHTML(html string) string

ProcessHTML highlights glossary terms in HTML body text.

func (*Glossary) RenderHTML

func (g *Glossary) RenderHTML() string

RenderHTML renders the glossary as an HTML page.

type Term

type Term struct {
	Name       string // Term name.
	Definition string // Term definition.
}

Term represents a single glossary entry.

Jump to

Keyboard shortcuts

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