From eeb20a3999e09242c26e5a6dde908afc4510b91b Mon Sep 17 00:00:00 2001 From: Joel Longtine Date: Mon, 21 Feb 2022 15:25:30 -0700 Subject: [PATCH] Temporary fix for markdownlint Signed-off-by: Joel Longtine --- cmd/dagger/cmd/doc.go | 9 ++++++++- docs/reference/README.md | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/dagger/cmd/doc.go b/cmd/dagger/cmd/doc.go index 18cbf5eb..d4198578 100644 --- a/cmd/dagger/cmd/doc.go +++ b/cmd/dagger/cmd/doc.go @@ -334,7 +334,9 @@ func walkStdlib(ctx context.Context, output, format string) { lg.Fatal().Err(err).Msg("cannot generate stdlib doc index") } defer index.Close() - fmt.Fprintf(index, "# Index\n\n") + // FIXME: I removed a \n character, so that markdownlint doesn't complain + // about an extra newline at the end of the file. + fmt.Fprintf(index, "# Index\n") indexKeys := []string{} for p, pkg := range packages { @@ -357,6 +359,11 @@ func walkStdlib(ctx context.Context, output, format string) { // Generate index from sorted list of packages sort.Strings(indexKeys) + // Add a extra blank line if we have at least one package + // TODO: this is a hack, fixes issue with markdownlint, if we haven't generated any docs. + if len(indexKeys) > 0 { + fmt.Fprintf(index, "\n") + } for _, p := range indexKeys { description := mdEscape(packages[p].Description) fmt.Fprintf(index, "- [%s](./%s) - %s\n", p, getFileName(p), description) diff --git a/docs/reference/README.md b/docs/reference/README.md index 2061bac5..8b013d6a 100644 --- a/docs/reference/README.md +++ b/docs/reference/README.md @@ -1,2 +1 @@ # Index -