Added a new make target that generates .txt files from Markdown release notes.

This commit is contained in:
Markus Makela
2015-03-20 21:49:14 +02:00
parent 41a9a75dfe
commit 5d43141d94
2 changed files with 41 additions and 0 deletions

29
format.pl Normal file
View File

@ -0,0 +1,29 @@
open(my $in,"<",@ARGV[0]);
open(my $out,">",@ARGV[1]);
my $tbl = 0;
while(<$in>){
if(/<table>/)
{
$tbl = 1;
}
elsif(/<\/table>/)
{
$tbl = 0;
}
else
{
if($tbl == 1)
{
s/\n//;
s/<\/tr>/\n/;
s/<td>//;
s/<tr>//;
s/<\/td>/\t/;
s/^ +//;
s/ +$//;
}
s/[*]/\t/;
print $out "$_";
}
}

View File

@ -0,0 +1,12 @@
# The BUILD_DIR variable is set at runtime
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
file(MAKE_DIRECTORY ${BUILD_DIR}/txt)
file(GLOB_RECURSE MARKDOWN Release-Notes/*.md)
foreach(VAR ${MARKDOWN})
get_filename_component(NEWNAME ${VAR} NAME)
execute_process(COMMAND perl ${CMAKE_CURRENT_BINARY_DIR}/format.pl ${VAR} ${BUILD_DIR}/txt/${NEWNAME}.txt)
endforeach()