You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
557 B
30 lines
557 B
![]()
5 years ago
|
|
||
|
sub indent {
|
||
|
my $tag = shift || " important";
|
||
|
$tag = " note" if $tag eq " info";
|
||
|
my $text = shift;
|
||
|
$text =~ s/^ *//;
|
||
|
# $text =~ s/\n(?!(\n|\.|-|$))/ /sg;
|
||
|
$text =~ s/^/ /mg;
|
||
|
return "\n..${tag}:: \n\n".$text;
|
||
|
}
|
||
|
|
||
|
my $var;
|
||
|
{
|
||
|
local $/;
|
||
|
$var = <STDIN>;
|
||
|
}
|
||
|
|
||
|
# Handle admonitions
|
||
|
$var =~ s/<note([^>]*)>(.*?)<\/note>/indent($1,$2)/ges;
|
||
|
|
||
|
# Make image urls absolute
|
||
|
#$var =~ s/image:: \//image:: /g;
|
||
|
|
||
|
# Handle new.png
|
||
|
$var =~ s/image:: \.\.\/new/image:: \/documentation\/new/g;
|
||
|
|
||
|
# Remove ::: syntax
|
||
|
$var =~ s/::://g;
|
||
|
print $var
|