lang

package
v7.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package lang 管理各类语言提取注释代码块规则的定义

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse added in v7.2.0

func Parse(h *core.MessageHandler, langID string, data core.Block, blocks chan core.Block)

Parse 分析 data 的内容并输出到到 blocks

Types

type Language

type Language struct {
	DisplayName string // 显示友好的名称
	ID          string // 语言唯一名称,一律小写

	Exts []string // 扩展名列表,必须以 . 开头且小写
	// contains filtered or unexported fields
}

Language 语言模块的定义

func Get

func Get(id string) *Language

Get 获取指定语言的定义信息

若不存在,则返回 nil

func GetByExt

func GetByExt(ext string) *Language

GetByExt 根据扩展名获取语言定义信息

ext 必须以 . 作为开头 若不存在,则返回 nil

func Langs

func Langs() []*Language

Langs 返回所有支持的语言

Jump to

Keyboard shortcuts

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