all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sharon Kimble <boudiccas@skimble.plus.com>
To: help-gnu-emacs@gnu.org
Cc: "N. Raghavendra" <nyraghu27132@gmail.com>
Subject: Re: Editing MediaWiki pages
Date: Mon, 30 Oct 2017 09:26:48 +0000	[thread overview]
Message-ID: <87vaixx9yf.fsf@skimble.plus.com> (raw)
In-Reply-To: <878tfyzmeq.fsf@gmail.com> (N. Raghavendra's message of "Thu, 26 Oct 2017 07:43:33 +0530")

[-- Attachment #1: Type: text/plain, Size: 3713 bytes --]

"N. Raghavendra" <nyraghu27132@gmail.com> writes:

> I have recently started contributing to a Wiki that runs on MediaWiki.
> I have been writing on the Web interface of the Wiki, which is
> convenient for previewing, but is otherwise inconvenient.  I would like
> to edit the Wiki pages from Emacs.  I found two packages for this:
>
> 1. wikipedia-mode,
>    https://en.wikipedia.org/wiki/Wikipedia:Wikipedia-mode.el
>
> 2. mediawiki-el, https://github.com/hexmode/mediawiki-el
>
> I would appreciate any advice or recommendations about these or other
> packages for editing MediaWiki pages with Emacs.

Hi Raghu, sorry for not replying sooner but I've had the builders in and
am only now getting sorted out.

I regularly write 'articles' for my 'DrugFacts' mediawiki, using
org-mode exported as mediawiki. Every article and menu on that site is
written in org-mode, except for the top drop-down menu, and the articles
are also stored in mediawiki format in my ~/.emacs.d/wiki' directory.
Because my main file for DrugFacts is 3.4mb, I highlight the section
that I want to export and then export it as mediawiki, so that in the
mediawiki buffer I'm only left with the correct section and nothing
else. But it does require rereading and then various things like
citations being sorted out, for which I use several yasnippets further
down this email.

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp
(require 'mediawiki)
;;(require 'ox-mediawiki)
(eval-after-load "org" '(require 'ox-mediawiki nil t))
(global-set-key (kbd "M-s-a") 'org-mw-export-to-mediawiki) ;; ("mw" file)
(global-set-key (kbd "M-s-e") 'org-mw-export-as-mediawiki) ;; (temporary buffer)
#+END_SRC
[2017-03-16 Thu 10:30]

#+BEGIN_SRC emacs-lisp
(defun mediawiki-test-suite ()
  (toggle-truncate-lines 0)
  (abbrev-mode 1)
  (set-fill-column 65000)
  (auto-fill-mode 0))

(add-hook 'mediawiki-mode-hook #'mediawiki-test-suite)
#+END_SRC
[2017-03-17 Fri 21:04]

#+BEGIN_SRC emacs-lisp
  ;; do this in a hook because mediawiki-mode resets its keybindings on
  ;; evey mode change.
  (add-hook 'mediawiki-mode-hook
            (lambda ()
              (define-key mediawiki-mode-map (kbd "C-x C-s") 'save-buffer)))
#+END_SRC
[2017-04-12 Wed 15:19]
--8<---------------cut here---------------end--------------->8---

I've also set up several yasnippets which I find very useful when I'm
writing org-mode2mediawiki test, and they are -

--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: category
# key: medcas
# --
[[Category:

# -*- mode: snippet -*-
# name: citation
# key: cref
# --
<ref name="$0"> </ref>

# -*- mode: snippet -*-
# name: citation repeat
# binding: M-s-8
# --
<ref name="$0"/>

# -*- mode: snippet -*-
# name: mediawiki-end
# key: medend
# --
----

== References ==

<references />

<span id="BackToTop"></span>
<div class="noprint" style="background-color:#fc3; color:#d33; position:fixed; bottom:2%; left:0.25%; padding:0; margin:0;">
[[#top| '''Back to the Top''' ]]
</div>
<span id="BackToTop"></span>
<div class="noprint" style="background-color:#fc3; color:#d33; position:fixed; bottom:2%; right:0.25%; padding:0; margin:0;">
[[#top| '''Back to the Top''' ]]
</div>
--8<---------------cut here---------------end--------------->8---

I hope that these have been helpful, and if I can help you further,
please, get in contact.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.2, fluxbox 1.3.5-2, emacs 25.3.2, org-mode 9.1.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-10-30  9:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  2:13 Editing MediaWiki pages N. Raghavendra
2017-10-30  9:26 ` Sharon Kimble [this message]
2017-10-31 14:17   ` Raghavendra Nyshadham
2017-11-14 19:08   ` Narendra Joshi
2017-11-15 15:58     ` Sharon Kimble
2017-11-15 16:09       ` Emanuel Berg
2017-11-15 16:47         ` tomas
2017-11-15 17:40           ` Emanuel Berg
2017-11-15 18:33           ` N. Raghavendra
2017-11-15 16:33     ` N. Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaixx9yf.fsf@skimble.plus.com \
    --to=boudiccas@skimble.plus.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nyraghu27132@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.