
Pod::POM::View::SPIP - POD Object Model View for SPIP

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);

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.

Class constructor. Used by Pod::POM.

Implement Pod::POM view method
=head1 POD sections are translated to the following SPIP markup:
=head1 Title
becomes:
{{{Title}}}
which is the SPIP classic title markup.
=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).
=head3 POD sections are translated to the following SPIP markup:
=head3 Title
becomes:
- {Title}
which is first level item list with italic text.
=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 only counts indent levels.
=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).
The =for sections are passed directly without any transformation.
Return only =begin spip sections. FIXME: maybe it should return anything...
Suppress leading spaces and return text from text blocks.
Verbatim POD sections are translated to the following SPIP markup:
<code> some code </code>
Bold text is translated to the following SPIP markup:
{{some text}}
Italic text is translated to the following SPIP markup:
{some text}
Code text is translated to the following SPIP markup:
<code>some inline code</code>
File text is translated to the following SPIP markup:
<code>/path/to/file</code>
Code text is translated to the following SPIP markup:
<code>some inline code</code>
Links are treated as in Pod::POM::View::HTML.
FIXME view_seq_link_transform_path should handle links to other articles, etc.
Identify and create links into SPIP links
For now, just make the link as [title-link]>.
FIXME: view_seq_text should be filtering some specific markup, such as HTML-like tags, which should be transformed using entities.

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.

Jérôme Fenal <jfenal@free.fr>

This is version 0.03 of the Pod::POM::View::SPIP module.

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 Pod::POM(3) and pom2(1) for other ways to use Pod::POM::View::SPIP.
SPIP can be found at http://www.spip.net/.