From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67518 Path: news.gmane.org!not-for-mail From: Khaled Hosny Newsgroups: gmane.comp.tex.context Subject: Re: wikimedia2context: any existing solutions? Date: Wed, 30 Mar 2011 17:16:30 +0200 Message-ID: <20110330151629.GA18420@khaled-laptop> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1301498260 10654 80.91.229.12 (30 Mar 2011 15:17:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2011 15:17:40 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 30 17:17:33 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4x9G-0007YD-Tg for gctc-ntg-context-518@m.gmane.org; Wed, 30 Mar 2011 17:17:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 892B2CAB56; Wed, 30 Mar 2011 17:17:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VPTQbcFzJDhR; Wed, 30 Mar 2011 17:16:58 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2FFABCAB43; Wed, 30 Mar 2011 17:16:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 69F96CAB43 for ; Wed, 30 Mar 2011 17:16:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id B4cD4hkl5wV1 for ; Wed, 30 Mar 2011 17:16:52 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 6870BCAAF7 for ; Wed, 30 Mar 2011 17:16:52 +0200 (CEST) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2UFHG2j008923 for ; Wed, 30 Mar 2011 17:17:16 +0200 Original-Received: by fxm18 with SMTP id 18so1548928fxm.14 for ; Wed, 30 Mar 2011 08:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=N8ZVT6Vwl7dmHJcI2KiwGn5jxK2DA+pAtD0U3uw9Ni8=; b=TPTEtA418bl01wjvKPqhajYBhP3amRbEK1FsZCqjt43o5KcbnyrT44omK0/dOsg2cZ br8EnvqT10PzILijzZuX/BbKx1OVl+osr26LJ5UsF7cTUkiETeDXPjFAQpnCzllKypqw ZNYUrZoSFWd4fe8PSpx9d8zDgbkj1PNKhj660= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=w2cpAADlnRQduRy7PjwcNFFbv0Xd1Ug5Cw/ucV2YGowHMzhTLYxgwI8ubyAsraG9NG +hign2YXNTieTk9CpuDvFGcZ4CK9L0D4tEc0UAyBvB46Q9r2G1fPWrKkpACN5J3Ix2/v 2/smJirS2kXMhR4ThW2OA8f96o2vMkpM+aZqs= Original-Received: by 10.223.9.137 with SMTP id l9mr1439039fal.25.1301498236317; Wed, 30 Mar 2011 08:17:16 -0700 (PDT) Original-Received: from localhost ([41.176.167.215]) by mx.google.com with ESMTPS id f15sm86210fax.10.2011.03.30.08.17.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 08:17:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rEprhg2P - ee34e2ceb899 - 20110330 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:67518 Archived-At: On Wed, Mar 30, 2011 at 04:47:07PM +0200, Mojca Miklavec wrote: > Hello, > > Before I start reinvinting the wheel ... I have a feeling that some > people were already doing some basic wikimedia2context syntax > conversion. > > I would like to create PDF out of some wiki pages with very limited > number of used commands. I have created a simple ruby script that > fetches all the contents that I want in the final PDF, all that is > left to be done is conversion from wiki to tex syntax: > - replace =...= with \section{...}, ==...== with \subsection{...}, > ===...=== with \subsubsection{...}, ... > - replace ''...'' with {\bf ...}, '''...''' with {\it ...}, > '''''...''''' with {\bi ...} > - all lines starting with a space should be printed verbatim > - lines starting with * should be bulleted itemize > - lines starting with # should be numbered itemize > - some trivial replacements like > > - some links: [[abc def]] should become symlinks to begining of > sections with that title > - [[Image:chap1-f2.jpg|frame|Figure 1.2: Cylindrical scanner]] should > become \placefigure{Cylindrical > scanner}{\externalfigure[chap1-f2.jpg]} > - a few tables If you are comfortable with writing PEG grammar (I'm not), writing a mediawiki parser for luanamark[1] might be a good choice, it has a ConTeXt writer already (and markdown parser). I pet pandoc have mediawiki support as well, so you may try it. [1] https://github.com/jgm/lunamark Regards, Khaled -- Khaled Hosny Egyptian Arab ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________