Skip to content

Commit

Permalink
new page
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Feb 22, 2024
1 parent 5f8deaf commit b33e7c8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
42 changes: 42 additions & 0 deletions examples/markdown.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
use warnings;
use strict;
use feature 'say';

#use Text::Markdown qw(markdown);
use Text::MultiMarkdown qw(markdown);

my $text = <<ORIGINAL;
# Title
Some text
## Subtitle
* Unordered
* List
* Items
1. Ordered
1. List
1. Items
| name | number |
| ---- | ------ |
| Foo | 1234 |
| Bar | 4 |
<style>
table td + td {
text-align: right;
}
</style>
ORIGINAL


my $html = markdown($text);

say $html;
24 changes: 24 additions & 0 deletions sites/en/pages/convert-markdown-to-html.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
=title Convert Markdown to HTML
=timestamp 2024-02-22T10:30:01
=indexes PerlMaven
=status show
=tags markdown, html
=author szabgab
=archive 1
=description Convert Markdown including tables to HTML
=comments_disqus_enable 0
=show_related 1

=abstract start

I have lots of documents written in Markdown format and I was looking for a way to convert them to HTML.

=abstract end

First I tried the <a href="https://metacpan.org/pod/Text::Markdown">Text::Markdown</a> module, it seemed like the obvious pick. Onfortunately it did not handle
tables.

Then I found <a href="https://metacpan.org/pod/Text::MultiMarkdown">Text::MultiMarkdown</a> and that worked as I expected.

<include file="examples/markdown.pl">

0 comments on commit b33e7c8

Please sign in to comment.