App-DocKnot
view release on metacpan or search on metacpan
bin/docknot view on Meta::CPAN
#!perl
#
# Generate human-readable documentation from package metadata.
#
# This is the driver program for the DocKnot documentation generation system.
# As much logic as possible should live in App::DocKnot rather than in this
# script. It should be a thin wrapper.
#
# SPDX-License-Identifier: MIT
use 5.024;
use autodie;
use warnings;
use App::DocKnot::Command;
# Dispatch everything to the module.
my $docknot = App::DocKnot::Command->new();
$docknot->run();
__END__
=for stopwords
Allbery DocKnot docknot MERCHANTABILITY NONINFRINGEMENT sublicense subcommand
subcommands distdir pgp-key cl2xhtml cvs2xhtml faq2html spin-rss archivedir
XHTML -lu
=head1 NAME
docknot - Static web site and documentation generator
=head1 SYNOPSIS
B<docknot> B<-h>
B<docknot> dist [B<-d> I<distdir>] [B<-m> I<metadata>] [B<-p> I<pgp-key>]
B<docknot> generate [B<-m> I<metadata>] [B<-w> I<width>] I<template> [I<output>]
B<docknot> generate-all [B<-m> I<metadata>] [B<-w> I<width>]
B<docknot> release [B<-a> I<archivedir>] [B<-d> I<distdir>] [B<-m> I<metadata>]
B<docknot> spin [B<-d>] [B<-e> I<pattern> ...] [B<-s> I<url>] I<source>
I<output>
B<docknot> spin-rss [B<-b> I<base>] I<file>
B<docknot> spin-text [B<-lu>] [B<-s> I<url>] [B<-t> I<title>] [I<source>
[I<output>]]
B<docknot> spin-thread [B<-f>] [B<-s> I<url>] [I<source> [I<output>]]
B<docknot> update [B<-m> I<metadata>] [B<-o> I<output>]
B<docknot> update-spin [I<path>]
=head1 DESCRIPTION
B<docknot> is a static web site generator with special support for managing
the documentation and releases of software packages. Its actions are
organized into subcommands. The supported subcommands are:
=over 4
=item dist
Build, test, and generate a distribution tarball of the package in the current
directory. The exact commands used is determined by the package metadata (see
L<App::DocKnot::Config> for format documentation).
After the distribution is built, it will be checked against the source tree
and B<docknot> will report an error and exit with a non-zero status if there
are any expected files missing.
=item generate
Use metadata files and templates to generate human-readable documentation
files for a package. See L<App::DocKnot::Config> for documentation on the
metadata format, configuration files, and paths.
=item generate-all
Like C<generate>, but generates all of the package documentation for which
default output files are configured. This is a quick short-cut to generating
all documentation that's shipped with the package.
=item release
Copy a distribution tarball into a release area, archiving old versions, and
optionally updating configuration for C<spin>.
=item spin
Spin a tree of files written in the macro language thread into an HTML web
site. See L<App::DocKnot::Spin> for documentation on the input format and
details of the site generation.
=item spin-rss
Process a single F<.rss> file with L<App::DocKnot::Spin::RSS> (normally done
as part of using C<spin> to process a tree of files). See that module's
documentation for more details.
=item spin-text
Convert a text file to HTML.
=item spin-thread
Like C<spin>, but convert a single file written in thread to HTML.
=item update
Update the DocKnot package configuration from an older format.
=item update-spin
Update an input tree for C<spin> to the latest expectations. This will, for
example, convert old-style F<*.rpod> pointer files to new-style F<*.spin>
pointer files.
=back
=head1 OPTIONS
Each B<docknot> subcommand takes its own options. Many also read global
configuration options from DocKnot's configuration. See
L<App::DocKnot::Config/Global Configuration> for more details.
=head2 Global Options
=over 4
=item B<-h>, B<--help>
Print out usage information and exit.
=back
=head2 dist
=over 4
=item B<-d> I<distdir>, B<--distdir>=I<distdir>
The directory into which to put the generated distribution tarball. This is
also used as a working directory for a temporary copy of the package source.
This should point to a trusted directory, not one where an attacker could have
written files; see L<App::DocKnot::Dist/make_distribution()> for more
information. Default: The C<destdir> option in the global DocKnot
configuration file. This option is required if there is no configuration file
or if this option is not set.
=item B<-m> I<metadata>, B<--metadata>=I<metadata>
The path to the metadata file for the package whose distribution tarball is
being generated. Default: F<docs/docknot.yaml> relative to the current
directory (which is the recommended metadata path for a project).
=item B<-p> I<pgp-key>, B<--pgp-key>=I<pgp-key>
The name of the PGP key to use to sign the generated distribution tarballs.
The key can be named in any way that the B<-u> option of GnuPG understands.
The generated signature will be armored and stored in a file named by
appending C<.asc> to the name of the tarball. Default: The C<pgp_key> option
in the global DocKnot configuration file.
=back
=head2 generate
bin/docknot view on Meta::CPAN
The base URL for style sheets. All style sheets specified in C<\heading>
commands will be considered to be relative to this URL and this URL will be
prepended to them. If this option is not given, the name of the style sheet
will be used verbatim as its URL, except with C<.css> appended. This will
also be used as the base URL to style sheets for the output of B<cl2xhtml>,
B<cvs2xhtml>, and B<faq2html>.
=item I<source>
The input tree of files to spin into a web site. This must be a directory.
=item I<output>
The output location to write the generated web site. If this directory does
not exist, it will be created. If it exists, it must be a directory.
=back
=head2 spin-rss
=over 4
=item B<-b> I<base>, B<--base>=I<base>
By default, output files are relative to the current working directory. If
this option is given, output files will be relative to I<base> instead.
Output files specified as absolute paths will not be affected.
=item I<file>
The F<.rss> file to process. See L<App::DocKnot::Spin::RSS> for the details
of the file format.
=back
=head2 spin-text
=over 4
=item B<-m>, B<--modified>
Add a last modified subheading to the converted document based on the last
modification timestamp of the source file. This is only done if no RCS/CVS Id
string is found in the file. If there is one, it is used in preference. This
option is ignored if the input is not a file.
=item B<-s> I<style>, B<--style>=I<style>
Use I<style> as the URL of a style sheet for the generated web page. Unless
this argument is given, no style sheet will be referred to in the generated
web page.
=item B<-t> I<title>, B<--title>=I<title>
Use I<title> as the page title rather than whatever may be determined from
looking at the input file.
=back
=head2 spin-thread
=over 4
=item B<-s> I<url>, B<--style-url>=I<url>
The base URL for style sheets. A style sheet specified in a C<\heading>
command will be considered to be relative to this URL and this URL will be
prepended to it. If this option is not given, the name of the style sheet
will be used verbatim as its URL, except with C<.css> appended.
=item I<source>
The input file. If not given, standard input will be used.
=item I<output>
The output file. If not given, standard output will be used.
=back
=head2 update
=over 4
=item B<-m> I<metadata>, B<--metdata>=I<metadata>
The path to the JSON metadata files for the package that should be converted
to the new YAML format. This should be a directory containing all the package
metadata files required by App::DocKnot. Default: F<docs/metadata> relative
to the current directory.
=item B<-o> I<output>, B<--output>=I<output>
The output file for the updated package configuration. Default:
F<docs/docknot.yaml> relative to the current directory (which is the
recommended metadata path for a project).
=back
=head2 update-spin
=over 4
=item I<path>
The path to the spin input tree to update. If not given, defaults to the
current directory.
=back
=head1 DIAGNOSTICS
If B<docknot> fails with errors, see the underlying module for that subcommand
for information about what those errors might mean. Internally, it can also
produce the following diagnostics:
=over 4
=item cannot write to %s: %s
( run in 1.301 second using v1.01-cache-2.11-cpan-437f7b0c052 )