File: md1.pl

package info (click to toggle)
libtext-layout-perl 0.045-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 548 kB
  • sloc: perl: 4,117; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

use strict;
use warnings;
use utf8;

use lib "../lib";
use Text::Layout::Markdown;

# Create a layout instance.
my $layout = Text::Layout::Markdown->new;

binmode( STDOUT, ':utf8' );

# Text to render.
$layout->set_markup( q{Áhe <i><span foreground="red">quick</span> <span size="20"><b>brown</b></span></i> fox} );

# Render it.
print $layout->show(), "\n";

# Text to render.
$layout->set_markup( q{Áhe quick brown fox} );

# Right align text (will be ignored w/ Markdown).
$layout->set_width(50);
$layout->set_alignment("center");

# Render it.
print $layout->show(), "\n";