#109 Can't link to Tcl options

open
nobody
None
5
2012-09-14
2009-11-07
Anonymous
No

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.

Discussion

  • Will Duquette
    Will Duquette
    2009-11-07

    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).

     
  • Greg Valure
    Greg Valure
    2009-11-07

    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.

     
  • Greg Valure
    Greg Valure
    2009-11-07

    I'm leaving this bug open in case I want to incorporate the change into the project. I have to think about it more.

     
  • Will Duquette
    Will Duquette
    2009-11-07

    Thanks very much, Greg.