Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ToMarkdown and ToMan optional #1363

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs.go
@@ -1,3 +1,6 @@
//go:build cli_docs
// +build cli_docs

package cli

import (
Expand All @@ -13,6 +16,8 @@ import (

// ToMarkdown creates a markdown string for the `*App`
// The function errors if either parsing or writing of the string fails.
//
// To use this functionality, you need to have cli_docs build flag set.
func (a *App) ToMarkdown() (string, error) {
var w bytes.Buffer
if err := a.writeDocTemplate(&w); err != nil {
Expand All @@ -23,6 +28,8 @@ func (a *App) ToMarkdown() (string, error) {

// ToMan creates a man page string for the `*App`
// The function errors if either parsing or writing of the string fails.
//
// To use this functionality, you need to have cli_docs build flag set.
func (a *App) ToMan() (string, error) {
var w bytes.Buffer
if err := a.writeDocTemplate(&w); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions docs_test.go
@@ -1,3 +1,6 @@
//go:build cli_docs
// +build cli_docs

package cli

import (
Expand Down