summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/Git/Mediawiki.pm
diff options
context:
space:
mode:
authorBenoit Person <benoit.person@ensimag.fr>2013-07-04 22:39:00 +0200
committerJunio C Hamano <gitster@pobox.com>2013-07-08 08:56:14 -0700
commit0078a7fa05b3d671739aefba5265da809ea32e55 (patch)
tree6655668814b361d1303787948c72f213b4482566 /contrib/mw-to-git/Git/Mediawiki.pm
parent07a263b9056ac7135ed84d64cabf80c5a6b1972e (diff)
downloadgit-0078a7fa05b3d671739aefba5265da809ea32e55.tar.gz
git-remote-mediawiki: add preview subcommand into git mwbp/mediawiki-preview
In the current state, a user of git-remote-mediawiki can edit the markup text locally, but has to push to the remote wiki to see how the page is rendererd. Add a new 'git mw preview' command that allows rendering the markup text on the remote wiki without actually pushing any change on the wiki. This uses Mediawiki's API to render the markup and inserts it in an actual HTML page from the wiki so that CSS can be rendered properly. Most links should work when the page exists on the remote. Signed-off-by: Benoit Person <benoit.person@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git/Git/Mediawiki.pm')
-rw-r--r--contrib/mw-to-git/Git/Mediawiki.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/mw-to-git/Git/Mediawiki.pm b/contrib/mw-to-git/Git/Mediawiki.pm
index 47fe4f4cca..d13c4dfa7d 100644
--- a/contrib/mw-to-git/Git/Mediawiki.pm
+++ b/contrib/mw-to-git/Git/Mediawiki.pm
@@ -19,7 +19,7 @@ require Exporter;
# Methods which can be called as standalone functions as well:
@EXPORT_OK = qw(clean_filename smudge_filename connect_maybe
- EMPTY HTTP_CODE_OK);
+ EMPTY HTTP_CODE_OK HTTP_CODE_PAGE_NOT_FOUND);
}
# Mediawiki filenames can contain forward slashes. This variable decides by which pattern they should be replaced
@@ -30,6 +30,7 @@ use constant EMPTY => q{};
# HTTP codes
use constant HTTP_CODE_OK => 200;
+use constant HTTP_CODE_PAGE_NOT_FOUND => 404;
sub clean_filename {
my $filename = shift;