Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
pod2html: render without stylesheet by default (#4016)
Browse files Browse the repository at this point in the history
fixes #3956
  • Loading branch information
stapelberg committed Apr 12, 2020
1 parent 46e940e commit e7191af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions docs/i3-pod2html
Expand Up @@ -4,8 +4,14 @@
use strict;
use warnings;
use Pod::Simple::HTML;
use Getopt::Long;
use v5.10;

my $stylesurl = '';

GetOptions("stylesurl=s" => \$stylesurl)
or die "parsing flags";

$Pod::Simple::HTML::Tagmap{'Verbatim'} = '<pre><tt>';
$Pod::Simple::HTML::Tagmap{'VerbatimFormatted'} = '<pre><tt>';
$Pod::Simple::HTML::Tagmap{'/Verbatim'} = '</tt></pre>';
Expand All @@ -22,16 +28,17 @@ open(my $out, '>', $ARGV[1]) or die "Couldn’t open $ARGV[1] for writing: $!\n"
my $parser = Pod::Simple::HTML->new();

$parser->index(1);
$parser->html_header_before_title(
<<'EOF'
if ($stylesurl ne '') {
$parser->html_header_before_title(
<<EOF
<!doctype html>
<html lang="en">
<head>
<link rel="icon" type="image/png" href="/favicon.png">
<meta charset="utf-8">
<meta name="generator" content="Pod::Simple::HTML">
<meta name="description" content="i3 Perl documentation">
<link rel="stylesheet" href="https://i3wm.org/css/style.css" type="text/css" />
<link rel="stylesheet" href="$stylesurl/style.css" type="text/css" />
<style type="text/css">
.pod pre {
background: #333;
Expand Down Expand Up @@ -63,7 +70,8 @@ tt {
</style>
<title>
EOF
);
);
}
$parser->html_header_after_title(
<<'EOF'
</title>
Expand Down
8 changes: 4 additions & 4 deletions travis/docs.sh
Expand Up @@ -7,10 +7,10 @@ for f in $(grep '\.html$' debian/i3-wm.docs | grep -v 'docs/refcard.html' | grep
do
asciidoc -a linkcss -a stylesdir=https://i3wm.org/css -a scriptsdir=https://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf $(dirname $f)/$(basename $f .html)
done
./docs/i3-pod2html i3-dmenu-desktop man/i3-dmenu-desktop.html
./docs/i3-pod2html i3-save-tree man/i3-save-tree.html
./docs/i3-pod2html build/testcases/lib/i3test.pm docs/lib-i3test.html
./docs/i3-pod2html testcases/lib/i3test/Test.pm docs/lib-i3test-test.html
./docs/i3-pod2html --stylesurl=https://i3wm.org/css i3-dmenu-desktop man/i3-dmenu-desktop.html
./docs/i3-pod2html --stylesurl=https://i3wm.org/css i3-save-tree man/i3-save-tree.html
./docs/i3-pod2html --stylesurl=https://i3wm.org/css build/testcases/lib/i3test.pm docs/lib-i3test.html
./docs/i3-pod2html --stylesurl=https://i3wm.org/css testcases/lib/i3test/Test.pm docs/lib-i3test-test.html
for file in $(sed 's/\.1$/.man/g' debian/i3-wm.manpages)
do
[ -f "$file" ] && asciidoc -a linkcss -a stylesdir=https://i3wm.org/css -a scriptsdir=https://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf "$file"
Expand Down

0 comments on commit e7191af

Please sign in to comment.