Adding documentation to plugins

6th Feb 2006 Danny
There's a cool new event that blueyed told me about. No docs for it yet, but I propose that we use it and use it in some sort of consistent way. You can add documentation right into the plugin code, and put links to that help page, where ever you want. Here's what I did with my poll plugin. First, put in the actual help page, like this:
 function DisplayHelp ( & $params )
        {
        ?>
Docs go here.  
<?php 
}
The user can find that by going to Settings > Plugins > Democracy Poll > Help, but I wanted to add a link in the Tools > Democracy Poll page. So I added this right at the top of my AdminTabPayload event:
                echo '<div style="float:right">';
                echo $this->get_help_link('#');
                echo '</div>';
That puts the help icon in the top right of the page. If you put anchors in the help page, you can make contextual help links that go straight to that section, like this:
                echo $this->get_help_link('#installation'); 
The get_help_link method can also point to the external help url:
                echo $this->get_help_link( '#', '', true); 
Maybe you already knew about this, but perhaps we can discuss the best way to use it. Also, I needed an excuse to use the amcode for the first time. B)
 
 
 
 

Comments

Anonymous
7th Feb 2006
The amcode rocks huh? ;)

This sounds like a cool event, and I agree that we should make full use of it in a consistent manner...... we just need to decide what consistent is :p

¥
 
Anonymous
13th Feb 2006
Danny,

My plans were to put a link directly to the AM-appropriate, multi-paged, plugin "how-to" on AM! (I was doing this directly in the plugin. See the ? for the search-highlight plugin.

My thinking was then that way, there would only be really ONE source for documentation (the AM site, for AM plugins) ... which could take full use of all of the tools available (am code, pz photo zoom, etc) to cover the documentation.

Besides being easier to maintain ONE copy, it'll also drive folks (needing help) to our site. :)

I'll have to come round and have a look ... maybe there's a way to have links for each page? (Intro - Link; Install - Link; CSS-Help - Link, etc.)

If the event helps, or makes it easier for ppl to FIND the help links, on the AM! site, that would be great!

-stk
 
 

Recent Comments

     
     

    Archives