2006-06-29 23:29:05 +04:00
#!/usr/bin/env ruby
2005-08-23 20:09:14 +04:00
#
2005-08-29 21:12:57 +04:00
# = Synopsis
#
# Generate a reference for all Puppet types. Largely meant for internal Reductive
# Labs use.
#
# = Usage
#
2010-04-21 11:20:19 +04:00
# puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|markdown|trac|rdoc>]
# [-r|--reference <[type]|configuration|..>] [manifest-file]
2005-08-29 21:12:57 +04:00
#
# = Description
#
2008-11-15 15:21:00 +03:00
# If mode is not 'rdoc', then this command generates a restructured-text document describing all installed
2006-04-12 03:44:36 +04:00
# Puppet types or all allowable arguments to puppet executables. It is largely
# meant for internal use and is used to generate the reference document
# available on the Reductive Labs web site.
2005-08-29 21:12:57 +04:00
#
2008-11-15 15:21:00 +03:00
# In 'rdoc' mode, this command generates an html RDoc hierarchy describing the manifests that
2009-06-05 20:39:04 +04:00
# are in 'manifestdir' and 'modulepath' configuration directives.
2008-11-15 15:21:00 +03:00
# The generated documentation directory is doc by default but can be changed with the 'outputdir' option.
#
2010-04-21 11:20:19 +04:00
# If the command is started with 'manifest-file' command-line arguments, puppet doc generate a single
2008-11-15 15:21:00 +03:00
# manifest documentation that is output on stdout.
#
2005-08-29 21:12:57 +04:00
# = Options
#
2007-04-24 10:20:21 +04:00
# all::
2008-11-15 15:21:00 +03:00
# Output the docs for all of the reference types. In 'rdoc' modes, this also outputs documentation for all resources
2007-04-24 10:20:21 +04:00
#
2005-08-29 21:12:57 +04:00
# help::
# Print this help message
#
2008-11-15 15:21:00 +03:00
# outputdir::
# Specifies the directory where to output the rdoc documentation in 'rdoc' mode.
#
2007-03-19 11:15:36 +03:00
# mode::
2009-07-02 08:01:39 +04:00
# Determine the output mode. Valid modes are 'text', 'trac', 'pdf', 'markdown' and 'rdoc'. The 'pdf' and 'markdown' modes create PDF or Markdown formatted files in the /tmp directory. Note that 'trac' mode only works on Reductive Labs servers. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path'
2006-04-12 03:44:36 +04:00
#
2007-05-08 00:07:13 +04:00
# reference::
2010-04-21 11:20:19 +04:00
# Build a particular reference. Get a list of references by running +puppet doc --list+.
2007-04-23 10:16:10 +04:00
#
2005-08-29 21:12:57 +04:00
# = Example
#
2010-04-21 11:20:19 +04:00
# $ puppet doc -r type > /tmp/type_reference.rst
2008-11-15 15:21:00 +03:00
# or
2010-04-21 11:20:19 +04:00
# $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests
2008-11-15 15:21:00 +03:00
# or
2010-04-21 11:20:19 +04:00
# $ puppet doc /etc/puppet/manifests/site.pp
2009-07-02 08:01:39 +04:00
# or
2010-04-21 11:20:19 +04:00
# $ puppet doc -m markdown -r configuration
2005-08-29 21:12:57 +04:00
#
# = Author
#
# Luke Kanies
#
# = Copyright
#
2007-04-24 22:59:20 +04:00
# Copyright (c) 2005-2007 Reductive Labs, LLC
2005-08-29 21:12:57 +04:00
# Licensed under the GNU Public License
2005-08-23 20:09:14 +04:00
2009-08-14 06:13:43 +04:00
require 'puppet/application/doc'
Puppet::Application[:doc].run