History

20090505-1411

Charles.Forsyth committed 17 years ago

Commit aef75d61 parent c76c60b6 files · +38 −6Browse files

Unified · Split

6 files
  1. CHANGES +4 −0
  2. appl/cmd/man2html.b +20 −6
  3. dis/man2html.dis +0 −0
  4. include/version.h +1 −1
  5. lib/mimetype +1 −0
  6. man/1/man +13 −0
CHANGES+4−0
@@ -1,3 +1,7 @@
120090505
2 add -h/-t header/trailer options to man2html
320090430
4 filter-deflate(2), appl/lib/^(inflate.b deflate.b): changes from mjl to support zlib headers for deflate streams as well as gzip's
120090417520090417
2 add m4(1) in its initial form (might split the macro processing proper off into a library module)6 add m4(1) in its initial form (might split the macro processing proper off into a library module)
320090409720090409
appl/cmd/man2html.b+20−6
@@ -16,6 +16,8 @@ include "daytime.m"; · 15 unmodified lines
16include "string.m";16include "string.m";
17 str: String;17 str: String;
18 18
19include "arg.m";
20
19Man2html: module21Man2html: module
20{22{
21 init: fn(ctxt: ref Draw->Context, args: list of string);23 init: fn(ctxt: ref Draw->Context, args: list of string);
@@ -315,10 +317,12 @@ Global: adt { · 293 unmodified lines
315 softp: fn(g: self ref Global): string;317 softp: fn(g: self ref Global): string;
316};318};
317 319
320header := "<HTML><HEAD>";
321trailer := "</BODY></HTML>";
318 322
319usage()323usage()
320{324{
321 sys->fprint(stderr, "Usage: man2html file [section]\n");325 sys->fprint(stderr, "Usage: man2html [-h header] [-t trailer] file [section]\n");
322 raise "fail:usage";326 raise "fail:usage";
323}327}
324 328
@@ -329,11 +333,20 @@ init(nil: ref Draw->Context, args: list of string) · 4 unmodified lines
329 stderr = sys->fildes(2);333 stderr = sys->fildes(2);
330 str = load String String->PATH;334 str = load String String->PATH;
331 dt = load Daytime Daytime->PATH;335 dt = load Daytime Daytime->PATH;
332 g := Global_init();336 arg := load Arg Arg->PATH;
333 if(args != nil)337 arg->init(args);
334 args = tl args;338 arg->setusage("man2html [-h header] [-t trailer] file [section]");
339 while((o := arg->opt()) != 0)
340 case o {
341 'h' => header = arg->earg();
342 't' => trailer = arg->earg();
343 * => arg->usage();
344 }
345 args = arg->argv();
335 if(args == nil)346 if(args == nil)
336 usage();347 arg->usage();
348 arg = nil;
349 g := Global_init();
337 page := hd args;350 page := hd args;
338 args = tl args;351 args = tl args;
339 section := "1";352 section := "1";
@@ -341,6 +354,7 @@ init(nil: ref Draw->Context, args: list of string) · 1 unmodified line
341 section = hd args;354 section = hd args;
342 hit := Hit ("", "man", section, page);355 hit := Hit ("", "man", section, page);
343 domanpage(g, hit);356 domanpage(g, hit);
357 g.print(trailer+"\n");
344 g.bufio->g.bout.flush();358 g.bufio->g.bout.flush();
345}359}
346 360
@@ -1342,7 +1356,7 @@ title(g: ref Global, t: string, search: int) · 995 unmodified lines
1342{1356{
1343 if(search)1357 if(search)
1344 ; # not yet used1358 ; # not yet used
1345 g.print("<HTML><HEAD>\n");1359 g.print(header+"\n");
1346 g.print(sprint("<TITLE>Inferno's %s</TITLE>\n", demark(t)));1360 g.print(sprint("<TITLE>Inferno's %s</TITLE>\n", demark(t)));
1347 g.print("</HEAD>\n");1361 g.print("</HEAD>\n");
1348 g.print("<BODY bgcolor=\"#FFFFFF\">\n");1362 g.print("<BODY bgcolor=\"#FFFFFF\">\n");
dis/man2html.dis+0−0

Binary file not shown.

include/version.h+1−1
@@ -1 +1 @@
1#define VERSION "Fourth Edition (20090430)"1#define VERSION "Fourth Edition (20090505)"
lib/mimetype+1−0
@@ -62,6 +62,7 @@ · 61 unmodified lines
62.html text html - m62.html text html - m
63.ico image x-icon - y63.ico image x-icon - y
64.ief image ief - y64.ief image ief - y
65.iso application octet-stream - y # ISO9660 image
65.jad text vnd.sun.j2me.app-descriptor - y66.jad text vnd.sun.j2me.app-descriptor - y
66.jar application java-archive - y67.jar application java-archive - y
67.jfif image jpeg - y68.jfif image jpeg - y
man/1/man+13−0
@@ -33,6 +33,11 @@ print or find manual pages · 32 unmodified lines
33.I file ...33.I file ...
34.br34.br
35.B man2html35.B man2html
36[
37.BI -h " header"
38] [
39.BI -t " trailer"
40]
36.I file41.I file
37[42[
38.I section43.I section
@@ -126,6 +131,14 @@ It is assumed the input · 87 unmodified lines
126is a manual page, in the given131is a manual page, in the given
127.I section132.I section
128(default: 1).133(default: 1).
134The optional
135.I header
136string replaces the default header
137.B "<HTML><HEAD>"
138and the optional
139.I trailer
140string replaces the default trailer
141.BR "</BODY></HTML>" .
129.PP142.PP
130.I Man2txt143.I Man2txt
131converts144converts

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t