ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* wikimedia2context: any existing solutions?
@ 2011-03-30 14:47 Mojca Miklavec
  2011-03-30 15:16 ` Khaled Hosny
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2011-03-30 14:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-03 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 14:47 wikimedia2context: any existing solutions? Mojca Miklavec
2011-03-30 15:16 ` Khaled Hosny
2011-03-30 17:32   ` Mojca Miklavec
2011-03-30 17:38     ` Aditya Mahajan
2011-03-30 18:44     ` Khaled Hosny
2011-03-30 20:41       ` Mojca Miklavec
2011-04-03 11:48     ` R. Ermers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).