Permalink
Browse files

Added explanation about converting google code wikis to markdown for …

…github migration
  • Loading branch information...
1 parent 56bca2e commit f283d4f504a30b5e22be45ee7fe87f628acae7b7 @reidab committed Aug 4, 2011
Showing with 30 additions and 3 deletions.
  1. +30 −3 README.md
View
@@ -16,8 +16,35 @@ Once you've got those:
You can pass in a file...
- > gcw2html filename.wiki
+ $ gcw2html filename.wiki
+
+or you can read from STDIN
+
+ $ cat filename.wiki | gcw2html
+
+and you'll get HTML out!
+
+Want to save the output to a file? Just redirect!
+
+ $ gcw2html filename.wiki > filename.html
+
+
+## Converting Google Code wiki markup to __markdown__
+
+I originally wrote this in the process of transferring a moderately-sized
+wiki from Google Code to GitHub. For those in similar boat, here's how I
+did that using too many tools and the joys of the unix pipe.
+
+You'll need:
+
+ * gcw2html
+ * [pandoc](http://johnmacfarlane.net/pandoc/installing.html)
+ * ruby (or some other language) to do the final regexp bit in
+
+Conversion party:
+
+ gcw2html filename.wiki \
+ | pandoc --from html --to markdown --no-wrap \
+ | ruby -e 'puts STDIN.readlines.to_s.gsub(/\[([^\]]*)\]\(http:\/\/code\.google\.com\/p\/[^\/]*\/wiki\/([^\)]*)\)/,"[[\\1 | \\2]]")'
-or you can read from STDIN.
- > cat filename.wiki | gcw2html

0 comments on commit f283d4f

Please sign in to comment.