protodoc

package
v0.0.0-...-d19e6ca Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package protodoc 把 protobuf 接口定义(.proto 源文件)转换为 markdown 接口文档。

转换只做语法解析、不做链接,因此不需要 import 的文件(如 googleapis)存在于仓库中: 同文件内定义的类型渲染为页内锚点链接,其余类型按源码中的写法原样展示。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(name string, src []byte) ([]byte, error)

Convert 把 .proto 源文件转换为接口文档 markdown:文件概览、服务与方法(含 google.api.http 映射)、 消息字段表、枚举值表,以及折叠展示的源文件。语法错误时返回带行列号的错误。

Types

type Parser

type Parser struct {
	Markdown *markdown.Engine
}

Parser 按文件类型分派:.proto 文件先转换为接口文档 markdown 再解析,其余交给 markdown 引擎。

func NewParser

func NewParser(md *markdown.Engine) *Parser

NewParser 创建支持 .proto 文件的文档解析器。

func (*Parser) Parse

func (p *Parser) Parse(path string, content []byte) (docs.ParsedDoc, error)

Parse 实现 docs.Parser。

Jump to

Keyboard shortcuts

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