[pmwiki-users] Auotmatic link to markup documentation?

chr at home.se chr at home.se
Sun Sep 25 02:49:15 CDT 2005


Hi

I just had a thought inspired from Emacs, namely the "self-documenting" 
aspect. What if we could have a directive that lists all the markup?
Say something like this:

	(:list-markup:)

which would generate a list of all the markup that has been defined, 
including where to find more information about each type of markup.

We would have to extend the function Markup() so that it can accept 
additional arguments that lets you specify either a small help blurb, 
and/or a link to a wiki page that documents the markup.


Here's *one* possible way to modify it:

 Markup($name, $when, $pattern, $replace, $docName, $docText, $docLink);

where the latter three arguments would respectively specify a "name" for
the markup, a teaser text and a link to further documentation. The idea
would be that the list of markup could be generated as follows:

	:[[$docName -> $docLink]]: $docText. \\
	See $docLink for more information.

Here's an example:

 Markup("em", "inline", "/''(.*?)''/", "<em>$1</em>",
	"Emphasize",
	"Emphasize text using ', e.g. [='''=]'''emphasized'''[='''=].", 
	"[[PmWiki.MarkupMasterIndex#emphasized]]");

where the call to Markup() now contains an additional blurb as well as a 
reference to PmWiki.MarkupMasterIndex.

Internationalizing this documentation might be a bit tricky though...

Thoughts and comments?

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr






More information about the pmwiki-users mailing list