github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

marcusramberg / mojomojo

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 72
    • 28
  • Source
  • Commits
  • Network (28)
  • Issues (38)
  • Downloads (17)
  • Wiki (1)
  • Graphs
  • Tree: 477908c

click here to add a description

click here to add a homepage

  • Branches (10)
    • Formatter-File
    • attachment-list-revision
    • fckeditor
    • footer-reorg
    • makeover
    • master
    • menu-reorg
    • rollback-updates-content
    • swf-upload-2.2
    • versioned_rename
  • Tags (17)
    • MojoMojo-0.999042-stable
    • MojoMojo-0.999041
    • MojoMojo-0.999033
    • MojoMojo-0.999032
    • MojoMojo-0.999029
    • MojoMojo-0.999028
    • MojoMojo-0.999027
    • MojoMojo-0.999026
    • MojoMojo-0.999025
    • MojoMojo-0.999024
    • MojoMojo-0.999023
    • MojoMojo-0.999022
    • MojoMojo-0.999021
    • MojoMojo-0.999020
    • MojoMojo-0.999019
    • 0.999028
    • 0.999027
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A Catalyst & DBIx::Class powered Wiki. — Read more

  cancel

http://mojomojo.org/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Using is instead of ok 
plu (author)
Thu Apr 23 05:36:36 -0700 2009
commit  477908cf0de52a8a4dcf58887363a70f315731f9
tree    a27d78607f9e4360585f334376a51f7796d7aaef
parent  5c24db81aa7bb196e59c2b7f919c1d9705229c1f
mojomojo / lib / MojoMojo / Formatter / Markdown.pm lib/MojoMojo/Formatter/Markdown.pm
100644 85 lines (53 sloc) 2.056 kb
edit raw blame history
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package MojoMojo::Formatter::Markdown;
 
use base qw/MojoMojo::Formatter/;
 
my $markdown;
eval "use Text::MultiMarkdown";
unless ($@) {
    $markdown = Text::MultiMarkdown->new(
        markdown_in_html_blocks => 1, # Allow Markdown syntax within HTML blocks.
        use_metadata =>
            0, # Remove MultiMarkdown behavior change to make the top of the document metadata.
        heading_ids => 0, # Remove MultiMarkdown behavior change in <hX> tags.
        img_ids => 0, # Remove MultiMarkdown behavior change in <img> tags.
    );
}
 
=head1 NAME
 
MojoMojo::Formatter::Markdown - MultiMarkdown formatting for your content.
MultiMarkdown is an extension of Markdown, adding support for tables,
footnotes, bibliography, automatic cross-references, glossaries, appendices,
definition lists, math syntax, anchor and image attributes, and document metadata.
 
Markdown syntax: L<http://daringfireball.net/projects/markdown/syntax>
MultiMarkdown syntax: L<http://fletcherpenney.net/multimarkdown/users_guide/multimarkdown_syntax_guide/>
 
=head1 DESCRIPTION
 
This formatter processes content using L<Text::MultiMarkdown> This is a
syntax for writing human-friendly formatted text.
 
=head1 METHODS
 
=over 4
 
=item primary_formatter
 
See also L<MojoMojo::Formatter/primary_formatter>.
 
=cut
 
sub primary_formatter { 1; }
 
=item format_content_order
 
Format order can be 1-99. The Markdown formatter runs on 15
 
=cut
 
sub format_content_order { 15 }
 
=item format_content
 
calls the formatter. Takes a ref to the content as well as the
context object.
 
=cut
 
sub format_content {
    my ( $class, $content, $c ) = @_;
    return unless $markdown;
    return unless $c->pref('main_formatter') eq 'MojoMojo::Formatter::Markdown';
 
    # Let markdown handle the rest
    $$content = $markdown->markdown($$content);
}
 
=back
 
=head1 SEE ALSO
 
L<MojoMojo>,L<Module::Pluggable::Ordered>,L<Text::MultiMarkdown>
 
=head1 AUTHORS
 
Marcus Ramberg <mramberg@cpan.org>
 
=head1 License
 
This module is licensed under the same terms as Perl itself.
 
=cut
 
1;
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server