view release on metacpan or search on metacpan
bin/docknot view on Meta::CPAN
# 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>]
lib/App/DocKnot/Spin/Text.pm view on Meta::CPAN
# Convert some particular text formats into HTML.
#
# This program is an ad hoc set of heuristics and tricks, attempting to
# convert a few text file formats that I commonly use into reasonable HTML.
# General text to XHTML conversions is impossible due to the wildly differing
# formats used by people when writing text, so this module doesn't try to
# solve the general problem. It's good enough to turn the FAQs I maintain
# into HTML documents, which is all that I need of it.
#
# SPDX-License-Identifier: MIT
##############################################################################
# Modules and declarations
##############################################################################
lib/App/DocKnot/Spin/Text.pm view on Meta::CPAN
do {
$line = $self->_next_line();
} while (defined($line) && ($line !~ m{ \S }xms || _is_rule($line)));
$self->_buffer_line($line);
}
##############################################################################
# HTML constructors
##############################################################################
# Output the header of the HTML document. We claim "transitional" XHTML 1.0
# compliance; we can't claim strict solely because we use the value attribute
# in <li> in the absence of widespread implementation of CSS Level 2. Assume
# English output.
#
# $header_ref - Additional information from the headers of the text document
sub _output_header {
my ($self, $header_ref) = @_;
$self->_output(
'<?xml version="1.0" encoding="utf-8"?>', "\n",
'<!DOCTYPE html', "\n",
' PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"', "\n",
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', "\n",
"\n",
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">',
"\n",
'<head>', "\n",
q{ }, title($self->{title} // $header_ref->{title} // q{}), "\n",
);
if ($self->{style}) {
$self->_output(q{ }, style($self->{style}), "\n");
}
lib/App/DocKnot/Spin/Text.pm view on Meta::CPAN
header) and the last modified time and revision (from the RCS C<Id> string) if
there are no subheadings already. If there's a subheading that contains RCS
identifiers, it will be replaced by a nicely formatted heading generated from
the RCS C<Id> information in the HTML output.
Text marked as C<*bold*> using the standard asterisk notation will be
surrounded by C<< <strong> >> tags, if the asterisks appear to be marking bold
text rather than serving as wildcards or some other function.
App::DocKnot::Spin::Text produces output (at least in the absence of any
lurking bugs) which complies with the XHTML 1.0 Transitional standard. The
input and output character set is assumed to be UTF-8.
=head1 CLASS METHODS
=over 4
=item new(ARGS)
Create a new App::DocKnot::Spin::Text object. A single converter object can
be reused to convert multiple files provided that they have the same options.
lib/App/DocKnot/Spin/Thread.pm view on Meta::CPAN
} elsif ($char eq '93') {
return (0, ']');
} elsif ($char =~ m{ \A \d+ \z }xms) {
return (0, "&#$char;");
} else {
return (0, "&$char;");
}
}
# Generates the page heading at the top of the document. This is where the
# XHTML declarations come from.
#
# $title - Page title
# $style - Page style
sub _cmd_heading {
my ($self, $title, $style) = @_;
$title = $self->_parse($title);
$style = $self->_parse($style);
# Get the relative URL of the output page, used for sitemap information.
my $page;
if (defined($self->{out_path}) && defined($self->{output})) {
$page = $self->{out_path}->relative($self->{output});
}
# Build the page header.
my $output = qq{<?xml version="1.0" encoding="utf-8"?>\n};
$output .= qq{<!DOCTYPE html\n};
$output .= qq{ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n};
$output .= qq{ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n};
$output .= qq{\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"};
$output .= qq{ lang="en">\n};
$output .= qq{<head>\n <title>$title</title>\n};
$output .= q{ <meta http-equiv="Content-Type"};
$output .= qq{ content="text/html; charset=utf-8" />\n};
# Add style sheet.
if ($style) {
$style .= '.css';
share/templates/html.tmpl view on Meta::CPAN
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>[% title %]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />[% IF style %]
<link rel="stylesheet" href="[% style %]" type="text/css" />[% END %]
[% IF links %][% links %][% END %]</head>
<body>
t/data/spin/markdown/output/other.html view on Meta::CPAN
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Other test Markdown</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="previous" href="foo.html" title="Some document" />
<link rel="next" href="test.html" title="Test Markdown" />
<link rel="up" href="./" title="Test Root" />
<link rel="top" href="./" />
t/data/spin/markdown/output/test.html view on Meta::CPAN
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test Markdown</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/markdown.css" type="text/css" />
<link rel="previous" href="other.html" title="Other test Markdown" />
<link rel="up" href="./" title="Test Root" />
<link rel="top" href="./" />
t/data/spin/output/changes.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Recent Changes</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/indent.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" href="changes.rss"
title="Changes to Russ Allbery's Web Pages" />
</head>
t/data/spin/output/index.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Russ Allbery (Eagle)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/basic.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" href="changes.rss"
title="Changes to Russ Allbery's Web Pages" />
</head>
t/data/spin/output/journal/2011-08/006.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Eagle's Path: NPR Top 100 SFF meme (2011-08-12)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/journal.css" type="text/css" />
</head>
<!-- Spun from 006.th by DocKnot %VERSION% on %DATE% -->
t/data/spin/output/journal/index.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Eagle's Path</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/journal-set.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" href="index.rss"
title="Eagle's Path" />
<link rel="alternate" type="application/rss+xml" href="debian.rss"
t/data/spin/output/random.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test some random stuff</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<!-- Spun from random.th by DocKnot %VERSION% on %DATE% -->
t/data/spin/output/reviews/books/0-385-49362-2.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Review: Fermat's Enigma by Simon Singh</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/review.css" type="text/css" />
</head>
<!-- Spun from 0-385-49362-2.th by DocKnot %VERSION% on %DATE% -->
t/data/spin/output/software/docknot/api/app-docknot.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>App::DocKnot</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/pod.css" type="text/css" />
<link rel="next" href="app-docknot-command.html"
title="App::DocKnot::Command" />
<link rel="up" href="../" title="DocKnot" />
t/data/spin/output/software/docknot/changes.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DocKnot Changes</title>
<link rel="stylesheet" href="/~eagle/styles/faq-short.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="up" href="./" title="DocKnot" />
<link rel="top" href="../../" />
</head>
t/data/spin/output/software/docknot/index.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DocKnot</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/software.css" type="text/css" />
<link rel="previous" href="../cvslog/" title=""cvslog"" />
<link rel="next" href="../rra-c-util/" title="rra-c-util>" />
<link rel="up" href="../" title="Software" />
t/data/spin/output/software/docknot/readme.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DocKnot %VERSION%</title>
<link rel="stylesheet" href="/~eagle/styles/faq.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="up" href="./" title="DocKnot" />
<link rel="top" href="../../" />
</head>
t/data/spin/output/software/index.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Russ's Software</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/indent.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" href="../journal/software.rss"
title="Releases of Russ Allbery's Software" />
<link rel="next" href="../faqs/" title="FAQs and Documentation" />
t/data/spin/output/usefor/index.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The Usenet Article Format and Protocols</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/~eagle/styles/indent.css" type="text/css" />
<link rel="previous" href="../photos/" title="Photos" />
<link rel="next" href="../nntp/" title="NNTP" />
<link rel="up" href="../" title="Russ Allbery" />
t/data/spin/text/output/big-eight.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Guidelines for Big Eight Newsgroup Creation</title>
<link rel="stylesheet" href="/~eagle/styles/faq.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<!-- $Id: big-eight,v 1.16 2020/12/06 00:43:12 eagle Exp $ -->
t/data/spin/text/output/docknot-changes.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Revision history for DocKnot</title>
<link rel="stylesheet" href="/~eagle/styles/news.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<!-- Converted by DocKnot %VERSION% on %DATE% -->
t/data/spin/text/output/mjqmail.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Using Majordomo with qmail FAQ</title>
<link rel="stylesheet" href="/~eagle/styles/faq.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<!-- Converted by DocKnot %VERSION% on %DATE% -->
t/data/spin/text/output/rgra.html view on Meta::CPAN
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>rec.games.roguelike.announce Posting Guidelines</title>
<link rel="stylesheet" href="/~eagle/styles/faq-short.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<!-- Converted by DocKnot %VERSION% on %DATE% -->