Results 1 to 4 of 4
Hello everyone, a current project of mine is to write a Perl script to generate a webpage that allows one to browse his/her local manpages. The problem is that I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-14-2005 #1
A Dynamic webpage
open(FILE, "> $file") || die ("Couldn't open $file: $!\n"); print FILE "<html>\n"; print FILE "<head><title>Local Manpage Browser</title></head>\n"; print FILE "<body>\n"; print FILE "<a href=\"browsegen.pl\">All sections</a>\n"; print FILE "<a href=\"browsegen.pl 1\">Section 1</a>\n"; # Other man sections go here system "firefox $file";
Thanks for all your help!
- 12-15-2005 #2
If I understand you correctly, I may be able to help you. But, let me ask you a couple of questions first:
1. Are the 'man' pages in HTML format (or some format that can be loaded directly by the browser)?
2. What type of links does your 'browsegen.pl' program produce - UNIX [file structure] or HTML [code]?
- 12-15-2005 #3
Here are the answers to your questions:
1. The manpages are in their default format, but the program is designed to convert them on the fly with zcat and man2html.
2. browsegen.pl produces full HTML code. Sample output should look something like this:
% browsegen.pl 1 <html> <head><title>Local Manpages: Section 1</title></head> <body> <-- Links to manpages go here; the links actually activate zcat $manpage | man2html to convert the pages into HTML on the fly. --> </body> </html>
- 12-16-2005 #4If I understand you correctly, I may be able to help you.
I am not sure of how you would do this with "just" HTML -- you might have to use java...