git-remote-mediawiki: add preview subcommand into git mw
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>
This commit is contained in:

committed by
Junio C Hamano

parent
07a263b905
commit
0078a7fa05
@ -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;
|
||||
|
Reference in New Issue
Block a user