Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v2 bug: Man page section interferes with Markdown rendering #1275

@codefromthecrypt

Description

@codefromthecrypt

my urfave/cli version is

( Put the version of urfave/cli that you are using here )

Checklist

  • Are you running the latest v2 release?
  • Did you check the manual for your release?
  • Did you perform a search about this problem?

Dependency Management

  • My project is using go modules.

Describe the bug

Right now, the MarkdownTemplate is used for both markdown and man page generation. There's a section added in ed2ee4b which helps for man, but is not helpful in markdown

% {{ .App.Name }} 8

This renders literally and reduces the clean appearance otherwise present.

To reproduce

run a command like m, err := c.App.ToMarkdown() and try to render it directly or in something like hugo

Observed behavior

Screen Shot 2021-05-21 at 9 16 14 AM

Expected behavior

I would expect nothing leaked from man into markdown. In this case, it is ok to have the line removed when in markdown.

Additional context

While not specifically annotated about this, the following may be someone else working around this https://github.com/google/skia-buildbot/blob/4c87209ff9378a9befc65d5f93c4040d4fdd5922/go/urfavecli/urfavecli.go#L34

Want to fix this yourself?

To fix this, I would only add that header when man is in use. For example, we can default a new ManTemplate to MarkdownTemplate with that header

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/v2relates to / is being considered for v2kind/bugdescribes or fixes a bugstatus/triagemaintainers still need to look into this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions