Hi!
On Wed, Mar 24, 2010 at 02:58:04PM +0200, Alex Efros wrote:
> OS Inferno and OS Plan9 uses more simple format:
> http://man.cat-v.org/inferno/6/man
I'm trying to implement support for this format in asciidoc's .conf file,
so `asciidoc -d manpage -b man manpage.txt` will do the job. But there
troubles with troff specifics (am I forgot to say I hate it just like xml?).
For example, function names should be BOLD (actually, MONOSPACED, but it's
implemented using bold attribute), params should be ITALIC, and there
shouldn't be any needless spaces between them. Using html this may looks
this way:
<p>... call it as <b>func(</b><i>param1</i><b>,</b><i>param2</i><b>)</b>.</p>
As real-world examples of this convention you can check these pages:
http://www.vitanuova.com/inferno/man/2/convcs.html
http://www.vitanuova.com/inferno/man/2/ida.html
and their sources:
http://code.google.com/p/inferno-os/source/browse/man/2/convcs
http://code.google.com/p/inferno-os/source/browse/man/2/ida
In Inferno troff above example (with func(param1,param2)) may look this way:
... call it as
.BI func( param1 , param2 ).
That's not really correct because this way last dot become BOLD, while it
should be NORMAL(Roman). But if we move it to next line after .BI to make
it non-bold, we'll have two issues: there will be needless space between
closing parens and last dot, and we'll have to escape this dot in some way
because it happens at beginning of line.
In asciidoc markup, it has a little sense to mark every part as
bold/italic because it quickly become unreadable:
... call it as *func(*'param1'*,*'param2'*)*.
probably it will be better to mark full function call at once, and have
asciidoc handle details:
... call it as *func(param1,param2)*.
I managed to get /etc/asciidoc/man.conf doing this work to some extent,
but it become very complex and ugly, because I have to work around some
default definitions in main asciidoc.conf and because it's hard to detect
correct troff command (use just .B or .BI and include some following text
in same troff line?) at first attempt and so I use [macros] and
[replacements2] sections a lot, which make it hard to make sure next
syntax changes/fixes won't broke anything.
If anybody know better way to solve my task (generate correct man pages
for simple and limited troff used in OS Inferno/Plan9 from asciidoc
source) - I'd like to know about it. Any examples of asciidoc's conf file
snippets suitable for such task also will be very interesting for me.
--
WBR, Alex.
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.