From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67517 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: wikimedia2context: any existing solutions? Date: Wed, 30 Mar 2011 16:47:07 +0200 Message-ID: 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 1301496453 30758 80.91.229.12 (30 Mar 2011 14:47:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2011 14:47:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 30 16:47:29 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 1Q4wgB-00078Z-RE for gctc-ntg-context-518@m.gmane.org; Wed, 30 Mar 2011 16:47:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 29F6BCAB4B; Wed, 30 Mar 2011 16:47:02 +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 ADh5I8IrM9eZ; Wed, 30 Mar 2011 16:46:59 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 80128CAB43; Wed, 30 Mar 2011 16:46:59 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A3E0BCAB43 for ; Wed, 30 Mar 2011 16:46:58 +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 1HTuy7FdootH for ; Wed, 30 Mar 2011 16:46:44 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 42D28CAAF7 for ; Wed, 30 Mar 2011 16:46:44 +0200 (CEST) Original-Received: from mail-qy0-f169.google.com (mail-qy0-f169.google.com [209.85.216.169]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2UEl7wn022146 for ; Wed, 30 Mar 2011 16:47:08 +0200 Original-Received: by qyk2 with SMTP id 2so3395830qyk.14 for ; Wed, 30 Mar 2011 07:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=KZZSsPW1g9GgLa/yl7+J+vh4XE1PvGYcpXbJnrog9dA=; b=do8PgSYfIQ8shtQR3Noxa2sVTJ8Y2/tfZ07N6O+IYeYAK8cH0bPLHv6S0LPJAxMw8l M+TWjphKPM3tvaZxDAAsxbIT3X7ye4OttuVBGecccCTWRUBQL1vFZewVcMsJXbrPWPWI C5XaIGYbRrpDCCo5x+u4JGGTPxjyUwGiZo8Ys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=iu2f5tPNjGNFfinKFSjmiMCDtu3w4AgTxYorfYgg0pycUt2VsE3XUbjlpi8KFzXDXP AU6kWn+L/B2nakoLL9iYP/nKHtwZv2lXGf5wxGRuz7PQngTn5FNWfeYo3VHvb0YDoW1C n7k9tTvgePouzuUx7kaCUDh2sRVK9kCWXt4c0= Original-Received: by 10.224.140.68 with SMTP id h4mr1140952qau.54.1301496427222; Wed, 30 Mar 2011 07:47:07 -0700 (PDT) Original-Received: by 10.229.89.69 with HTTP; Wed, 30 Mar 2011 07:47:07 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.169; 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: 0cEpqL88a - f84b5b541b45 - 20110330 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:67517 Archived-At: 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 Maybe there is more, but I think that this covers the majority of contents. The solution doesn't have to be too robust and I don't care what language it is written in (I just need a printed manual and I have no problem manually tweaking the pitfals after the conversion if needed). I can start writing regular expressions, but in case that somebody has an almost-ready-to-use solution, that would be much better than doing everything from scratch. (A Lua function that would simply read in a plain wiki file would be nice, but I have never tried to gain deep understanding of "parsing" in lua.) Thanks a lot, Mojca ___________________________________________________________________________________ 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 ___________________________________________________________________________________