[Ktechlab-devel] Context Help

David Saxton david at bluehaze.org
Wed Jan 25 23:04:52 UTC 2006


I committed some code to SVN a couple of hours ago, which parses the HTML 
code, looking for anchor tags, then looks at the url in the anchor tags and 
colors it in or adds an image after it, depending on the type of link:

* Links to non-existant help now use the colour red, aka wikipedia-style.
* External links now use that wikipedia icon
* Links to local files use the icon that the user has globally associated with 
that mimetype (e.g. a link to an example circuit will have the ktechlab 
circuit icon after it).

So there's no need to add <img src=external.png> after each link.

Also, I have thought about the problem of external links possibly going dead 
or getting moved after the help has been released in a ktechlab release, and 
I think there is a simple solution:

The help HTML contains the url pointing at the external location - but the 
context-help viewer changes the url to something like 
"http://ktechlab.org/redirect.php?external_url". The "redirect.php" page will 
normally just forward the user straight to the site, but if the link goes 
dead at some point, then the redirect.php page can use a url 
substitution-table to replace bad urls with good ones.

On Wednesday 25 January 2006 22:28, Thomas Winkel wrote:
> If you give me a svn account I can commit the first version soon.
Sure - email me with a username and password.

> How to handle new files like images? Will I have to add them to the
> KDevelop project in order to make them known for "make install"?

To add an image (in the src/contexthelp/ directory, for example), you would 
need to edit the "contexthelp_DATA" line in src/contexthelp/Makefile.am. So 
if you wanted to install an image called "opamp.png", you would add it to the 
end of the line, making it look something like:

contexthelp_DATA = help-en_US help-it help-de opamp.png

Then, you just need to run "make" and "make install" to install the new file.

David.




More information about the Ktechlab-devel mailing list