Can't link to Tcl options
Multi-language source code documentation tool
Brought to you by:
gregvalure
Tcl objects and widgets have options, named with hyphens, e.g., -background is the background color of a widget. I've defined a new topic type for this, defined as follows:
Topic Type: Option
Plural: Options
Index: Yes
Break Lists: Yes
Keywords:
option, options
delegate option, delegate options
This works just great: the options appear on the generated docs just as they should, they appear in the index (I added "-" as an index prefix to ignore for options). However, if I try to link to them it doesn't work. If, for example, I write a function that links to the option <-foreground>, it appears in the output with angle brackets. If this is in a class called MyClass, then I can write <myclass.-foreground>, and then I get a link--but the link text has "MyClass." in it, which is no good.</myclass.-foreground>
I should have said, I'm using NaturalDocs 1.4, downloaded from the main website on 6 November 2009, and I'm running on OS X (though I've no idea why that should matter).
You're triggering the filtering that prevents left arrows (<-) from being seen as the opening part of a link. To change this, edit [ND Dir]\Modules\NaturalDocs\Parser\Native.pm and search for this line:
( $textBlocks->[$index] ne '<' || $textBlocks->[$index+1] !~ /^[<=-]/ ) &&
Remove the dash from the end so it looks like this:
( $textBlocks->[$index] ne '<' || $textBlocks->[$index+1] !~ /^[<=]/ ) &&
Run Natural Docs with -r to apply the changes everywhere.
I'm leaving this bug open in case I want to incorporate the change into the project. I have to think about it more.
Thanks very much, Greg.