Simple console application (written for my university python course) for converting from man (nroff format) into html.
Converts nroff data into html format.
./main.py --input FILE [--output FILE]
./main.py --input tmp.txt --output output.html
Or to convert from man directly use the following one:
zcat `man -w g++` > in.txt; ./main.py -i in.txt -o out.html
--input FILE
— input file in nroff format--output FILE
— output file (will have html format)
Subsidiary functions.
man2html(text_lines)
— converts nroff text into html one by onemodify_line(line)
— converts one line from nroff into htmlapply_part_tags(line)
— modifies line with one kind of tags while possibleapply_part_tags_once(line)
— modifies line with the same kind of tags oneapply_not_closing_tags(line)
— modifies line with one kind of tags that doesn't have closing oneschange_font(line)
— changes current font based online
tagsupdate_font(positions)
— updates current font based on nroff rules
Small script using utils to convert data from nroff into html format.