NAME
Pod::POM::View::SPIP - POD Object Model View for SPIP
SYNOPSIS
use Pod::POM::View::SPIP;
my $parser = Pod::POM->new(\%options);
# parse from a text string
my $pom = $parser->parse_text($text)
|| die $parser->error();
# parse from a file specified by name or filehandle
my $pom = $parser->parse_text($file)
|| die $parser->error();
# parse from text or file
my $pom = $parser->parse($text_or_file)
|| die $parser->error();
print Pod::POM::View::SPIP->print($pom);
DESCRIPTION
SPIP is a popular CMS in France, and as POD is also a popular text format to write articles, we needed a way to translate POD text into SPIP markup.
This view for Pod::POM(3) implements it.
METHODS
new
Class constructor. Used by Pod::POM.
VIEW DETAILS
view
Implement Pod::POM
view
methodview_head1
=head1
POD sections are translated to the following SPIP markup:=head1 Title
becomes:
{{{Title}}}
which is the SPIP classic title markup.
view_head2
=head2
POD sections are translated to the following SPIP markup:=head2 Title
becomes:
- {{Title}}
which is first level item list with bold text.
Remember that first level lists in SPIP are bulleted with an image (puce).
view_head3
=head3
POD sections are translated to the following SPIP markup:=head3 Title
becomes:
- {Title}
which is first level item list with italic text.
view_head4
=head4
POD sections are translated to the following SPIP markup:=head4 Title
becomes:
-* {Title}
which is second level item list with italic text.
In SPIP, second level itemized lists are then translated to <UL> HTML tags.
view_over
view_over
only counts indent levels.view_item
=item
POD sections (enclosed between=over
&=back
) are translated to the following SPIP markup:=over =item First level item (no explicit bullet) =item * First level item (with bullet) =over =item * Second level item (with bullet) =item 1 Second level numbered item =item 1 Second level numbered item =back =item 1. First level numbered item =item 1. First level numbered item =back
become respectively:
_First level item (no bullet) -* First level item (with bullet) -** Title -## Title -## Title -# Title -# Title
When multiple nested lists advent, the imbrication levels are respected. Be careful to specify bullets for sub-level lists, as SPIP only allows them on the first level (
_
prefix).view_for
The
=for
sections are passed directly without any transformation.view_begin
Return only
=begin spip
sections. FIXME: maybe it should return anything...view_textblock
Suppress leading spaces and return text from text blocks.
view_verbatim
Verbatim POD sections are translated to the following SPIP markup:
<code> some code </code>
view_seq_bold
Bold text is translated to the following SPIP markup:
{{some text}}
view_seq_italic
Italic text is translated to the following SPIP markup:
{some text}
view_seq_code
Code text is translated to the following SPIP markup:
<code>some inline code</code>
view_seq_file
File text is translated to the following SPIP markup:
<code>/path/to/file</code>
view_seq_entities
Code text is translated to the following SPIP markup:
<code>some inline code</code>
view_seq_link
Links are treated as in Pod::POM::View::HTML.
view_seq_link_transform_path
FIXME view_seq_link_transform_path should handle links to other articles, etc.
make_href
Identify and create links into SPIP links
For now, just make the link as
[title-
link]>.view_seq_text
FIXME: view_seq_text should be filtering some specific markup, such as HTML-like tags, which should be transformed using entities.
BUGS
No warning is issued when translating nested item lists without bullets nor number. The result will not be what is expected. Your mileage may vary.
Don't expect for now having B<I<text>>
giving bold italic text.
AUTHOR
Jérôme Fenal <jfenal@free.fr>
VERSION
This is version 0.03 of the Pod::POM::View::SPIP module.
COPYRIGHT
Copyright (C) 2004 Jérôme Fenal. All Rights Reserved
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
See Pod::POM(3) and pom2(1) for other ways to use Pod::POM::View::SPIP.
SPIP can be found at http://www.spip.net/.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 653:
Non-ASCII character seen before =encoding in 'Jérôme'. Assuming CP1252