[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-44-g202c7a1



The following commit has been merged in the master branch:
commit 202c7a156e35968fbc3b627d030a432370c6e0cb
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jul 15 23:55:34 2012 +0200

    d/rules: Add target to generate HTML doc from lib/
    
    Add target (and helper tool) to generate HTML documentation from the
    POD embedded in the Lintian Perl modules.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index 0e72ae8..6969644 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -52,6 +52,9 @@ lintian (2.5.11) UNRELEASED; urgency=low
 
   * debian/control:
     + [NT] Add (Build-)Depends on libtext-levenshtein-perl.
+  * debian/rules:
+    + [NT] Add target to generate HTML API doc.  Currently
+      this is only run manually.
 
   * frontend/lintian:
     + [NT] Fix synopsis for --no-cfg option in the help output.
diff --git a/debian/rules b/debian/rules
index 474442d..873c1bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,6 +37,9 @@ profiles: $(profiles)
 $(profiles): $(allchecks) private/generate-profiles.pl
 	private/generate-profiles.pl
 
+api-doc:
+	private/generate-html-docs ./lib doc/api.html $(VER)
+
 runtests: $(neededfiles) $(allchecks) $(allcollect) $(tagfiles) $(testfiles)
 	@echo .... running tests ....
 	rm -rf "$(TEST_WORK_DIR)"
@@ -84,6 +87,7 @@ clean: $(neededfiles)
 	rm -f runtests build-stamp
 	rm -f doc/help.tmp doc/README
 	rm -rf doc/lintian.html/ doc/lintian.txt
+	rm -rf doc/api.html
 	rm -rf "$(TEST_WORK_DIR)"
 	rm -rf man/man1/
 	rm -fr debian/test.locale
diff --git a/private/generate-html-docs b/private/generate-html-docs
new file mode 100755
index 0000000..5b83ba8
--- /dev/null
+++ b/private/generate-html-docs
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Pod::Simple::HTMLBatch;
+use Pod::Simple::HTML;
+
+my ($input, $output, $version) = @ARGV;
+
+$input //= './lib';
+$output //= './doc/api.html';
+$version //= '<version>';
+
+if ( ! -d $output) {
+    mkdir $output or die "could not create directory: $!";
+}
+
+my $convert = Pod::Simple::HTMLBatch->new;
+$convert->html_render_class ('Pod::Simple::HTML');
+$convert->contents_page_start( header() );
+$convert->batch_convert ($input, $output);
+
+print "HTML version available at $output/index.html\n";
+
+sub header {
+
+    return <<EOF;
+
+<html>
+<head><title>Lintian (v$version) API doc</title></head>
+<body class='contentspage'>
+<h1>Lintian (v$version) API doc</h1>
+EOF
+}

-- 
Debian package checker


Reply to: