11# Reference: https://linux.die.net/man/5/pandoc_markdown
22
33if version
4- > % {{ full_name.tr(' ', '-') }}(1) Version {{ version }} | {{ summary }}
4+ > % {{ full_name.to_hyphen }}(1) Version {{ version }} | {{ summary }}
55else
6- > % {{ full_name.tr(' ', '-') }}(1) | {{ summary }}
6+ > % {{ full_name.to_hyphen }}(1) | {{ summary }}
77end
88> % {{ ENV['AUTHORS'] }}
99> % {{ Date.today.strftime "%B %Y" }}
2424> DESCRIPTION
2525> ==================================================
2626>
27- > {{ help.for_markdown }}
27+ > {{ help.for_manpage }}
2828>
2929
3030if default
@@ -42,14 +42,14 @@ if extensible
4242end
4343>
4444
45- if commands .any?
45+ if public_commands .any?
4646 grouped_commands.each do |group, commands|
4747 > {{ group.gsub(/:$/, '').upcase }}
4848 > ==================================================
4949 >
5050 commands.each do |subcommand|
5151 > **{{ subcommand.full_name }}**(1)
52- > : {{ subcommand.summary.for_markdown }}
52+ > : {{ subcommand.summary.for_manpage }}
5353 >
5454 end
5555 >
@@ -62,7 +62,7 @@ if args.any?
6262 >
6363 args.each do |arg|
6464 > **{{ arg.name.upcase }}**
65- > : {{ arg.help.for_markdown }}
65+ > :{{ arg.help.for_manpage.indent(4) }}
6666 >
6767 if arg.required
6868 > - *Required*
@@ -81,7 +81,10 @@ if args.any?
8181
8282 if catch_all.label && catch_all.help
8383 > **{{ catch_all.label }}**
84- > : {{ catch_all.help&.for_markdown }}
84+ if catch_all.help
85+ > :{{ catch_all.help.for_manpage.indent(4) }}
86+ >
87+ end
8588 >
8689
8790 if catch_all.required?
@@ -97,7 +100,7 @@ if flags.any?
97100 >
98101 flags.each do |flag|
99102 > **{{ flag.usage_string }}**
100- > : {{ flag.help.for_markdown }}
103+ > :{{ flag.help.for_manpage.indent(4) }}
101104 >
102105
103106 if flag.required
@@ -125,8 +128,10 @@ if dependencies.any?
125128 >
126129 dependencies.each do |dependency|
127130 > **{{ dependency.commands.join ', ' }}**
128- >
129- > :{{ dependency.help&.indent(4)&.for_markdown }}
131+ if dependency.help
132+ > :{{ dependency.help.for_manpage.indent(4) }}
133+ >
134+ end
130135 >
131136 end
132137end
@@ -138,7 +143,7 @@ if public_environment_variables.any?
138143 public_environment_variables.each do |environment_variable|
139144 > **{{ environment_variable.name.upcase }}**
140145 >
141- > :{{ environment_variable.help.indent(4).for_markdown }}
146+ > :{{ environment_variable.help.for_manpage. indent(4) }}
142147 >
143148
144149 if environment_variable.required
@@ -157,10 +162,16 @@ if examples
157162 >
158163 > ~~~
159164 examples.each do |example|
160- > {{ example.for_markdown }}
165+ > {{ example.for_manpage }}
161166 >
162167 end
163168 > ~~~
164169end
165170
166-
171+ if public_commands.any?
172+ > SEE ALSO
173+ > ==================================================
174+ >
175+ = public_commands.map { |x| "**#{x.full_name.to_hyphen}**(1)" }.join ', '
176+ >
177+ end
0 commit comments