/** * Pod Language Definition * See default.js for documentation **/ (function($) { // No need to set all the replacements, only those different from the default language (Markdown). var Pod = { 'function-bold' : { replace: "B<$1>$2" }, 'function-italic' : { replace: "I<$1>$2" }, 'function-hr' : undefined, 'function-code' : { replace: "C<$1>$2" }, 'function-h1' : { replace: "=head1 $1$2" }, 'function-h2' : { replace: "=head2 $1$2" }, 'function-h3' : { replace: "=head3 $1$2" }, 'function-link' : { replace: function ( res ) { var rep = ''; if ( res['text'] && res['href'] ) { rep = 'L<' + res['text'] + '|' + res['href'] + '>'; } return rep; } }, 'function-image' : undefined, 'function-ul' : undefined, 'function-ol' : undefined, 'function-blockquote' : undefined }; $.GollumEditor.defineLanguage('pod', $.constructLanguageDefinition(Pod)); var PodHelp = [ { menuName: 'Command Paragraphs', content: [ { menuName: 'Headings', data: '
All command paragraphs start with =
(equals sign).
To create headings 1 through 4, begin your command paragraph with =headN
, where N
is the number of the heading 1 through 4. For example, to make a first-order heading (the largest possible,) write =head1
, then on the next line begin your paragraph that you want under the heading.
Perl pod blocks should begin with =pod
and end with =cut
, signifying to Pod parsers that the pod block has begun and ended. These command paragraphs only signal the beginning and end of a pod block.
pod also allows blocks in other formats, such as HTML or plain text. To create one of these blocks, use the =format SYNTAX
command paragraph, where SYNTAX
is the syntax of the block (e.g. html
or txt
). At the end of your block, use the =end SYNTAX
block.
If you are having encoding troubles, use the =encoding ENC_TYPE
command, where ENC_TYPE
is the encoding type (e.g. utf8
, koi8-r
). This will affect the entire document, not just the block below the command.
Formatting text as bold, italic or code
works in the S<word>
syntax, where S
is an abbreviation for the type of text you are trying to create. For example, B<my bold text>
becomes my bold text, I<italic text>
becomes italic text and C<code here()>
becomes code here()
.
Writing hyperlinks in pod is much like formatting text, using the same S<>
syntax. Instead of B
, I
or C
, use L
to begin a hyperlink.
pod allows you to hyperlink to a man
page, a Perl documentation page, or another web page. To link to a man
or Perl documentation page, simply include the page name in the link (e.g. L<perl(1)>
or L<Net::Ping>
). If you want to link to a web page, separate the URL and the link text with a pipe (e.g. to link to github.com, write L<GitHub|http://github.com/>
).'
}
]
}
];
$.GollumEditor.defineHelp('pod', PodHelp);
})(jQuery);