Added a new make target that generates .txt files from Markdown release notes.
This commit is contained in:
29
format.pl
Normal file
29
format.pl
Normal 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 "$_";
|
||||
}
|
||||
}
|
||||
|
12
generate-txt-release.cmake
Normal file
12
generate-txt-release.cmake
Normal 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()
|
Reference in New Issue
Block a user