diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 668991818b5..a3d20c1179d 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -818,6 +818,27 @@ if ($dirins && $action == 'initdoc' && !empty($module)) { writeApiUrlsInDoc($apiFile, $destfile); } + // add ChangeLog in Doc + if (file_exists($dirins.'/'.strtolower($module).'/ChangeLog.md')) { + $changeLog = $dirins.'/'.strtolower($module).'/ChangeLog.md'; + $string = file_get_contents($changeLog); + + $replace = explode("\n", $string); + $strreplace = array(); + foreach ($replace as $line) { + if ($line === '') { + continue; + } + if (strpos($line, '##') !== false) { + $strreplace[$line] = str_replace('##', '', $line); + } else { + $strreplace[$line] = $line; + } + } + $stringLog = implode("\n", $strreplace); + dolREplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog)); + } + // Delete old documentation files $FILENAMEDOC = $modulelowercase.'.html'; $FILENAMEDOCPDF = $modulelowercase.'.pdf';