From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from acme.spoerlein.net (acme.spoerlein.net [188.72.220.29]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o4BGcuxe023643 for ; Tue, 11 May 2010 10:38:56 -0600 (MDT) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o4BKRFCU001110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 May 2010 22:27:15 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1273609635; bh=9LYPgvey0qc5KcmzPFGyIM89O+AWiJHFUQLvLPvRxAM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=FypwuAPBsn4lmPqBUFLvyBBnfWHEw9hflqq7bwvGW8eoURMzmtVlCpicn+nMGsbVa jfTPoeJPGv7bwYAI7nIKnxXLspczpAPIl2X+GcUpQP3C7h98/zrTh4hEx6heQLe3Z8 5FhfAJAByS7n6or1XTDVAvDP+sMT89bMOjidfog4= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o4BKRFre001109; Tue, 11 May 2010 22:27:15 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Tue, 11 May 2010 22:27:15 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: discuss@mdocml.bsd.lv Cc: Joerg Sonnenberger Subject: Re: mdoc section ordering Message-ID: <20100511202715.GC88504@acme.spoerlein.net> References: <20100511115233.GV88504@acme.spoerlein.net> <20100511134542.GA24992@bramka.kerhand.co.uk> <20100511145711.GW88504@acme.spoerlein.net> <20100511154317.GB24992@bramka.kerhand.co.uk> <20100511162352.GY88504@acme.spoerlein.net> <4BE9B98D.3060706@bsd.lv> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cmJC7u66zC7hs+87" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4BE9B98D.3060706@bsd.lv> User-Agent: Mutt/1.5.20 (2009-06-14) --cmJC7u66zC7hs+87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, 11.05.2010 at 22:09:49 +0200, Kristaps Dzonsons wrote: > > I'm fine with that, only then mandoc should stop "enforcing" this > > ordering. It's perfectly fine with me! > > > > Kristaps, what to you think? > > Seems the consensus is to roll with the FreeBSD version, which is fine > by me. The sections were originally unioned over all mdoc.template and > man.template files I could find. I didn't sweat the order. > > End result: > > .Sh NAME > .Sh LIBRARY > .Sh SYNOPSIS > .Sh DESCRIPTION > .Sh IMPLEMENTATION NOTES <-- this one seems wankiest to me > .Sh RETURN VALUES > .Sh ENVIRONMENT > .Sh FILES > .Sh EXIT STATUS > .Sh EXAMPLES > .Sh DIAGNOSTICS > .Sh COMPATIBILITY > .Sh ERRORS > .Sh SEE ALSO > .Sh STANDARDS > .Sh HISTORY > .Sh AUTHORS > .Sh CAVEATS > .Sh BUGS > .Sh SECURITY CONSIDERATIONS <-- shouldn't this be CAVEATS? > > Jason, in my opinion, COMPATIBILITY and STANDARDS shouldn't be merged in > all cases. Take mdocml's man.7 and mdoc.7, for example: the > COMPATIBILITY section is used to enumerate the differences between > troffs and mandoc. Since -man, -mdoc, etc. aren't standards, where else > would this go? > > Anyway, if everybody ok's this order, I'll commit it and add the > requisite bits to the docs. > > Ulrich, you said you know of a handful of mis-ordered NetBSD pages. Can > you post those to Joerg? He'll probably want to know about them (will > your python script auto-gen a patch for him?). The script is by Ruslan, not me. I actually did the reordering by hand using vim macros, but if my understanding of python is correct it will print out re-ordered manpages which should be very useful. I'm sure Ruslan wouldn't mind me posting the script for general use. Make sure you update the section ordering to what you want to end up with. Uli --cmJC7u66zC7hs+87 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=sections Content-Transfer-Encoding: 8bit #!/usr/local/bin/python # -*- coding: KOI8-R -*- import sys sections = [ '00', 'NAME', 'НАЗВАНИЕ', 'LIBRARY', 'БИБЛИОТЕКА', 'SYNOPSIS', 'СИНТАКСИС', 'DESCRIPTION', 'ОПИСАНИЕ', 'IMPLEMENTATION NOTES', 'ОСОБЕННОСТИ РЕАЛИЗАЦИИ', 'RETURN VALUES', 'ВОЗВРАЩАЕМЫЕ ЗНАЧЕНИЯ', 'ENVIRONMENT', 'ОКРУЖЕНИЕ', 'FILES', 'ФАЙЛЫ', 'EXIT STATUS', 'СТАТУС ЗАВЕРШЕНИЯ', 'EXAMPLES', 'ПРИМЕРЫ', 'DIAGNOSTICS', 'ДИАГНОСТИКА', 'COMPATIBILITY', 'СОВМЕСТИМОСТЬ', 'ERRORS', 'ОШИБКИ', 'SEE ALSO', 'СМОТРИ ТАКЖЕ', 'STANDARDS', 'СТАНДАРТЫ', 'HISTORY', 'ИСТОРИЯ', 'AUTHORS', 'АВТОРЫ', 'BUGS', 'ПРОБЛЕМЫ', ] def check_sections(manpage): lines = {} section = '00' last_idx = 0 lineno = 0 for line in file(manpage): lineno += 1 words = line.split() if len(words) > 0 and words[0] == '.Sh': sname = ' '.join(words[1:]) if (sname in sections): idx = sections.index(sname) if (idx < last_idx): warn("%s:%d: %s comes before %s" % (manpage, lineno, sname, sections[last_idx])) last_idx = idx section = sname if section not in lines: lines[section] = [] lines[section].append(line) for section in sections: if section in lines: for line in lines[section]: print line, def warn(msg): sys.stderr.write(msg + '\n') def main(): if len(sys.argv) > 1: for file in sys.argv[1:]: check_sections(file) else: check_sections("/dev/stdin") main() --cmJC7u66zC7hs+87-- -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv