apidoc

package module
v0.0.0-...-f803685 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

apidoc

LICENSE GoDoc Go Report Card

English | 简体中文

This is a tool and Golang package that uses swagger2.0 definitions to generate API static documents (such as pdf) based on template files.

Installation

1、Source Code
Preconditions

The wkhtmltopdf package must be installed.

Install Command
go install github.com/zc2638/apidoc/cmd/apidoc@latest
2、Docker
docker pull zc2638/apidoc:latest

Use In Docker

docker run --rm zc2638/apidoc:latest --src https://petstore.swagger.io/v2/swagger.json --data > petstore.pdf

Use In Command

From File
apidoc --src <your-swagger-json> [--dest <your-output-dir>]
From URL
apidoc --src https://petstore.swagger.io/v2/swagger.json

Toolkit Example

Please visit the example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(content []byte) ([]byte, error)

func ParseFromURL

func ParseFromURL(url string) ([]byte, error)

func SaveToPDF

func SaveToPDF(data []byte, isGray bool) ([]byte, error)

func SaveToPDFFile

func SaveToPDFFile(data []byte, isGray bool, to string) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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