Changeset 2622 for trunk/manual/new/lib

Show
Ignore:
Timestamp:
09/23/07 22:38:11 (16 months ago)
Author:
jepso
Message:

Fixed interdocumentation linking feature

Location:
trunk/manual/new/lib/Text/Wiki
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/manual/new/lib/Text/Wiki/Parse/Doc/Doclink.php

    r2308 r2622  
    3333            if (isset($matches[2])) {  
    3434                $options['text'] = $matches[2]; 
     35                $options['text'] = str_replace(':index', $section->getIndex(), $options['text']); 
     36                $options['text'] = str_replace(':name', $section->getName(), $options['text']); 
     37                $options['text'] = str_replace(':fullname', $section->getName(true), $options['text']); 
    3538            } else { 
    36                 $options['text'] = $section->getIndex() . ' ' . $section->getName(true); 
     39                $options['text'] = $section->getIndex(); 
    3740            } 
    3841             
  • trunk/manual/new/lib/Text/Wiki/Render/Latex/Heading.php

    r2308 r2622  
    55    function token($options) 
    66    { 
     7        static $label = array(); 
     8 
    79        // get nice variable names (type, level) 
    810        extract($options); 
    911 
    1012        if ($type == 'start') { 
    11             switch ($level) 
    12                 { 
     13 
     14            while (count($label) >= $level) { 
     15                array_pop($label); 
     16            } 
     17            $label[] = Sensei_Doc_Section::convertNameToPath($text); 
     18 
     19            switch ($level) { 
    1320                case '1': 
    1421                    return '\chapter{'; 
     
    2330                case '6': 
    2431                    return '\subparagraph{'; 
    25                 } 
     32            } 
    2633        } 
    2734         
     35         
    2836        if ($type == 'end') { 
    29             return "}\n"; 
     37            return "}\n\label{" . implode(':', $label) . "}\n"; 
    3038        } 
    3139    }