OpenXcom Forum

Contributions => Programming => Topic started by: kkmic on February 12, 2012, 11:18:38 pm

Title: Man Page
Post by: kkmic on February 12, 2012, 11:18:38 pm
I've slapped together a first draft for a Linux man page: https://bitbucket.org/killermosi/openxcom-man-page/

It is basically a copy/paste from the readme.

Until it will be added to the main trunk, please post your comments/additions/patches here.
Title: Re: Man Page
Post by: SupSuper on February 13, 2012, 08:19:27 pm
What exactly is a man page? ???
Title: Re: Man Page
Post by: kkmic on February 13, 2012, 10:09:19 pm
Now that's a question that left me a bit surprised.

https://en.wikipedia.org/wiki/Man_page (https://en.wikipedia.org/wiki/Man_page)

Basically, a man page is a quick/detailed help for a specific command/application. Not all applications have a man page, though most of them do. It is used in Unix and Unix-like operating systems.

You can try man command in any terminal.

man cp
man mv

and in the future, man openxcom :D
Title: Re: Man Page
Post by: winterheart on February 16, 2012, 12:52:08 pm
Pure groff-format is hard to understand and maintain. What about Docbook XML? It can be easly converted with "xmlto" package to various formats including HTML and man.
Title: Re: Man Page
Post by: kkmic on February 16, 2012, 01:47:21 pm
Pure groff-format is hard to understand and maintain.
Yeah, I've noticed that when I have attempted to edit a man page. I have actually started with another page and modified it until it reached the current form

I'll take a look at Docbook XML, as the name went by when I searched for tips and tricks for man pages. Any pointers? (I mean links :P)

If you're interested, I can give you access to the repo.
Title: Re: Man Page
Post by: winterheart on February 17, 2012, 09:34:19 am
Here example of openxcom xml docbook. You'll need xmlto and docbook-xml-dtd 4.5 packages.
To compile it to man-page, you just run
xmlto man openxcom.6.xml
Title: Re: Man Page
Post by: kkmic on February 17, 2012, 10:48:20 am
Looks good and it's way more human-readable than groff.

Question is: in what format should the openxcom man page be included in the source? I'd personally vote for the groff format, as having it in Docbook format may add another package to the requirements list. Also, converting the man page from Docbook to groff is a 5 second job... an I don't see the man page changing too often
Title: Re: Man Page
Post by: winterheart on February 17, 2012, 01:36:34 pm
In git should exist groff and xml. But, of course end user need only groff file. Just keep it up-to-date after each change made in xml-file.
Title: Re: Man Page
Post by: kkmic on February 17, 2012, 04:12:00 pm
Yeah, my thoughts exactly.

Though I'm not afraid of getting my hands dirty with pure XML code, are you aware of any free Docbook editors?
Title: Re: Man Page
Post by: winterheart on February 17, 2012, 04:17:00 pm
You can try XMLmind XML Editor (https://www.xmlmind.com/xmleditor/download.shtml). It can runs in Java enviroment, Docbook aware and Personal Edition is free.
Title: Re: Man Page
Post by: gchevallereau on February 17, 2012, 09:44:20 pm
Quote
In git should exist groff and xml. But, of course end user need only groff file. Just keep it up-to-date after each change made in xml-file.
I disagree. There should be only the XML file:
Title: Re: Man Page
Post by: kkmic on February 18, 2012, 09:51:54 am
What I am looking for is to avoid one more required dependency for OpenCom.

How common are the two packages mentioned by winterheart?

My distro, for example, lacks xmlto by default.

Correction, xmlto is present in my distro by default
Title: Re: Man Page
Post by: gchevallereau on February 18, 2012, 12:41:15 pm
as i have said, it's not hard to make the build of the man page optional, so xmlto wouldn't be a required dependency.
IMHO, we should treat it like doxygen. You can perfectly build openxcom without doxygen installed, because we check for it's presence and only add needed rules to generate documentation if it was found. man page should be handled the same way.