Home > Software design >  How to setting a favicon in pod2html
How to setting a favicon in pod2html

Time:11-23

I documented some perl files with POD and made a webpage with pod2html. Is it possible to set a favicon to that?

=pod

=encoding UTF-8

=begin pod2html

<link rel="..." type="..." href="/...">

=end pod2html

=cut

But there is nothing in my html file about this favicon.

And where have I put this image to? Is it possible to put it in the perl file directly?

CodePudding user response:

Using a little batch script:

#!/bin/bash

pod2html my_pod_file.pl > my_html.html

sed -i '/<title/{ a <link rel="..." type="..." href="/..." />
; :label n; b label } my_html.html

sed -i '/<title/a <link ... ' my_html.html would work too, but then sed adds a line after all title tags.


If you use $1 instead of my_pod_file.pl and $2 instead of my_html.html, you can call your script like ./my_script my_pod_file.pl my_html.html.


Instead of "sed" you can use "ed":

ed my_html.html << EOF
/<title/a
<link ...
.
wq
EOF

Thanks to ubuntuusers.de

  • Related