Author Topic: Support for man pages in the help plugin  (Read 8608 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Support for man pages in the help plugin
« 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:


And man page like this:


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).

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: Support for man pages in the help plugin
« Reply #1 on: September 07, 2007, 02:13:48 pm »
that is awesome.
good work!  :D

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Support for man pages in the help plugin
« Reply #2 on: September 07, 2007, 03:17:31 pm »
Wow, really glad to hear this. I'll definetly use this feature on my new laptop.

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Support for man pages in the help plugin
« Reply #3 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: [Select]
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: [Select]
#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.


Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Support for man pages in the help plugin
« Reply #4 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.

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Support for man pages in the help plugin
« Reply #5 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.

Offline AmR EiSa

  • Multiple posting newcomer
  • *
  • Posts: 75
Re: Support for man pages in the help plugin
« Reply #6 on: September 08, 2007, 03:13:31 pm »
Hi,
thanks for that.
but how i can config it in windows ???

AmR EiSa

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Support for man pages in the help plugin
« Reply #7 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 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Support for man pages in the help plugin
« Reply #8 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) :).

  • If a man search doesn't find the keyword, clear the old contents of MANform (or even better, replace them with a message like "No results").
  • I 'd suggest converting MANform to wxPanel and registering it as a dockable window.

Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Support for man pages in the help plugin
« Reply #9 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Support for man pages in the help plugin
« Reply #10 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. 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).
« Last Edit: September 12, 2007, 10:44:42 am by mandrav »
Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Support for man pages in the help plugin
« Reply #11 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 :)

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: Support for man pages in the help plugin
« Reply #12 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!

Offline drev

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Support for man pages in the help plugin
« Reply #13 on: October 15, 2007, 07:55:27 pm »
I can't wait to test this !  :o