output

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package output 对解析后的数据进行渲染输出。

Index

Constants

View Source
const (
	ApidocXML   = "apidoc+xml"
	OpenapiYAML = "openapi+yaml"
	OpenapiJSON = "openapi+json"
)

几种输出的类型

Variables

This section is empty.

Functions

func Buffer

func Buffer(d *doc.Doc, opt *Options) (*bytes.Buffer, error)

Buffer 将内容导出到内存

func Render

func Render(d *doc.Doc, opt *Options) error

Render 渲染 doc 的内容

Types

type Options

type Options struct {
	// 导出的文件类型格式,默认为 apidoc 的 XML 文件。
	Type string `yaml:"type,omitempty"`

	// 文档的保存路径
	Path string `yaml:"path,omitempty"`

	// 只输出该标签的文档,若为空,则表示所有。
	Tags []string `yaml:"tags,omitempty"`

	// xslt 文件地址
	//
	// 默认值为 https://apidoc.tools/docs/ 下当前版本的 apidoc.xsl,比如:
	//  https://apidoc.tools/docs/v6/apidoc.xsl
	Style string `yaml:"style,omitempty"`
	// contains filtered or unexported fields
}

Options 指定了渲染输出的相关设置项。

Jump to

Keyboard shortcuts

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