doc: Adopters list in README (#252)

Adds a list of most popular projects using avo, based on Github Stars.

Auto-generated from the third-party packages list using docgen.

Updates #101
This commit is contained in:
Michael McLoughlin
2022-04-17 22:38:54 -07:00
committed by GitHub
parent 956d98e549
commit 57ea8119b7
5 changed files with 101 additions and 5 deletions

View File

@@ -14,6 +14,8 @@ import (
"regexp"
"strings"
"text/template"
"github.com/mmcloughlin/avo/tests/thirdparty"
)
func main() {
@@ -25,9 +27,10 @@ func main() {
}
var (
typ = flag.String("type", "", "documentation type")
tmpl = flag.String("tmpl", "", "explicit template file (overrides -type)")
output = flag.String("output", "", "path to output file (default stdout)")
typ = flag.String("type", "", "documentation type")
tmpl = flag.String("tmpl", "", "explicit template file (overrides -type)")
output = flag.String("output", "", "path to output file (default stdout)")
pkgsfilename = flag.String("pkgs", "", "packages configuration")
)
func mainerr() (err error) {
@@ -51,9 +54,23 @@ func mainerr() (err error) {
return err
}
// Load third-party packages.
if *pkgsfilename == "" {
return errors.New("missing packages configuration")
}
pkgs, err := thirdparty.LoadPackagesFile(*pkgsfilename)
if err != nil {
return err
}
// Execute.
data := map[string]interface{}{
"Packages": pkgs,
}
var buf bytes.Buffer
if err := t.Execute(&buf, nil); err != nil {
if err := t.Execute(&buf, data); err != nil {
return err
}
body := buf.Bytes()