diff --git a/conf/default.php b/conf/default.php index c619005..ddcaf9d 100644 --- a/conf/default.php +++ b/conf/default.php @@ -27,4 +27,5 @@ $conf['depth'] = 1; // maximum depth of namespace includes, 0 for unlimited depth $conf['readmore'] = 1; // Show readmore link in case of firstsection only $conf['debugoutput'] = 0; // print debug information to debuglog if global allowdebug is enabled +$conf['rawsections'] = 0; // use section/heading levels as given in the included files //Setup VIM: ex: et ts=2 : diff --git a/conf/metadata.php b/conf/metadata.php index a0fa7b1..489f60b 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -30,4 +30,5 @@ $meta['depth'] = array('numeric', '_min' => 0); $meta['readmore'] = array('onoff'); $meta['debugoutput'] = array('onoff'); +$meta['rawsections'] = array('onoff'); //Setup VIM: ex: et ts=2 : diff --git a/helper.php b/helper.php index ebde44f..1c52da4 100644 --- a/helper.php +++ b/helper.php @@ -392,6 +392,11 @@ function _convert_instructions(&$ins, $lvl, $page, $sect, $flags, $root_id, $inc $diff = $lvl - $lvl_max + 1; if ($no_header) $diff -= 1; // push up one level if "noheader" + // rawsections=TRUE places a wiki section at the level that was defined within the wiki page - no relative reposition is done. + if ($this->getConf('rawsections')) { + $diff = 0; + } + // convert headers and set footer/permalink $hdr_deleted = false; $has_permalink = false; diff --git a/lang/de-informal/settings.php b/lang/de-informal/settings.php index 5076b1b..8bfb2d0 100644 --- a/lang/de-informal/settings.php +++ b/lang/de-informal/settings.php @@ -37,3 +37,4 @@ $lang['depth'] = 'Maximale Tiefe von Namensräumen, 0 für alle Ebenen'; $lang['readmore'] = '\'Weiterlesen\'-Link bei aktiviertem "firstseconly"-Modus anzeigen'; $lang['debugoutput'] = 'Ausführliche Informationen in das Debuglog des Dokuwikis schreiben (setzt voraus, dass die globale Option "allowdebug" aktiviert ist).'; +$lang['rawsections'] = 'Die Level der Abschnitte werden wie in den eingebundenen Seiten vorgegeben verwendet'; diff --git a/lang/de/settings.php b/lang/de/settings.php index 9ed7a79..d2c0cf6 100644 --- a/lang/de/settings.php +++ b/lang/de/settings.php @@ -40,3 +40,4 @@ $lang['depth'] = 'Maximale Tiefe von Namensräumen, 0 für alle Ebenen'; $lang['readmore'] = 'Zeige einen \'Weiterlesen\'-Link bei aktiviertem "firstseconly"-Modus'; $lang['debugoutput'] = 'Ausführliche Informationen in das Debuglog des Dokuwikis schreiben (setzt voraus, dass die globale Option "allowdebug" aktiviert ist).'; +$lang['rawsections'] = 'Die Level der Abschnitte werden wie in den eingebundenen Seiten vorgegeben verwendet'; diff --git a/lang/en/settings.php b/lang/en/settings.php index 8aec307..59aae7f 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -38,4 +38,5 @@ $lang['depth'] = 'Maximum depth of namespace includes, 0 for unlimited depth'; $lang['readmore'] = 'Show or not the \'Read More\' link in case of firstsection only'; $lang['debugoutput'] = 'Print verbose debug information to the dokuwiki debuglog if the global "allowdebug" option is enabled'; +$lang['rawsections'] = 'Use section/heading levels as given in the included files'; //Setup VIM: ex: et ts=2 : diff --git a/syntax/locallink.php b/syntax/locallink.php index 2a6a612..895559c 100644 --- a/syntax/locallink.php +++ b/syntax/locallink.php @@ -39,6 +39,15 @@ function render($mode, Doku_Renderer $renderer, $data) { $renderer->doc .= ''; return true; } + if ($mode == 'odt') { + list($hash, $name, $id) = $data; + // construct title in the same way it would be done for internal links + $default = $renderer->_simpleTitle($id); + $name = $renderer->_getLinkTitle($name, $default, $isImage, $id); + $title = $ID; + $renderer->internallink($id,$name); + return true; + } return false; } }