tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* [docbook2mdoc] Treat <info> as <refentryinfo>
@ 2019-04-23 15:01 Stephen Gregoratto
  2019-04-23 15:04 ` Stephen Gregoratto
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Gregoratto @ 2019-04-23 15:01 UTC (permalink / raw)
  To: tech

In DocBook 5.x, <refentryinfo> morphed into <info>, but docbook2mdoc 
does not format them the same way. On my files, info is printed at the 
top before NAME. I tried aliasing info to refentry info but the output 
became mangled, with PREFACE's and mutiple SYNOPSIS' inserted.
-- 
Stephen Gregoratto
PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [docbook2mdoc] Treat <info> as <refentryinfo>
  2019-04-23 15:01 [docbook2mdoc] Treat <info> as <refentryinfo> Stephen Gregoratto
@ 2019-04-23 15:04 ` Stephen Gregoratto
  2019-04-23 22:33   ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Gregoratto @ 2019-04-23 15:04 UTC (permalink / raw)
  To: tech

On 2019-04-24 01:01, Stephen Gregoratto wrote:
> In DocBook 5.x, <refentryinfo> morphed into <info>, but docbook2mdoc 
> does not format them the same way. On my files, info is printed at the 
> top before NAME. I tried aliasing info to refentry info but the output 
> became mangled, with PREFACE's and mutiple SYNOPSIS' inserted.
> -- 
> Stephen Gregoratto
> PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B

Forgot to say that this is found extensively in the OpenGL refpages 
project, which used the official db4-upgrade stylesheet on all their 
files.
-- 
Stephen Gregoratto
PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [docbook2mdoc] Treat <info> as <refentryinfo>
  2019-04-23 15:04 ` Stephen Gregoratto
@ 2019-04-23 22:33   ` Ingo Schwarze
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Schwarze @ 2019-04-23 22:33 UTC (permalink / raw)
  To: Stephen Gregoratto; +Cc: tech

Hi Stephen,

Stephen Gregoratto wrote on Wed, Apr 24, 2019 at 01:04:24AM +1000:
> On 2019-04-24 01:01, Stephen Gregoratto wrote:

>> In DocBook 5.x, <refentryinfo> morphed into <info>, but docbook2mdoc 
>> does not format them the same way. On my files, info is printed at the 
>> top before NAME.

Fixed with the commit shown below.

>> I tried aliasing info to refentry info but the output 
>> became mangled, with PREFACE's and mutiple SYNOPSIS' inserted.

Indeed, the <info> element is used in very different contexts.
Trying to handle them all in the same way won't make you happy.

> Forgot to say that this is found extensively in the OpenGL refpages 
> project,

That hint was indeed crucial.  Without it, i wouldn't have had
examples to look at and wouldn't have known where to start.

Thanks for the report,
  Ingo


Log Message:
-----------
handle <info> like <refentryinfo> inside the document element
and inside <refentry>; issue found in OpenGL-Refpages
by Stephen Gregoratto <dev at sgregoratto dot me>

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.133 -r1.134
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -812,6 +812,8 @@ pnode_printrefentry(struct format *f, st
 			pnode_unlink(info);
 			info = NULL;
 		}
+		if (info == NULL)
+			info = pnode_takefirst(n, NODE_INFO);
 		meta = pnode_takefirst(n, NODE_REFMETA);
 		if (meta != NULL && TAILQ_FIRST(&meta->childq) == NULL) {
 			pnode_unlink(meta);
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-23 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 15:01 [docbook2mdoc] Treat <info> as <refentryinfo> Stephen Gregoratto
2019-04-23 15:04 ` Stephen Gregoratto
2019-04-23 22:33   ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).