<br><div class="gmail_quote">2009/9/7 Charles Lepple <span dir="ltr">&lt;<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Mon, Sep 7, 2009 at 4:09 AM, Arnaud Quette&lt;<a href="mailto:aquette.dev@gmail.com">aquette.dev@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; 2009/9/4 Charles Lepple &lt;<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Sep 3, 2009 at 12:37 PM, Arnaud Quette&lt;<a href="mailto:aquette.dev@gmail.com">aquette.dev@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2009/9/2 Charles Lepple &lt;<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; With the AsciiDoc conversion underway, I am wondering if we should<br>
&gt;&gt; &gt;&gt; keep the AsciiDoc for the driver man pages in a specially-formatted<br>
&gt;&gt; &gt;&gt; comment in the driver (taking a cue from the comments specifying USB<br>
&gt;&gt; &gt;&gt; information).<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I have been doing something similar with the tripplite_usb driver for<br>
&gt;&gt; &gt;&gt; a while - it contains Perl-style POD (Plain Old Documentation) in a C<br>
&gt;&gt; &gt;&gt; comment, and the man page can be mechanically generated from that.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This way, the documentation is closer to the actual driver source<br>
&gt;&gt; &gt;&gt; code, and if someone changes a driver, they only need to send a single<br>
&gt;&gt; &gt;&gt; patch.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; well, I have a mixed feeling about that.<br>
&gt;&gt; &gt; IMO, having the doc and the code is a good thing.<br>
&gt;&gt; &gt; but in practice, looking at tripplite_usb shows that the header is kinda<br>
&gt;&gt; &gt; bloated.<br>
&gt;&gt;<br>
&gt;&gt; Bear in mind that much of each driver man page is boilerplate text, so<br>
&gt;&gt; that could be reduced a bit with AsciiDoc macros. I also included<br>
&gt;&gt; snippets of the protocol left over from the serial tripplite driver,<br>
&gt;&gt; which contributes to the comment bloat.<br>
&gt;<br>
&gt; well, there might also be some consolidation with information from<br>
&gt; upsdrv_info and the vartable (can be obtained through driver &quot;-help&quot; call).<br>
&gt;<br>
&gt; don&#39;t know if that can be considered though.<br>
<br>
</div></div>Could you provide an example of how you would use that for the man page?<br></blockquote><div> <br>in fact looking at the example shows that it&#39;s currently not possible.<br>ex with &quot;usbhid-ups -L&quot;<br>
...<br>VALUE offdelay &quot;Set shutdown delay, in seconds (default=20)&quot;<br>...<br>converts in the manpage to:<br>...<br>offdelay=num<br>    Set the timer before the UPS is turned off after the kill power command is sent (via the -k switch).<br>
<br>    The default value is 20 (in seconds). Usually this must be lower than ondelay, but the driver will not warn you upon startup if it isn’t.<br>...<br><br>the manpage clearly wins the verbosity round.<br><br>I was also thinking about adding an option (&quot;-I&quot; or &quot;-d&quot; =&gt; driver-info) to display the content of upsdrv_info. This seems still applicable for AUTHOR, NAME, DESCRIPTION and possibly some more...<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="h5">
&gt;&gt; &gt; moreover, it doesn&#39;t guarantee that the one who patch the code will<br>
&gt;&gt; &gt; remember<br>
&gt;&gt; &gt; to modify the inline doc (vs modifying an external one like the<br>
&gt;&gt; &gt; manpage).<br>
&gt;&gt; &gt; finally, having a single patch for 1 or 2 files doesn&#39;t make much<br>
&gt;&gt; &gt; difference.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; We probably don&#39;t need to do this for the client/server binaries like<br>
&gt;&gt; &gt;&gt; upsc and upsmon, but it&#39;s a possibility.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thoughts?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; while I clearly see the advantage of moving manpages to AsciiDoc (allow<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; generate html... output), I still don&#39;t much see the one of embedding it<br>
&gt;&gt; &gt; with the code.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; perhaps you, as the one who has practiced it, can shed my light.<br>
&gt;&gt; &gt; I&#39;d also like to hear from Arjen.<br>
&gt;&gt;<br>
&gt;&gt; Well, it was just a thought. My primary motivation with the<br>
&gt;&gt; tripplite_usb man page was to not have to write in NROFF directly, and<br>
&gt;&gt; the fact that POD has well-defined start and end markers was a happy<br>
&gt;&gt; coincidence. We would have to reinvent a little of that for the<br>
&gt;&gt; AsciiDoc stuff.<br>
&gt;<br>
&gt; as said above, part of the extraction process, we may want to consolidate<br>
&gt; info using some calls to the drivers to obtain authors, params, ...<br>
&gt;<br>
&gt; a perl or python scrip in tools can do the job.<br>
&gt; can you propose the foundation (how to include the text in the driver so<br>
&gt; that it can be extracted, consolidation with the existing data, ...) and<br>
&gt; possibly an example with skel?<br>
<br>
</div></div>I will think about it, but I should probably start converting some of<br>
the man pages first, so that I have a better idea of what can be<br>
consolidated. We will need the nroff source converted at some point,<br>
whether or not it ends up in separate files or embedded in the source<br>
code.<br></blockquote></div><br>yep, something can emerge during the conversion.<br>like including the protocols.txt content...<br><br>cheers,<br>Arnaud<br>-- <br>Linux / Unix Expert R&amp;D - Eaton - <a href="http://www.eaton.com/mgeops">http://www.eaton.com/mgeops</a><br>
Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br>Debian Developer - <a href="http://www.debian.org">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br>
<br>