New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.16 #7
Closed
Closed
0.16 #7
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6143140
fix lists, add link support for twiki
jewilke ebea9df
=begin support for the Template
jewilke 1091d3b
add Dokuwiki support
jewilke 292615d
Fix some Confluence Bugs
jewilke 1271d4b
update MANIFEST and Changes
jewilke 8e6f043
fixed typo
jewilke ea245b7
Fix linebraks in Text Lists
jewilke 8c029f4
Fix Link handling in Twiki.pm
jewilke File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
Revision history for Pod::Simple::Wiki. | ||
|
||
0.16 Jan 26 2014 | ||
|
||
+ Added Dokuwiki support contributed by Joe Cooper | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each of these changes will need to be a separate Issue/Pull Request. |
||
+ Added rudimentary link support for twiki | ||
+ Added Support for =for and =begin targets for twiki and the Template | ||
|
||
! Fix for missing line breaks in lists for twiki | ||
! Fix for RT#71119 Confluence asterisk enumeration | ||
! Fix for RT#38833 Escaping of Confluence special characters | ||
|
||
0.15 Oct 14 2012 | ||
|
||
+ Added options for beautifying MediaWiki output. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
package Pod::Simple::Wiki::Dokuwiki; | ||
|
||
############################################################################### | ||
# | ||
# Pod::Simple::Wiki::Dokuwiki - A class for creating Pod to Dokuwiki filters. | ||
# | ||
# | ||
# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org | ||
# Copyright 2008 Joe Cooper, joe@virtualmin.com | ||
# | ||
# Documentation after __END__ | ||
# | ||
|
||
use Pod::Simple::Wiki; | ||
use strict; | ||
use vars qw(@ISA $VERSION); | ||
|
||
|
||
@ISA = qw(Pod::Simple::Wiki); | ||
$VERSION = '0.08'; | ||
|
||
############################################################################### | ||
# | ||
# The tag to wiki mappings. | ||
# | ||
my $tags = { | ||
'<b>' => '**', | ||
'</b>' => '**', | ||
'<i>' => '//', | ||
'</i>' => '//', | ||
'<tt>' => "''", | ||
'</tt>' => "''", | ||
'<pre>' => "<code>\n", | ||
'</pre>' => "\n</code>", | ||
|
||
'<h1>' => "====== ", | ||
'</h1>' => " ======\n", | ||
'<h2>' => "===== ", | ||
'</h2>' => " =====\n", | ||
'<h3>' => "==== ", | ||
'</h3>' => " ====\n", | ||
'<h4>' => "=== ", | ||
'</h4>' => " ===\n", | ||
}; | ||
|
||
############################################################################### | ||
# | ||
# new() | ||
# | ||
# Simple constructor inheriting from Pod::Simple::Wiki. | ||
# | ||
sub new { | ||
|
||
my $class = shift; | ||
my $self = Pod::Simple::Wiki->new('wiki', @_); | ||
$self->{_tags} = $tags; | ||
|
||
bless $self, $class; | ||
return $self; | ||
} | ||
|
||
# Portme. How Pod "=over" blocks are converted to Template wiki lists. | ||
|
||
############################################################################### | ||
# | ||
# _indent_item() | ||
# | ||
# Indents an "over-item" to the correct level. | ||
# | ||
sub _indent_item { | ||
|
||
my $self = shift; | ||
my $item_type = $_[0]; | ||
my $item_param = $_[1]; | ||
my $indent_level = $self->{_item_indent}; | ||
|
||
if ($item_type eq 'bullet') { | ||
$self->_append(' ' x $indent_level . '* '); | ||
} | ||
elsif ($item_type eq 'number') { | ||
$self->_append(' ' x $indent_level . '- '); | ||
} | ||
elsif ($item_type eq 'text') { | ||
# Dokuwiki has no "indent" without bullets or numbers, punt | ||
$self->_append(' ' x $indent_level . '* **'); | ||
} | ||
} | ||
|
||
############################################################################### | ||
# | ||
# _handle_text() | ||
# | ||
# Perform any necessary transforms on the text. This is mainly used to escape | ||
# inadvertent CamelCase words. | ||
# | ||
sub _handle_text { | ||
|
||
my $self = shift; | ||
my $text = $_[0]; | ||
|
||
# Only escape words in paragraphs | ||
if (not $self->{_in_Para}) { | ||
$self->{_wiki_text} .= $text; | ||
return; | ||
} | ||
|
||
# Split the text into tokens but maintain the whitespace | ||
my @tokens = split /(\s+)/, $text; | ||
|
||
# Escape any tokens here, if necessary. | ||
|
||
# Rejoin the tokens and whitespace. | ||
$self->{_wiki_text} .= join '', @tokens; | ||
} | ||
|
||
|
||
############################################################################### | ||
# | ||
# Functions to deal with =over ... =back regions for | ||
# | ||
# Bulleted lists | ||
# Numbered lists | ||
# Text lists | ||
# Block lists | ||
# | ||
sub _end_item_text {$_[0]->_output('**: ')} | ||
|
||
|
||
# Portme: Probably won't have to change this. | ||
|
||
############################################################################### | ||
# | ||
# _start_Para() | ||
# | ||
# Special handling for paragraphs that are part of an "over" block. | ||
# | ||
sub _start_Para { | ||
|
||
my $self = shift; | ||
my $indent_level = $self->{_item_indent}; | ||
|
||
if ($self->{_in_over_block}) { | ||
# Do something here is necessary | ||
} | ||
} | ||
|
||
1; | ||
|
||
|
||
__END__ | ||
|
||
|
||
=head1 NAME | ||
|
||
Pod::Simple::Wiki::Dokuwiki - A class for creating Pod to Dokuwiki wiki filters. | ||
|
||
=head1 SYNOPSIS | ||
|
||
This module isn't used directly. Instead it is called via C<Pod::Simple::Wiki>: | ||
|
||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use Pod::Simple::Wiki; | ||
|
||
|
||
my $parser = Pod::Simple::Wiki->new('dokuwiki'); | ||
|
||
... | ||
|
||
|
||
Convert Pod to a Template wiki format using the installed C<pod2wiki> utility: | ||
|
||
pod2wiki --style dokuwiki file.pod > file.wiki | ||
|
||
|
||
=head1 DESCRIPTION | ||
|
||
The C<Pod::Simple::Wiki::Dokuwiki> module is used for converting Pod text to Wiki text. | ||
|
||
Pod (Plain Old Documentation) is a simple markup language used for writing Perl documentation. | ||
|
||
For an introduction to Dokuwiki see: http://wiki.splitbrain.org/wiki:dokuwiki | ||
|
||
This module isn't generally invoked directly. Instead it is called via C<Pod::Simple::Wiki>. See the L<Pod::Simple::Wiki> and L<pod2wiki> documentation for more information. | ||
|
||
|
||
=head1 METHODS | ||
|
||
Pod::Simple::Wiki::Dokuwiki inherits all of the methods of C<Pod::Simple> and C<Pod::Simple::Wiki>. See L<Pod::Simple> and L<Pod::Simple::Wiki> for more details. | ||
|
||
=head1 Dokuwiki Specific information | ||
|
||
Dokuwiki does not support indentation outside of pre-formatted blocks, except for bulleted lists, so indentation is represented by an unordered list. | ||
|
||
=head1 SEE ALSO | ||
|
||
This module also installs a C<pod2wiki> command line utility. See C<pod2wiki --help> for details. | ||
|
||
|
||
=head1 DISCLAIMER OF WARRANTY | ||
|
||
Please refer to the DISCLAIMER OF WARRANTY in L<Pod::Simple::Wiki>. | ||
|
||
|
||
=head1 AUTHORS | ||
|
||
John McNamara jmcnamara@cpan.org | ||
|
||
Joe Cooper joe@virtualmin.com | ||
|
||
=head1 COPYRIGHT | ||
|
||
� MMIII-MMVIII, John McNamara. | ||
|
||
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll handle changes like version numbers and release notes prior to release.