/** * Pod Language Definition **/ (function() { var Pod = { 'function-bold' : { search: /(^[\n]+)([\n\s]*)/g, replace: "B<$1>$2" }, 'function-italic' : { search: /(^[\n]+)([\n\s]*)/g, replace: "I<$1>$2" }, 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "C<$1>$2" }, 'function-h1' : { search: /(.+)([\n]?)/gi, replace: "=head1 $1$2" }, 'function-h2' : { search: /(.+)([\n]?)/gi, replace: "=head2 $1$2" }, 'function-h3' : { search: /(.+)([\n]?)/gi, replace: "=head3 $1$2" }, 'function-link' : { exec: function( txt, selText, $field ) { var results = null; $.GollumEditor.Dialog.init({ title: 'Insert Link', fields: [ { id: 'text', name: 'Link Text', type: 'text' }, { id: 'href', name: 'URL', type: 'text' } ], OK: function( res ) { var rep = ''; if ( res['text'] && res['href'] ) { rep = 'L<' + res['text'] + '|' + res['href'] + '>'; } $.GollumEditor.replaceSelection( rep ); } }); } } }; jQuery.GollumEditor.defineLanguage('pod', 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/>
).'
}
]
}
];
jQuery.GollumEditor.defineHelp('pod', PodHelp);
})();