[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] a couple of fixes to html.cc
From: |
Gaius Mulley |
Subject: |
[Groff] a couple of fixes to html.cc |
Date: |
Mon, 13 Dec 99 10:30 GMT |
Hi Werner,
I've fixed a number of bugs in your manual page example with this
patch. I'm now up to the OPTIONS section I believe :-)
(incidently I use the -mhtml macros after the -man macros
to eliminate the hyphernation problem)
However I thought I'd email this patch in the hope that it
can be included in the ship before it leaves port?
Hopefully this is one advantage of being 5 hrs ahead
of the USA? :-). The diff is against the repositary 8:45am GMT.
On another point, I wonder whether when we install groff
if it should create symbolic links from the g equivalent
binaries to the old troff names.
On my machine (RH-5.2) the geqn, gtbl, grefer,
gseolim all disappeared after I removed them from the
previous release (/usr/bin/g...) and rebuilt groff
(when it installed them into /usr/local/bin).
Is this expected? Perhaps I'm installing it incorrectly?
many thanks for applying these changes
cheers Gaius
diff -r -c groff/grohtml/ChangeLog groff.cvs/grohtml/ChangeLog
*** groff/grohtml/ChangeLog Mon Dec 13 09:25:19 1999
--- groff.cvs/grohtml/ChangeLog Sat Dec 4 08:55:25 1999
***************
*** 1,31 ****
- 1999-12-11 Gaius Mulley <address@hidden>
- * fixed image position bugs. However three major bugs remain:
- firstly grohtml sometimes miscalculates the end of an html table
- resulting in text which appears twice. Secondly equation numbers
- are not handled correctly. Thirdly equation macros and pic macros
- can confuse grohtml. This can be seen by nested graphic-start's
- I believe the best method to solve this is to detect .EQ .EN
- .TS .TE .PS .PE sequences in troff and add the graphic-start
- special character at this point.
-
1999-11-29 Gaius Mulley <address@hidden>
! * fixed more bugs mainly in the table handling code. Making
! the code terminate a table at the correct position. Indented
! .IPs appear to work now. Region ends also correctly terminate
! tables.
!
! 1999-11-05 Gaius Mulley <address@hidden>
!
! * fixed many bugs in the table handling code. Reverted the -t
! switch so that table handling code is used by default and
! users must turn it off with -t.
! Manual page generation using groff -Thtml -man is much better
due in large part to the table code and minor alterations in
tmac.an.
1999-10-30 Gaius Mulley <address@hidden>
! * implemented auto formatting and introduced html table
code. Fixed several text handling bugs and grohtml will
detect centered lines - an offshoot of the html table code.
--- 1,28 ----
1999-11-29 Gaius Mulley <address@hidden>
!
! * design.ms: More updates; added some basic introductional
! information.
!
! * html.cc: Fixed more bugs mainly in the table handling code.
! Making the code terminate a table at the correct position.
! Indented .IPs appear to work now. Region ends also correctly
! terminate tables.
!
! 1999-11-16 Gaius Mulley <address@hidden>
!
! * design.ms, grohtml.man: Updated.
!
! * html.cc, ordered_list.h: Fixed many bugs in the table handling
! code. Reverted the -t switch so that table handling code is used
! by default and users must turn it off with -t.
!
! Manual page generation using `groff -Thtml -man' is much better
due in large part to the table code and minor alterations in
tmac.an.
1999-10-30 Gaius Mulley <address@hidden>
! * implemented auto formatting and introduced html table
code. Fixed several text handling bugs and grohtml will
detect centered lines - an offshoot of the html table code.
diff -r -c groff/grohtml/grohtml.man groff.cvs/grohtml/grohtml.man
*** groff/grohtml/grohtml.man Mon Dec 13 09:26:49 1999
--- groff.cvs/grohtml/grohtml.man Thu Dec 2 20:39:53 1999
***************
*** 132,140 ****
.BR B ,
and
.B BI
! mounted at font positions 1 to 4. It is advisable to invoke
! groff with the -mhtml macro set, which turns off; headers, footers,
! hyphernation and it will right justify text.
.SH DEPENDENCIES
grohtml is dependent upon grops and gs.
If grohtml has been configured to generate gif files then it is
--- 132,138 ----
.BR B ,
and
.B BI
! mounted at font positions 1 to 4.
.SH DEPENDENCIES
grohtml is dependent upon grops and gs.
If grohtml has been configured to generate gif files then it is
***************
*** 144,155 ****
Images are generated whenever a table, picture, equation or line is
encountered.
.SH BUGS
! This is still very alpha.
! At least three major bugs remain:
! firstly grohtml sometimes miscalculates the end of an html table
! resulting in text which appears twice. Secondly equation numbers
! are not handled correctly. Thirdly equation macros and pic macros
! can confuse grohtml.
.SH "SEE ALSO"
.BR afmtodit (@MAN1EXT@),
.BR groff (@MAN1EXT@),
--- 142,148 ----
Images are generated whenever a table, picture, equation or line is
encountered.
.SH BUGS
! This is still fairly alpha, nevertheless I find it useful.
.SH "SEE ALSO"
.BR afmtodit (@MAN1EXT@),
.BR groff (@MAN1EXT@),
diff -r -c groff/grohtml/html.cc groff.cvs/grohtml/html.cc
*** groff/grohtml/html.cc Mon Dec 13 10:58:04 1999
--- groff.cvs/grohtml/html.cc Sat Dec 4 08:55:25 1999
***************
*** 1609,1618 ****
int r = font::res;
int height = output_style.point_size*r/72;
! if (output_vpos >=0) {
! // we leave it alone if it is set to the top of page
! output_vpos += height;
! }
need_paragraph = TRUE; // delay the <p> just in case we don't actually
emit text
in_paragraph = TRUE;
issued_newline = TRUE;
--- 1609,1615 ----
int r = font::res;
int height = output_style.point_size*r/72;
! output_vpos += height;
need_paragraph = TRUE; // delay the <p> just in case we don't actually
emit text
in_paragraph = TRUE;
issued_newline = TRUE;
***************
*** 1682,1690 ****
w = page_contents->words.get_data();
if ((w->maxh >= 0) && (w->maxh > right_margin_indent)) {
right_margin_indent = w->maxh;
- #if 0
- if (right_margin_indent == 950) stop();
- #endif
}
page_contents->words.move_right();
} while (! page_contents->words.is_equal_to_head());
--- 1679,1684 ----
***************
*** 1697,1705 ****
g = page_contents->lines.get_data();
if ((g->maxh >= 0) && (g->maxh > right_margin_indent)) {
right_margin_indent = g->maxh;
- #if 0
- if (right_margin_indent == 950) stop();
- #endif
}
page_contents->lines.move_right();
} while (! page_contents->lines.is_equal_to_head());
--- 1691,1696 ----
***************
*** 1794,1813 ****
void html_printer::display_regions (void)
{
! if (debug_table_on) {
region_glob *r;
! fprintf(stderr, "==========s t a r t===========\n");
if (! page_contents->regions.is_empty()) {
page_contents->regions.start_from_head();
do {
r = page_contents->regions.get_data();
! fprintf(stderr, "region minv %d maxv %d\n", r->minv, r->maxv);
page_contents->regions.move_right();
} while (! page_contents->regions.is_equal_to_head());
}
! fprintf(stderr, "============e n d=============\n");
! fflush(stderr);
}
}
--- 1785,1803 ----
void html_printer::display_regions (void)
{
! if (debug_on) {
region_glob *r;
! printf("==========s t a r t===========\n");
if (! page_contents->regions.is_empty()) {
page_contents->regions.start_from_head();
do {
r = page_contents->regions.get_data();
! printf("region minv %d maxv %d\n", r->minv, r->maxv);
page_contents->regions.move_right();
} while (! page_contents->regions.is_equal_to_head());
}
! printf("============e n d=============\n");
}
}
***************
*** 2225,2235 ****
}
do {
- #if 0
- if ((t != 0) && (strcmp(t->text_string, "(1.a)") == 0)) {
- stop();
- }
- #endif
if ((t == 0) && (g != 0)) {
if (is_within_region(g)) {
something = TRUE;
--- 2215,2220 ----
***************
*** 2737,2746 ****
int html_printer::is_on_same_line (text_glob *g, int vpos)
{
! return(
! (vpos >= 0) &&
! is_intersection(vpos, vpos+g->text_style.point_size*font::res/72-1,
g->minv, g->maxv)
! );
}
--- 2722,2728 ----
int html_printer::is_on_same_line (text_glob *g, int vpos)
{
! return( is_intersection(vpos, vpos+g->text_style.point_size*font::res/72-1,
g->minv, g->maxv) );
}
***************
*** 3468,3475 ****
int mingap=calculate_min_gap(start);
int limit;
! #if 0
! if (strcmp(start->text_string, "man") == 0) {
stop();
}
#endif
--- 3450,3457 ----
int mingap=calculate_min_gap(start);
int limit;
! #if 0
! if (strcmp(start->text_string, "(x)") == 0) {
stop();
}
#endif
***************
*** 3513,3521 ****
if ((! conflict_with_words(next_guess, all_words)) &&
(continue_searching_column(next_guess, next_guess, all_words)) &&
! (! page_contents->words.is_equal_to_head()) &&
! ((end_region_vpos < 0) || (limit < end_region_vpos)) &&
! (limit > 0)) {
combine_line(last_guess, next_line);
// subtract any columns which are bridged by a sequence of words
--- 3495,3501 ----
if ((! conflict_with_words(next_guess, all_words)) &&
(continue_searching_column(next_guess, next_guess, all_words)) &&
! (! page_contents->words.is_equal_to_head())) {
combine_line(last_guess, next_line);
// subtract any columns which are bridged by a sequence of words
***************
*** 3581,3587 ****
} else {
t = page_contents->words.get_data();
if ((end_region_vpos > 0) && (t->minv > end_region_vpos)) {
! indentation.vertical_limit = min(indentation.vertical_limit,
end_region_vpos+1);
} else if (indentation.vertical_limit < 0) {
// -1 as we don't want to include section heading itself
indentation.vertical_limit = -indentation.vertical_limit-1;
--- 3561,3567 ----
} else {
t = page_contents->words.get_data();
if ((end_region_vpos > 0) && (t->minv > end_region_vpos)) {
! indentation.vertical_limit = end_region_vpos+1;
} else if (indentation.vertical_limit < 0) {
// -1 as we don't want to include section heading itself
indentation.vertical_limit = -indentation.vertical_limit-1;
***************
*** 3594,3600 ****
rewind_text_to(start);
i = count_columns(last_guess);
! if (((lines > 2) && ((i>1) || (continue_searching_column(last_guess,
last_guess, all_words)))) ||
((lines == 1) && (large_enough_gap(last_guess)))) {
// copy match into permenant html_table
--- 3574,3580 ----
rewind_text_to(start);
i = count_columns(last_guess);
! if (((lines > 1) && ((i>1) || (continue_searching_column(last_guess,
last_guess, all_words)))) ||
((lines == 1) && (large_enough_gap(last_guess)))) {
// copy match into permenant html_table
***************
*** 3911,3920 ****
do {
i = find_column_index(t);
if (indentation.columns[i].left != 0) {
- if (debug_table_on) {
- fprintf(stderr, "[%s] in column %d at %d..%d limit %d\n",
t->text_string,
- i, t->minv, t->maxv, indentation.vertical_limit);
fflush(stderr);
- }
indentation.columns[i].is_used = TRUE;
}
page_contents->words.move_right();
--- 3891,3896 ----
***************
*** 4020,4025 ****
--- 3996,4002 ----
{
int current_vpos=g->minv;
+ para_type = center_alignment;
move_vertical(g, center_alignment);
header.written_header = FALSE;
***************
*** 4120,4126 ****
int temp_vpos;
if (auto_on) {
! if ((more_than_line_break(output_vpos, g->minv, height)) || (p !=
para_type)) {
end_paragraph();
begin_paragraph(p);
} else {
--- 4097,4103 ----
int temp_vpos;
if (auto_on) {
! if (more_than_line_break(output_vpos, g->minv, height)) {
end_paragraph();
begin_paragraph(p);
} else {
***************
*** 4281,4299 ****
html_newline();
temp_vpos += height;
}
! }
! }
! if (auto_on && (is_in_middle(start_region_hpos, end_region_hpos))) {
! is_center = TRUE;
! } else {
! if (start_region_hpos > left_margin_indent) {
! html.put_string("<span style=\" text-indent: ");
!
html.put_float(((double)(start_region_hpos-left_margin_indent)/((double)r)));
! html.put_string("in;\"></span>");
! }
! }
! #if 0
! } else {
// on the same line
if (start_region_hpos > output_hpos) {
html.put_string("<span style=\" text-indent: ");
--- 4258,4273 ----
html_newline();
temp_vpos += height;
}
! if (auto_on && (is_in_middle(start_region_hpos, end_region_hpos))) {
! is_center = TRUE;
! } else {
! if (start_region_hpos > left_margin_indent) {
! html.put_string("<span style=\" text-indent: ");
!
html.put_float(((double)(start_region_hpos-left_margin_indent)/((double)r)));
! html.put_string("in;\"></span>");
! }
! }
! } else {
// on the same line
if (start_region_hpos > output_hpos) {
html.put_string("<span style=\" text-indent: ");
***************
*** 4302,4308 ****
}
}
}
- #endif
output_vpos = start_region_vpos;
output_hpos = start_region_hpos;
return( is_center );
--- 4276,4281 ----
***************
*** 5118,5124 ****
static char stderr_buf[BUFSIZ];
setbuf(stderr, stderr_buf);
int c;
! while ((c = getopt(argc, argv, "F:atvdgmx?I:r:")) != EOF)
switch(c) {
case 'v':
{
--- 5091,5097 ----
static char stderr_buf[BUFSIZ];
setbuf(stderr, stderr_buf);
int c;
! while ((c = getopt(argc, argv, "F:atvdgm?I:r:")) != EOF)
switch(c) {
case 'v':
{
***************
*** 5146,5155 ****
break;
case 'd':
// debugging on
! debug_on = TRUE;
! break;
! case 'x':
! debug_table_on = TRUE;
break;
case 'g':
// do not guess title and headings
--- 5119,5125 ----
break;
case 'd':
// debugging on
! debug_on = TRUE;
break;
case 'g':
// do not guess title and headings
- [Groff] a couple of fixes to html.cc,
Gaius Mulley <=