diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2007-08-13 00:14:47 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2007-08-13 00:14:47 +0200 |
commit | 4a35edbbc974649b8d8e1c9a7abc8694486e7446 (patch) | |
tree | 39edd20b946808b9351851f30b21ab9345a6e05e | |
parent | 1b88bb9bcc86b4145487b3338034cac31c13dc2e (diff) |
The beginning of ``Some Quick Notes About the TWiki to ikiwiki Conversion''.
-rw-r--r-- | AboutTheTWikiToIkiwikiConversion.mdwn | 97 | ||||
-rw-r--r-- | Main/TWikiColophon.mdwn | 6 |
2 files changed, 103 insertions, 0 deletions
diff --git a/AboutTheTWikiToIkiwikiConversion.mdwn b/AboutTheTWikiToIkiwikiConversion.mdwn new file mode 100644 index 00000000..44027f2d --- /dev/null +++ b/AboutTheTWikiToIkiwikiConversion.mdwn @@ -0,0 +1,97 @@ +# Some Quick Notes About the *TWiki to ikiwiki* Conversion + +/!\ Incomplete. + +I saw a *moin2iki* program bundle being announced from +<http://ikiwiki.info/index/discussion/#index2h1>. + + <tschwinge> JoshTriplett: On http://ikiwiki.info/users/joshtriplett.html + you write about a TWiki to ikiwiki conversion script. Is that already + available somewhere? + <JoshTriplett> tschwinge: Yes, you can get it in its current state at + git://svcs.cs.pdx.edu/git/moin2iki.git + <JoshTriplett> tschwinge: That repo has scripts for converting from Moin + and TWiki to ikiwiki. + <JoshTriplett> tschwinge: Work in progress. + <JoshTriplett> tschwinge: For a purely TWiki setup, it should work fine. + <JoshTriplett> tschwinge: You need a number of depenencies, though, and we + haven't documented them well yet. + <tschwinge> JoshTriplett: Thanks, I'll have a look and report back (in some + days, I hope). + <JoshTriplett> tschwinge: In particular, you need HTML::WikiConverter with + our 12 ikiwiki-related patches. + <JoshTriplett> tschwinge: + http://rt.cpan.org/Public/Bug/Display.html?id=24446 + +As I had difficulties with extracting the patches from the cpan site, they were +also made available by the authors at +<http://svcs.cs.pdx.edu/~jamey/wikiconverter/>. + +The Debian package *libhtml-wikiconverter-perl* is too old at least until +[[debbug 419918]] is closed. + +For converting from rcs files (as used by TWiki) to a git repository you'll +need to get `git clone git://people.freedesktop.org/~keithp/parsecvs` and build +it. Or don't do that and install the Debian *git-cvs* package instead; see +below. + +Here is the command line I used (line breaks added for readability) to create +an *Authors* file from the TWiki files, suitable for *parsecvs* or +*git-cvsimport* to use: + + $ sort < data/Main/TWikiUsers.txt | uniq | ↩ + while read s n r; do ↩ + ( [ "$s" != \* ] || expr "$r" : .\*\< > /dev/null) && continue; ↩ + echo "$n"="$(recode Latin1..UTF-8 < data/Main/"$n".txt | ↩ + awk -v name="$n" 'BEGIN { FS = ": "; email = "web-hurd@gnu.org" } ↩ + { sub("\r$", "") } $1 ~ /\* Name$/ { name = $2 } ↩ + $1 ~ /\* Email$/ { email = $2 } ↩ + END { print name " <" email ">" }')"; ↩ + done | tee Authors + +The old TWiki installation had managed to corrupt one of its own rcs files, +which both *parsecvs* and *git-cvsimport* stumbled on. As that file was not +essential for me, I simply deleted it. + +The final output (after the TWiki markup to Markdown markup conversion) was +expected to pour out *.mdwn* files. However the original TWiki files are named +*.txt*. As the *git-map* step as yet (would this be possible at all?) has no +way to rename the files while converting, I simply adapted the input files' +names to what was expected: I ran a the following command to rename the +*.txt,v* files to *.mdwn,v* files before running *git-cvsimport*: + + $ find ./ | grep \\.txt,v | while read f; do ↩ + mv -vi "$f" "$(expr "$f" : \\\(.\*\\\)\\.txt,v)".mdwn,v; done + +Instead of using *parsecvs* (which finally even choked on the valid rcs input +files) I eventually ended up successfully converting the old TWiki with +*git-cvsimport*: + + $ git-cvsimport -v -d "`pwd`"/../hurd-wiki/ -z 0 -a -A ../Authors data + [...] + Committed patch 4698 (origin +0000 2007-04-13 17:40:08) + Commit ID c33d05d0274d0d602fba835805abb9ba413c65c6 + Generating pack... + Done counting 18576 objects. + Deltifying 18576 objects... + 100% (18576/18576) done + Writing 18576 objects... + 100% (18576/18576) done + Total 18576 (delta 12567), reused 16106 (delta 10886) + Pack pack-d38e3d55705f5d355f669aaa7d993420b50798d0 created. + Removing unused objects 100%... + Done. + DONE; creating master branch + +The only thing I had to do to make the conglomerate of rcs files a *valid* cvs +repository (read: to satisfy *git-cvsimport*'s needs) was a `mkdir +../hurd-wiki/CVSROOT`. + +Then let's convert the whole git tree from TWiki syntax to Markdown: + + $ TWIKI="`pwd`"/../hurd-wiki tw_2001-12-01_2iki "`pwd`"/.git + [...] + +After that I repeated -- in a separate directory!, they can be merged later -- +the same last steps again, replacing *data* with *pub*, which contains the data +files that had been attached to the wiki pages (like images, for example). diff --git a/Main/TWikiColophon.mdwn b/Main/TWikiColophon.mdwn index ae62431f..a768b3a1 100644 --- a/Main/TWikiColophon.mdwn +++ b/Main/TWikiColophon.mdwn @@ -11,3 +11,9 @@ This site begain in May, 2002 as one TWiki web: [[Hurd]]. This WebHome page was We hope the new arrangement using multiple TWiki webs will help newcomers and old timers alike. Your Feedback is encouraged. Each Web has a WebDiscuss topic. ([[Hurd/WebDiscuss]], [[Distrib/WebDiscuss]], [[Mach/WebDiscuss]], [[GNU/WebDiscuss]], [[Mig/WebDiscuss]], [[Main/WebDiscuss]] and [[TWiki/WebDiscuss]]) The global feedback page is [[TWiki/TWikiDiscuss]]. A feedback topic specifically for the front page is available at [[Main/HurdGnuFansOrgDiscuss]]. -- [[Main/GrantBow]] - 10 Jan 2003 + +--- + +On 2007-08-12 [[Thomas_Schwinge|tschwinge]] finished the conversion of the +TWiki content to ikiwiki. On [[AboutTheTWikiToIkiwikiConversion]] you can read +a bit about that. |