So funktionierts:
- 1. Hilfe in eine pod Datei schreiben
- 2. Pod Datei nach doc/online/<lang>/<tag>.html legen,
wobei <lang> der countrycode der locale ist,
und <tag> ein /[a-zA-Z0-9_]+/ Identifier ist.
- 3. HTML erzeugen mit:
scripts/make_docs.pl
- 4. Im Template einen Hilfelink einbinden mit:
[% L.online_help_tag('tag') %]
/users/templates-cache/
/users/pid/
/config/lx_office.conf
+/doc/online/*/*.html
+pod2html*
return $code;
}
+sub online_help_tag {
+ my ($self, $tag, @slurp) = @_;
+ my %params = _hashify(@slurp);
+ my $cc = $::myconfig{countrycode};
+ my $file = "doc/online/$cc/$tag.html";
+ my $text = $params{text} || $::locale->text('Help');
+
+ die 'malformed help tag' unless $tag =~ /^[a-zA-Z0-9_]+$/;
+ return unless -f $file;
+ return $self->html_tag('a', $text, href => $file, target => '_blank');
+}
+
sub dump {
my $self = shift;
require Data::Dumper;
/*
Überschriftsbalken
*/
-.listtop {
+.listtop, h1 {
background-color: rgb(236,233,216);
text-align:left;
padding:5px;
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+
+use Pod::Html;
+use File::Find;
+
+my $doc_path = "doc/online";
+#my $pod2html_bin = `which pod2html` or die 'cannot find pod2html on your system';
+
+find({no_chdir => 1, wanted => sub {
+ next unless -f;
+ next unless /\.pod$/;
+ print "processing $_,$/";
+ my $html_file = $_;
+ $html_file =~ s/\.pod$/.html/;
+ pod2html(
+# $pod2html_bin,
+ '--noindex',
+ '--css=../../../css/lx-office-erp.css',
+ "--infile=$_",
+ "--outfile=$html_file",
+ );
+}}, $doc_path);
+
+1;