X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/12fd902fb1228feb4e23a1f850f215122a4c7e3f..2fc21bff0adc27d9374aa6b5f5011ca422df47d8:/doc/forum/How_to_allow_.markdown_and_.md_at_the_same_time_as_valid_extensions_for_source_files__63__.mdwn?ds=inline diff --git a/doc/forum/How_to_allow_.markdown_and_.md_at_the_same_time_as_valid_extensions_for_source_files__63__.mdwn b/doc/forum/How_to_allow_.markdown_and_.md_at_the_same_time_as_valid_extensions_for_source_files__63__.mdwn index d5f144957..79fbcfe67 100644 --- a/doc/forum/How_to_allow_.markdown_and_.md_at_the_same_time_as_valid_extensions_for_source_files__63__.mdwn +++ b/doc/forum/How_to_allow_.markdown_and_.md_at_the_same_time_as_valid_extensions_for_source_files__63__.mdwn @@ -1 +1,24 @@ How to allow .markdown and .md (at the same time) as valid extensions for source files? The default is .mdwn. + +> Add `md` to your `add_plugins`, set `libdir` if not already set, +> put the following in `${libdir}/IkiWiki/Plugin/md.pm`, and rebuild: + + #!/usr/bin/perl + package IkiWiki::Plugin::md; + + use warnings; + use strict; + use IkiWiki 3.00; + + my @ADDITIONAL_EXTENSIONS = qw(md markdown); + + sub import { + IkiWiki::loadplugin('mdwn'); + foreach my $ext (@ADDITIONAL_EXTENSIONS) { + hook(type => "htmlize", id => $ext, call => \&IkiWiki::Plugin::mdwn::htmlize, longname => "Markdown (.$ext)"); + } + } + + 1 + +> --[[schmonz]]