You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(PUP-12058) Add task to generate man (as markdown) reference
bundle exec rake references:man
This task generates an overview page that lists all of the puppet commands.
Next, we run the gen_manpages rake task that generates roff formatted man pages
in the man directory. Then we convert roff to markdown using pandoc. We
unfortunately can't generate markdown directly as legacy apps are hardcoded to
generate ronn, such as when running `puppet agent --help`.
The task requires the pandoc-ruby gem, so add it to the documentation bundler
group. Since the group is optional, check to see if the gem is present before
loading it, similar to how we handle ronn.
The task also requires the pandoc executable.
abort("Run `bundle config set with documentation` and `bundle update` to install the `pandoc-ruby` gem.")
117
+
end
118
+
119
+
pandoc=%x{which pandoc}.chomp
120
+
unlessFile.executable?(pandoc)
121
+
abort("Please install the `pandoc` package.")
122
+
end
123
+
124
+
sha=%x{git rev-parse HEAD}.chomp
125
+
now=Time.now
126
+
127
+
# This is based on https://github.com/puppetlabs/puppet-docs/blob/1a13be3fc6981baa8a96ff832ab090abc986830e/lib/puppet_references/puppet/man.rb#L24-L108
128
+
core_apps=%w(
129
+
agent
130
+
apply
131
+
lookup
132
+
module
133
+
resource
134
+
)
135
+
occasional_apps=%w(
136
+
config
137
+
describe
138
+
device
139
+
doc
140
+
epp
141
+
generate
142
+
help
143
+
node
144
+
parser
145
+
plugin
146
+
script
147
+
ssl
148
+
)
149
+
weird_apps=%w(
150
+
catalog
151
+
facts
152
+
filebucket
153
+
report
154
+
)
155
+
156
+
variables={
157
+
sha: sha,
158
+
now: now,
159
+
title: 'Puppet Man Pages',
160
+
core_apps: core_apps,
161
+
occasional_apps: occasional_apps,
162
+
weird_apps: weird_apps
163
+
}
164
+
165
+
content=render_erb(MAN_OVERVIEW_ERB,variables)
166
+
File.write(MAN_OVERVIEW_MD,content)
167
+
puts"Generated #{MAN_OVERVIEW_MD}"
168
+
169
+
# Generate manpages in roff
170
+
Rake::Task[:gen_manpages].invoke
171
+
172
+
# Convert the roff formatted man pages to markdown, based on
> **NOTE:** This page was generated from the Puppet source code on <%=now%>
11
+
12
+
13
+
14
+
Puppet's command line tools consist of a single `puppet` binary with many subcommands. The following subcommands are available in this version of Puppet:
15
+
16
+
Core Tools
17
+
-----
18
+
19
+
These subcommands form the core of Puppet's tool set, and every user should understand what they do.
20
+
21
+
<%core_apps.eachdo |app| -%>
22
+
- [puppet <%=app%>](<%=app%>.md)
23
+
<%end-%>
24
+
25
+
26
+
> Note: The `puppet cert` command is available only in Puppet versions prior to 6.0. For 6.0 and later, use the [`puppetserver cert`command](https://puppet.com/docs/puppet/6/puppet_server_ca_cli.html).
27
+
28
+
Secondary subcommands
29
+
-----
30
+
31
+
Many or most users need to use these subcommands at some point, but they aren't needed for daily use the way the core tools are.
32
+
33
+
<%occasional_apps.eachdo |app| -%>
34
+
- [puppet <%=app%>](<%=app%>.md)
35
+
<%end-%>
36
+
37
+
38
+
Niche subcommands
39
+
-----
40
+
41
+
Most users can ignore these subcommands. They're only useful for certain niche workflows, and most of them are interfaces to Puppet's internal subsystems.
0 commit comments