Using yelp as a help viewer

From CodeBlocks
Revision as of 00:28, 29 April 2007 by Rjmyst3 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I wanted to use Gnome's Yelp as my wxWidgets help viewer with Code::Blocks, so I installed the wxWidgets docs debian package and wrote a shell script to launch yelp to the page for the class under the cursor when I hit F1.

If you'd like to set this up for yourself, follow the steps below:

This applies to Ubuntu, and possibly others.

Install the wxWidgets Documentation and integrate into Yelp

Skip steps 1 and 2 if your distro includes the wxWidgets packages (like Ubuntu Feisty)

1. Add the following repository to /etc/apt/sources.list:

deb dapper main

2. Reload your repositories:

sudo apt-get update

3. Install the documentation package:

sudo apt-get install wx2.8-doc

The wxWidgets docs are now installed and integrated into Yelp.

Get the Yelp launching/searching script

Copy the following script into a file named

Note that you may need to change the helproot and prefix variables for your distro

# Launch yelp with a wxWidgets class to search for it

# before Feisty it was this
# prefix=wx2.8-manual_

# If there is no argument, lauch yelp at the wxWidgets alphabetical class reference
if [ ! -n "$1" ]
 yelp file://$helproot$defaultpath &

# Convert first argument to lowercase, this is the class name
classname=$(echo "$1" | tr 'A-Z' 'a-z')


if [ -n "$2" ]
	index=#${classname}$(echo "$2" | tr 'A-Z' 'a-z')

if [ -e "$helproot$classpath" ]
	yelp file://$helproot$classpath$index &
	yelp file://$helproot$defaultpath &


Make the script executable:

sudo chmod +rx

Setup the Help Plugin in Code::Blocks

  • In Code::Blocks, goto Settings->Environment->Help Files
  • Click "Add" and name your new help entry.
  • Choose "Yes" when prompted to browse for a help file.
  • Browse for the script that you just created.
  • Add " $(keyword)" to the end of path. Example full path: /home/rrmulder/ $(keyword)
  • Check the boxes for "This is the default help file (shortcut: F1) and "This line represents a full command to be executed"
  • Click "Ok"

Now when you hit F1 while the cursor is over a wxWidgets class, yelp will be launched and will show the documentation for that class.