From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.sgregoratto.me (mail.sgregoratto.me [149.28.166.45]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id d26269a9 for ; Sat, 20 Apr 2019 07:43:49 -0500 (EST) Received: from mail.sgregoratto.me (localhost [127.0.0.1]) by mail.sgregoratto.me (Postfix) with ESMTP id 3EB463E8BB for ; Sat, 20 Apr 2019 22:43:46 +1000 (AEST) Authentication-Results: mail.sgregoratto.me (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=sgregoratto.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sgregoratto.me; h=user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:to:from:from:date:date; s=dkim; t=1555764225; x=1558356226; bh=BxN8jlMAqKytDHy72sSrIKEZ 1zEXwmCX0DstXuWuJhM=; b=bvo2HzsWEwm0ojv9xsq7iugIaHV5cCY/OY+AgCNg YJ5+o2w9vCecmtM13Eq6UIhWLWJy+vF9L/6SzZeSeZPuCC7oRuV49Gm9f/s3LZ0X JNzBL0SzDWXjoLMuriSZAGWIls1sTh0uwvf9XirBU0rZ/BMwXWKkAOqO3bUfzge0 0Cw= X-Virus-Scanned: Debian amavisd-new at mail.sgregoratto.me Received: from mail.sgregoratto.me ([127.0.0.1]) by mail.sgregoratto.me (mail.sgregoratto.me [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aUsfxgF-Gd95 for ; Sat, 20 Apr 2019 22:43:45 +1000 (AEST) Received: from localhost (172.44.179.58.sta.dodo.net.au [58.179.44.172]) by mail.sgregoratto.me (Postfix) with ESMTPSA id 983A83E8B3 for ; Sat, 20 Apr 2019 22:43:45 +1000 (AEST) Date: Sat, 20 Apr 2019 22:43:45 +1000 From: Stephen Gregoratto To: discuss@mandoc.bsd.lv Subject: Converting the Xenocara manpages Message-ID: <20190420124345.22eynr3sxzu4ybgd@BlackBox> Mail-Followup-To: discuss@mandoc.bsd.lv X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: NeoMutt/20180716 Since you mentioned converting the DocBook files in the Xenocara tree on Undeadly, I thought I'd take a quick stab at converting some of them myself. To start, I'm only going to focus on manpages. A quick recursive grep shows that there are only 47 of these. Some notes: One particularly bad case is lib/libXcomposite/man/Xcomposite.xml. It starts as a , a collection of 's. This is strange considering that it only has one: Xcomposite(3). docbook2mdoc renders this as one big, bold string. Piping just the refentry node to docbook2mdoc is almost perfect: the only error is encountering the unknown "" element, which would we would output as .Ft void. Might make a patch for this later. All of the sgml files in dist/fontconfig/doc contain more than one refentry node (funny considering that this is where a would be useful). Only the first node gets its own ".Dd .Dt .Os" preamble with the headers/text of subsequent nodes tacked on after. There are some approaches on how new refentry nodes could be handled: 1. Reset the parser and print another unique preamble. The resultant output could be split using a regular expression (e.g. perl or chaining awk+sed). I've tested csplit from the GNU coreutils which does this and it works quite well. 2. Reset the parser and write to a new file. I can already imagine this being a PITA to implement and changes the program from being a simple input filter to a full blown converter, so I don't think this is the best choice. 3. Split the sgml file itself using the method in approach 1 and run docbook2mdoc over each. No code needed then :). Many files reference variables that are set by autoconf. Some of them could be stripped out (e.g. version numbers) whilst others can should be replaced entirely (e.g. the *mansuffix variables). Anyway, that's all I've got for now. If you're not actively working on it, I might send a patches to tech@ for some edited conversions of these files. The only problem I would have is how deep autoconf integration should be (i.e. using @VARIABLES@) for the new files. But I'll cross that bridge when I get there. -- Stephen Gregoratto PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv