tol

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 9 Imported by: 0

README

tol

Table of contents

Summary

A simple tool to generate a table of licenses from go-licenses output.

Manual

$ notatio tol --help
NAME:
   notatio tol

USAGE:
   notatio tol [command options]

DESCRIPTION:
   Table of licences generator

OPTIONS:
   --csv-path value       input csv file (go-licenses output)
   --document-path value  markdown document file path to be updated
   --header value         header to use for document lookups and generation
   --limiter-left value   string to use as a lookup limiter (default: "##")
   --limiter-right value  string to use as a lookup limiter - empty will use end of file as a limit (default: "##")
   --index value          index of a section to be used as a placeholder (useful if limiters refer to more than one section,
      0 = replace all) (default: 0)
   --skip value [ --skip value ]  packages to skip
   --help, -h                     show help

Usage

You need the go-licenses to be installed first (please follow the instructions found on the https://github.com/google/go-licenses page).

Run the following first to generate a CSV file.

go-licenses report ./... > tmp/licenses.csv

Use the below README.md example.

# Title

## Licenses

## Example

Follow up with the command below.

notatio tol \
  --document-path=README.md \
  --csv-path=tmp/licenses.csv \
  --header="Licenses" \
  --limiter-left="##" \
  --limiter-right="## Example" \
  --index=1

And below you can see an example result.

# Title

## Licenses

| Package                                 | Licence                                                         | Type         |
|-----------------------------------------|-----------------------------------------------------------------|--------------|
| github.com/cpuguy83/go-md2man/v2/md2man | https://github.com/cpuguy83/go-md2man/blob/v2.0.7/LICENSE.md    | MIT          |
| github.com/russross/blackfriday/v2      | https://github.com/russross/blackfriday/blob/v2.1.0/LICENSE.txt | BSD-2-Clause |
| github.com/urfave/cli/v2                | https://github.com/urfave/cli/blob/v2.27.7/LICENSE              | MIT          |
| github.com/xrash/smetrics               | https://github.com/xrash/smetrics/blob/686a1a2994c1/LICENSE     | MIT          |

## Example

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = cli.Command{
	Name:         "tol",
	Aliases:      nil,
	Usage:        "",
	UsageText:    "",
	Description:  "Table of licences generator",
	ArgsUsage:    "",
	Category:     "",
	BashComplete: nil,
	Before:       before,
	After:        nil,
	Action:       action,
	OnUsageError: nil,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:     "csv-path",
			Usage:    "input csv file (go-licenses output)",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "document-path",
			Usage:    "markdown document file path to be updated",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "header",
			Usage:    "header to use for document lookups and generation",
			Required: true,
		},
		&cli.StringFlag{
			Name:  "limiter-left",
			Usage: "string to use as a lookup limiter",
			Value: "##",
		},
		&cli.StringFlag{
			Name:  "limiter-right",
			Usage: "string to use as a lookup limiter - empty will use end of file as a limit",
			Value: "##",
		},
		&cli.IntFlag{
			Name: "index",
			Usage: `index of a section to be used as a placeholder (useful if limiters refer to more than one section,
0 = replace all)`,
			Value: 0,
		},
		&cli.StringSliceFlag{
			Name:  "skip",
			Usage: "packages to skip",
		},
	},
	Subcommands: []*cli.Command{},
}

App main application.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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