Generating the module help page automatically

Generating the module help page automatically

by Mad Alex -
Number of replies: 4
At present the help page which describes what each module does is a static html page.
It would be nice to have each module define the text and assemble the page automatically.

If people like this idea I am happy to work on it. The file needs to be changed to a .php file which should build a table with a row for each module. The icon it can already get automatically. The other column should contain formatted text which it could grab from a "help.html" or similar file in each module directory.
Average of ratings: -
In reply to Mad Alex

Re: Generating the module help page automatically

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Good idea, except to make it work for all languages it should probably be an "overview.html" file in each module help directory: lang/xx/help/modulename/overview.html

If the language isn't found in the current language, check "parentlanguage" and then English (en).

No need for a new database table, just read the existing modules table.
In reply to Martin Dougiamas

Re: Generating the module help page automatically

by Mad Alex -
I was talking about html tables and not database tables but didn't make myself clear, sorry.

I agree that it should use the language system.

I will work on this during this coming week.
In reply to Mad Alex

Re: Generating the module help page automatically

by Mad Alex -
Having looked more closely I see that the help index page contains links for each module which should be generated automatically too.

I have attached a modified version of help.php. For certain files (index.html and mods.html) it looks in the module directories under lang/$lang/help/$module for files of the same name (it tries the current language, parent language and "en" for $lang each time and does this for every $module, sorted by the full name of the module).
The advantage of this method is that it still works with the old style files. There is of course no reason why the main files and the per-module files should have the same name and this could easily be changed.

The attached file also contains the split up versions of index.html and mods.html for english (en). Of course these files will need to be split for all languages eventually.
In reply to Mad Alex

Re: Generating the module help page automatically

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Very nice fix and very Moodley - I like it!
I've checked help.php into CVS unchanged.

Quite a few of the mods.html and index.html were missing from the archive but no matter, I pieced them together.

Thanks, Alex!