Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Ceniza on September 07, 2007, 08:29:47 am

Title: Support for man pages in the help plugin
Post by: Ceniza on September 07, 2007, 08:29:47 am
I just finished implementing support for man pages in the help plugin, and it seems to be working fine so far.

Configuration looks like this:

(http://ceniza666.googlepages.com/man01.png)

And man page like this:

(http://ceniza666.googlepages.com/man02.png)

You can also specify more than one path for man pages (e.g. man:/usr/share/man;/usr/local/share/man;/another/dir/with/man/pages) if you want/need to.

It searches for man pages recursively (be careful with this), and it handles plain text, gz and bz2.

I still need to test it on Windows, update the project files and commit the changes (BerliOS is down ATM). Right now, it's only configured to be compiled using autotools.

I hope you find it useful (when I be able to commit it).
Title: Re: Support for man pages in the help plugin
Post by: rjmyst3 on September 07, 2007, 02:13:48 pm
that is awesome.
good work!  :D
Title: Re: Support for man pages in the help plugin
Post by: raph on September 07, 2007, 03:17:31 pm
Wow, really glad to hear this. I'll definetly use this feature on my new laptop.
Title: Re: Support for man pages in the help plugin
Post by: mariocup on September 08, 2007, 02:17:40 pm
Hi Cenzia,

I did not know that the Help Plugin support different protocols like http (Google search)

Code
http://www.google.de/search?hl=de&q=$(keyword)&btnG=Google-Suche&meta=

Finding out that, I came to new ideas. I have different headers that are included in a my project. For these headers exist a html documentation. So it would be great to select e.g. mydef/asc0.h in the editor

Code
#include <mydef/asc0.h>

and jump to e.g. firefox

file:///<envar>/html/$(keyword)tml

But the help plugin does not know how to handle the file:/// protocol. Is there a easy way to support that feature. I would appreciate, because my controller has 2000 registers and so it is helpful to get quick the documentation to a header file.

Title: Re: Support for man pages in the help plugin
Post by: Ceniza on September 08, 2007, 02:23:25 pm
Just tell the plugin you're specifying a command, then prepend the browser's executable name. Something like this:

firefox file:///<envvar>/html/$(keyword).html

Add the whole path to the executable if you have to.
Title: Re: Support for man pages in the help plugin
Post by: mariocup on September 08, 2007, 02:34:59 pm
Hi Ceniza,

with the option "this line represents a full command ..." everything works fine. The small things make life easier. Thx.
Title: Re: Support for man pages in the help plugin
Post by: AmR EiSa on September 08, 2007, 03:13:31 pm
Hi,
thanks for that.
but how i can config it in windows ???

AmR EiSa
Title: Re: Support for man pages in the help plugin
Post by: Ceniza on September 08, 2007, 03:46:39 pm
The first step is to get some man pages and paste them into a folder somewhere. It seems this (http://www.win.tue.nl/~aeb/linux/man/) is the right place to get them.

Now add a new entry to the help plugin with something like this:

man:C:/manpages

P.S.: Section 3 of the man pages should be enough.
Title: Re: Support for man pages in the help plugin
Post by: mandrav on September 11, 2007, 01:49:04 pm
I have a couple of feature requests (or bug reports - depends on how you look at them) :).


Title: Re: Support for man pages in the help plugin
Post by: Ceniza on September 12, 2007, 01:44:23 am
Dear Don Corleone,

I write this message to inform you that your feature requests (a.k.a. "your commands") have been implemented. I also decided to implement "link handling" for those man pages that provide links to other man pages.

Everything is ready to be committed. Unfortunately, BerliOS is down at the moment. I will continue trying till BerliOS is up again.


Sincerely yours,

Ceniza
Your loyal servant

:P
Title: Re: Support for man pages in the help plugin
Post by: mandrav on September 12, 2007, 10:39:13 am
@Ceniza: thanks :).

@all: since we 're on the topic, I hope you know about rjmyst's excellent wiki article about integrating Yelp with C::B (http://wiki.codeblocks.org/index.php?title=Using_yelp_as_a_help_viewer). I find it very convenient :).
For those who don't know, yelp is the help viewer of gnome so the article applies to all gnome-based distros.

Another alternative would be to utilize beagle. Just use this command: beagle-search $(keyword).
Title: Re: Support for man pages in the help plugin
Post by: Ceniza on September 15, 2007, 05:03:28 pm
New features:

* Zoom in and zoom out: increases/decreases font size.
* List of matches: if more than one entry is found, show them all, so you can choose which one you want.

The nice thing about the latter is that you can use file wildcards (*, ?) and it'll show you a list with everything it found. For example, if you search *mutex* it'll give you a list (if you have the man pages) of all the mutex related stuff for pthreads, and, in my case, also two hits for SDL (SDL_mutexP and SDL_mutexV).

Have fun :)
Title: Re: Support for man pages in the help plugin
Post by: rjmyst3 on September 27, 2007, 04:13:21 am
So I just used this for the first time tonight, because I wanted to lookup memcmp. It was not found - so I realized I need to install the libc man pages.

Just in case someone else ran into that problem, the package you need for ubuntu (and all debian variants??) is: manpages-dev

After I installed that, it worked as expected - and it was very nice  :D
Good work!
Title: Re: Support for man pages in the help plugin
Post by: drev on October 15, 2007, 07:55:27 pm
I can't wait to test this !  :o