Reference

by Forum_account
Create custom DM reference pages that appear in Dream Maker's help.
ID:107682
 
This library lets you create custom DM reference pages that will appear in Dream Maker's help when you press F1. To create a page you define a type of datum using DM code, like this:

REF/my_new_page
name = "my_new_page"
title = "my new reference page"


The library defines the world.generate_reference() proc. Call this and reference pages will be generated for each /REF datum you defined.

Version 1.2
• The args var can now be a list or a string.
• Added the possible_values var, which is a list.
• Added support for the library var. The var should be a string of the format "/author/library", which correspond's to the library's hub entry. A link will be put on every entry whose library value is set, indicating it's part of a library and linking to a help page whose name matches the library string.

Version 1.1
• The library no longer starts with a fresh copy of info.html each time you generate reference pages. It still creates a backup so world.restore_reference() still works, but it writes changes to the same file.
• Added the world.parse_reference proc which opens info.html and finds all page names.
• When writing new reference pages, old pages of the same name are cut out of info.html before the new page is written.

Version 1
• Initial release.
I used this once. For some reason, my reference now has 2 copies of everything.
I'll look into this as soon as I can. Were there duplicates for all pages or just duplicates of the pages you defined?

Before modifying info.html it creates a backup of it. The library has a proc (world.restore_reference, I think) that replaces info.html with the backup of the original.