NEW functionality add section changeLog to Doc in MB

This commit is contained in:
Lamrani Abdel 2023-09-08 14:45:59 +02:00
parent 9ca23dee12
commit f2b72ec15a

View file

@ -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';