Files
expr/docgen
2022-10-22 13:39:04 +02:00
..
2022-10-22 13:39:04 +02:00
2022-10-20 21:24:01 +02:00
2020-03-27 15:25:51 +03:00
2020-03-21 13:41:18 +03:00

DocGen

This package provides documentation generator with JSON or Markdown output.

Usage

Create a file and put next code into it.

package main

import (
	"encoding/json"
	"fmt"
  
	"github.com/antonmedv/expr/docgen"
)

func main() {
	// TODO: Replace env with your own types.
	doc := docgen.CreateDoc(env)
  
	buf, err := json.MarshalIndent(doc, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(buf))
}

Run go run your_file.go. Documentation will be printed in JSON format.

Markdown

To generate markdown documentation:

package main

import "github.com/antonmedv/expr/docgen"

func main() {
	// TODO: Replace env with your own types.
	doc := docgen.CreateDoc(env)

	print(doc.Markdown())
}