Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3761e0e
Use __FILE__ rather than $0 to find self
Oblomov Dec 17, 2010
c391fca
follow symlinks to find the support module
Oblomov Dec 17, 2010
83f3ddd
Start lib-ification of MultiMarkdown
Oblomov Dec 17, 2010
f54bc59
Rework mmd2* scripts to use the new layout
Oblomov Dec 17, 2010
8bb14a5
More modularization progress
Oblomov Jan 1, 2011
9a4f433
Use File::Spec for path joins
Oblomov Jan 2, 2011
583bf95
Improve binary vs module split
Oblomov Jan 2, 2011
890e89c
Collect settings into a hash
Oblomov Jan 2, 2011
0bec43c
Prepare _HashHTMLBlocks extractor
Oblomov Jan 8, 2011
d758734
Early bailout from _DoDefinitionLists
Oblomov Jan 8, 2011
be84578
Small _HashHTMLBlocks optimization
Oblomov Jan 8, 2011
9573fa2
Read links when finding who we are
Oblomov Jan 8, 2011
7f8cade
Process block quotes earlier
Oblomov Jan 8, 2011
662fe2f
Move some lines around, getting closer to the typical Perl module
Oblomov Jan 8, 2011
3a5d919
Object-oriented interface
Oblomov Jan 8, 2011
8795bc1
Whitespace-cleaup the main module
Oblomov Jan 8, 2011
a786b28
Merge Text::MultiMarkdown
Oblomov Jan 9, 2011
909ef19
Text::MultiMarkdown alias to MultiMarkdown
Oblomov Jan 9, 2011
08f1b0a
Handle 'Keywords' in metadata correctly
Oblomov Jan 9, 2011
03edab7
Emulate Markdown when called as Markdown.pl
Oblomov Jan 9, 2011
1e20257
New codeblocks_newline option
Oblomov Jan 9, 2011
e621a95
Revert 7f8cadeacfd9e7ba335e86aeebc8738693ce393a
Oblomov Jan 9, 2011
aa19530
More Markdown.pl emulation
Oblomov Jan 9, 2011
bcfadcb
Command-line option to emulate Markdown
Oblomov Jan 9, 2011
eda6547
Add leading spaces to _all_ lines in a blockquote
Oblomov Jan 9, 2011
c2f071d
Don't strip final whitespace in list items
Oblomov Jan 9, 2011
54b32b4
Outer lists have proper should end block-style
Oblomov Jan 9, 2011
efa8692
Blockquotes-in-list and running blockquotes fixes
Oblomov Jan 9, 2011
a09ade1
Support running lists
Oblomov Jan 10, 2011
99fdcb6
Merge remote-tracking branch 'upstream/master'
Oblomov Jan 28, 2011
1739db3
More readlink fixes
Oblomov Mar 7, 2011
a49f18a
Add HTML5 block-level tags
Oblomov May 6, 2012
8212a1a
Handle multiple reference to the same footnote/glossary
Oblomov May 6, 2012
e23970e
Glaring horror error from previous commit
Oblomov May 13, 2012
8939649
Output footnotes ordered by their counter
Oblomov Aug 17, 2012
33418f4
Allow footnotes in footnotes
Oblomov May 5, 2013
521faa1
Support math between $..$
Oblomov Oct 13, 2014
a2bc6d2
ASCIIMathML: some UTF-8 support
Oblomov Oct 13, 2014
b892c60
Support UTF-8 in ASCIIMathML
Oblomov Oct 13, 2014
497e33e
All scripts: fall back to __FILE__ if not link
Oblomov Oct 13, 2014
38df87e
More UTF-8 for ASCIIMathML
Oblomov Oct 13, 2014
094052f
Some currency symbols
Oblomov Jul 27, 2019
a7e1159
Treat floor/ceil as parenthesis
Oblomov Aug 30, 2019
f51648f
ASCIIMathML: more trig
Oblomov Sep 21, 2019
38dfb5f
Better HTML5 support + my stuff
Oblomov Aug 12, 2023
0615443
details & summary are block-level tags
Oblomov Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,448 changes: 41 additions & 2,407 deletions bin/MultiMarkdown.pl

Large diffs are not rendered by default.

86 changes: 25 additions & 61 deletions bin/mmd2LaTeX.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
use warnings;

use File::Basename;
use File::Spec;
use Cwd;
use Cwd 'abs_path';

# Determine where MMD is installed. Use a "common installation" if available.

my $me = $0; # Where is this script located?
my $me = readlink(__FILE__) || __FILE__; # Where is this script located?
my $MMDPath = LocateMMD($me);


# Determine whether we are in "file mode" or "stdin mode"

my $count = @ARGV;
Expand Down Expand Up @@ -83,83 +83,47 @@ sub LocateMMD {

$me = dirname($me);

if ($os =~ /MSWin/) {
# We're running Windows

# First check our directory to see if we're running inside MMD

if ( -f "$me\\MultiMarkdown\\Support.pm") {
$MMDPath = "$me\\..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
} elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";
}
}
my @candidates = ();

# Load the MultiMarkdown::Support.pm module
do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne "");
if ( -f File::Spec->join($me, 'MultiMarkdown.pl') ) {
$MMDPath = dirname($me);
} else {
# We're running Mac OS X or some *nix

# First check our directory to see if we're running inside MMD

if ( -f "$me/MultiMarkdown/Support.pm") {
$MMDPath = "$me/..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ($os =~ /MSWin/) {
# We're running Windows
push @candidates, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
push @candidates, "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";

} else {
# We're running Mac OS X or some *nix
if (defined($ENV{HOME})) {
if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") {
$MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown";
} elsif ( -d "$ENV{HOME}/.multimarkdown") {
$MMDPath = "$ENV{HOME}/.multimarkdown";
}
}
if ($MMDPath eq "") {
if ( -d "/Library/Application Support/MultiMarkdown") {
$MMDPath = "/Library/Application Support/MultiMarkdown";
} elsif ( -d "/usr/share/multimarkdown") {
$MMDPath = "/usr/share/multimarkdown";
}
push @candidates, "$ENV{HOME}/Library/Application Support/MultiMarkdown";
push @candidates, "$ENV{HOME}/.multimarkdown";
push @candidates, "/Library/Application Support/MultiMarkdown";
push @candidates, "/usr/share/multimarkdown";
}
}
}

foreach (@candidates) {
if (-d $_) {
$MMDPath = $_;
last;
}
}

if ($MMDPath eq "") {
die "You do not appear to have MultiMarkdown installed.\n";
} else {
# Load the MultiMarkdown::Support.pm module
$MMDPath = abs_path($MMDPath);
LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm");
unshift (@INC, File::Spec->join($MMDPath, 'lib'));
require MultiMarkdown::Support;
}

# Clean up the path
$MMDPath = abs_path($MMDPath);

return $MMDPath;
}

sub LoadModule {
my $file = shift;
my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin

if ($os =~ /MSWin/) {
# Not sure what I can do here
} else {
unless (my $return = eval `cat "$file"`) {
warn "couldn't parse $file: $@" if $@;
warn "couldn't do $file: $!" unless defined $return;
warn "couldn't run $file" unless $return;
}
}
}

=head1 NAME

mmd2LaTeX.pl - utility script for MultiMarkdown to convert MultiMarkdown text
Expand Down
89 changes: 26 additions & 63 deletions bin/mmd2PDF.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
use warnings;

use File::Basename;
use File::Spec;
use Cwd;
use Cwd 'abs_path';

# Determine where MMD is installed. Use a "common installation" if available.

my $me = $0; # Where is this script located?
my $me = readlink(__FILE__) || __FILE__; # Where is this script located?
my $MMDPath = LocateMMD($me);


# Determine whether we are in "file mode" or "stdin mode"

my $count = @ARGV;
Expand Down Expand Up @@ -79,84 +79,47 @@ sub LocateMMD {

$me = dirname($me);

if ($os =~ /MSWin/) {
# We're running Windows

# First check our directory to see if we're running inside MMD

if ( -f "$me\\MultiMarkdown\\Support.pm") {
$MMDPath = "$me\\..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
} elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";
}
}
my @candidates = ();

# Load the MultiMarkdown::Support.pm module
do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne "");
if ( -f File::Spec->join($me, 'MultiMarkdown.pl') ) {
$MMDPath = dirname($me);
} else {
# We're running Mac OS X or some *nix

# First check our directory to see if we're running inside MMD

if ( -f "$me/MultiMarkdown/Support.pm") {
$MMDPath = "$me/..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ($os =~ /MSWin/) {
# We're running Windows
push @candidates, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
push @candidates, "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";

} else {
# We're running Mac OS X or some *nix
if (defined($ENV{HOME})) {
if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") {
$MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown";
} elsif ( -d "$ENV{HOME}/.multimarkdown") {
$MMDPath = "$ENV{HOME}/.multimarkdown";
}
}
if ($MMDPath eq "") {
if ( -d "/Library/Application Support/MultiMarkdown") {
$MMDPath = "/Library/Application Support/MultiMarkdown";
} elsif ( -d "/usr/share/multimarkdown") {
$MMDPath = "/usr/share/multimarkdown";
}
push @candidates, "$ENV{HOME}/Library/Application Support/MultiMarkdown";
push @candidates, "$ENV{HOME}/.multimarkdown";
push @candidates, "/Library/Application Support/MultiMarkdown";
push @candidates, "/usr/share/multimarkdown";
}
}
}

foreach (@candidates) {
if (-d $_) {
$MMDPath = $_;
last;
}
}

if ($MMDPath eq "") {
die "You do not appear to have MultiMarkdown installed.\n";
} else {
# Load the MultiMarkdown::Support.pm module
$MMDPath = abs_path($MMDPath);
LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm");
unshift (@INC, File::Spec->join($MMDPath, 'lib'));
require MultiMarkdown::Support;
}

# Clean up the path
$MMDPath = abs_path($MMDPath);

return $MMDPath;
}

sub LoadModule {
my $file = shift;
my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin

if ($os =~ /MSWin/) {
# Not sure what I can do here
} else {
unless (my $return = eval `cat "$file"`) {
warn "couldn't parse $file: $@" if $@;
warn "couldn't do $file: $!" unless defined $return;
warn "couldn't run $file" unless $return;
}
}
}


=head1 NAME

mmd2PDF - utility script for MultiMarkdown to convert MultiMarkdown text
Expand Down Expand Up @@ -211,4 +174,4 @@ =head1 COPYRIGHT AND LICENSE
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA

=cut
=cut
88 changes: 26 additions & 62 deletions bin/mmd2PDFXeLaTeX.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
use warnings;

use File::Basename;
use File::Spec;
use Cwd;
use Cwd 'abs_path';

# Determine where MMD is installed. Use a "common installation" if available.

my $me = $0; # Where is this script located?
my $me = readlink(__FILE__) || __FILE__; # Where is this script located?
my $MMDPath = LocateMMD($me);


# Determine whether we are in "file mode" or "stdin mode"

my $count = @ARGV;
Expand Down Expand Up @@ -79,83 +79,47 @@ sub LocateMMD {

$me = dirname($me);

if ($os =~ /MSWin/) {
# We're running Windows

# First check our directory to see if we're running inside MMD

if ( -f "$me\\MultiMarkdown\\Support.pm") {
$MMDPath = "$me\\..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
} elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") {
$MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";
}
}
my @candidates = ();

# Load the MultiMarkdown::Support.pm module
do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne "");
if ( -f File::Spec->join($me, 'MultiMarkdown.pl') ) {
$MMDPath = dirname($me);
} else {
# We're running Mac OS X or some *nix

# First check our directory to see if we're running inside MMD

if ( -f "$me/MultiMarkdown/Support.pm") {
$MMDPath = "$me/..";
}

# Next, look in user's home directory, then in common directories
if ($MMDPath eq "") {
if ($os =~ /MSWin/) {
# We're running Windows
push @candidates, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown";
push @candidates, "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown";

} else {
# We're running Mac OS X or some *nix
if (defined($ENV{HOME})) {
if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") {
$MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown";
} elsif ( -d "$ENV{HOME}/.multimarkdown") {
$MMDPath = "$ENV{HOME}/.multimarkdown";
}
}
if ($MMDPath eq "") {
if ( -d "/Library/Application Support/MultiMarkdown") {
$MMDPath = "/Library/Application Support/MultiMarkdown";
} elsif ( -d "/usr/share/multimarkdown") {
$MMDPath = "/usr/share/multimarkdown";
}
push @candidates, "$ENV{HOME}/Library/Application Support/MultiMarkdown";
push @candidates, "$ENV{HOME}/.multimarkdown";
push @candidates, "/Library/Application Support/MultiMarkdown";
push @candidates, "/usr/share/multimarkdown";
}
}
}

foreach (@candidates) {
if (-d $_) {
$MMDPath = $_;
last;
}
}

if ($MMDPath eq "") {
die "You do not appear to have MultiMarkdown installed.\n";
} else {
# Load the MultiMarkdown::Support.pm module
$MMDPath = abs_path($MMDPath);
LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm");
unshift (@INC, File::Spec->join($MMDPath, 'lib'));
require MultiMarkdown::Support;
}

# Clean up the path
$MMDPath = abs_path($MMDPath);

return $MMDPath;
}

sub LoadModule {
my $file = shift;
my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin

if ($os =~ /MSWin/) {
# Not sure what I can do here
} else {
unless (my $return = eval `cat "$file"`) {
warn "couldn't parse $file: $@" if $@;
warn "couldn't do $file: $!" unless defined $return;
warn "couldn't run $file" unless $return;
}
}
}

=head1 NAME

mmd2PDFXeLaTeX - utility script for MultiMarkdown to convert MultiMarkdown
Expand Down Expand Up @@ -210,4 +174,4 @@ =head1 COPYRIGHT AND LICENSE
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA

=cut
=cut
Loading