Conversion from Wikibooks to PreTeXt

7 views
Skip to first unread message

Steven Clontz

unread,
Nov 21, 2022, 6:11:13 PM11/21/22
to PreTeXt development
I have a student who's interested in using our planned directed reading this spring to convert https://en.wikibooks.org/wiki/Surreal_Numbers_and_Games to PreTeXt and expand it. Does anyone have any experience automatically converting a Wikibook to PreTeXt?

David W. Farmer

unread,
Nov 21, 2022, 6:34:31 PM11/21/22
to PreTeXt development

I have a lot of experience converting other markup to PreTeXt.

The most important idea for your student to understand is that
they should not edit the wikibook: they should write a script to
do all of the conversion. Every time they make a change, it is to
their script, and the re-run the entire conversion.

Their product is a script which (almost) perfectly converts that book.

What I am saying is completely obvious if you know enough. Many
students do not know enough.

I am happy to correspond with anyone doing such activities, and to
share code I have written.

An interesting challenge in this case is to convert the "7" in
"Theorem 7" to an identifier. That could be left for hand-editing
at the end, but I think it can be handled programmatically.

Based on my brief look at the source of one section of that
book, I suspect that an extremely accurate automated conversion
is possible.
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> pretext-dev...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/93c20662-2da7-4525-8f1a-ede5a712c89dn%40googlegroups.com.
>
>

Steven Clontz

unread,
Nov 21, 2022, 6:38:11 PM11/21/22
to prete...@googlegroups.com
It's more likely that I will create a package to handle automated conversion if no one has already. I just copied that someone had so I wouldn't have to. (-:

Oscar Levin

unread,
Nov 21, 2022, 7:47:43 PM11/21/22
to PreTeXt development
I assume you would download the source of each page, and then convert the markdown-like mediawiki markup?  If so, then I would start by trying pandoc and the pandoc-pretext writer (https://github.com/oscarlevin/pandoc-pretext).

This would be a nice use case that might motivate me to improve that writer.

Reply all
Reply to author
Forward
0 new messages