From: Ingo Schwarze <schwarze@usta.de>
To: Stephen Gregoratto <dev@sgregoratto.me>
Cc: tech@mandoc.bsd.lv
Subject: Re: [docbook2mdoc] Treat <info> as <refentryinfo>
Date: Wed, 24 Apr 2019 00:33:58 +0200 [thread overview]
Message-ID: <20190423223358.GM64114@athene.usta.de> (raw)
In-Reply-To: <20190423150424.tzxnjp2bpngt6sn7@BlackBox>
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
prev parent reply other threads:[~2019-04-23 22:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 15:01 Stephen Gregoratto
2019-04-23 15:04 ` Stephen Gregoratto
2019-04-23 22:33 ` Ingo Schwarze [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190423223358.GM64114@athene.usta.de \
--to=schwarze@usta.de \
--cc=dev@sgregoratto.me \
--cc=tech@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).