Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » allegro 5 chm file request

This thread is locked; no one can reply to it. rss feed Print
allegro 5 chm file request
smashkeybrdmkusr
Member #14,075
February 2012

Is it possible for some one to generate a .chm easily out of the allegro 5 docs? (Or is there one somewhere I couldn't find?) I did a little googling to try and generate it myself but it was too much for me. I really enjoyed the one for allegro 4 because of the search functionality.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Peter Wang
Member #23
April 2000

Here's a fun job for someone who likes this sort of thing.

We know what the .hhc, .hhk and .hhp files should look like. Just follow the output generated by the A4 makedoc program. The .hhp is basically a list of file names. The .hhc and .hhk files need to list all the headings of each page and link to them.

To get the headings you can either go from the A5 source documents (in markdown syntax) or from the generated HTML files. If you go from markdown you will need to reproduce Pandoc's algorithm to generate section ids, e.g. "Opening a window" goes to "#opening-a-window". Mostly trivial but if the algorithm changes we would need to update the code.

Alternatively, you can parse the generated HTML files to get the headings and ids directly. Perl/Python/etc. should have standard modules for that. Pandoc can parse HTML, too, and spit out JSON. You could even just use grep, but I suggest using a robust method to reduce our maintenance burden.

The second method should result in a standalone script which would be useful outside of Allegro as well.

Go to: