diff --git a/CHANGES b/CHANGES
new file mode 100644
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,3 @@
+0.1: 27 Dec 2011
+   * First public release. can generate svg files for each page and index.html file for nagivating those pages 
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,25 @@
+The following license covers this documentation, and the source code, except
+where otherwise indicated.
+
+Copyright 2011, Ian-Woo Kim. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,10 @@
+#! /usr/bin/env runhaskell
+
+> import Distribution.Simple
+> import Distribution.PackageDescription
+> --import System.Process
+> main = defaultMain
+> --main = defaultMainWithHooks testUserHooks
+> --testUserHooks = simpleUserHooks { 
+>  --   preConf = \_ _ -> runCommand "cd rootcode; make; cd .." >>return emptyHookedBuildInfo
+>   --  } 
diff --git a/exe/xournal-convert.hs b/exe/xournal-convert.hs
new file mode 100644
--- /dev/null
+++ b/exe/xournal-convert.hs
@@ -0,0 +1,13 @@
+module Main where
+
+import System.Console.CmdArgs
+
+import Application.XournalConvert.ProgType
+import Application.XournalConvert.Command
+
+main :: IO () 
+main = do 
+  putStrLn "xournal-convert"
+  param <- cmdArgs mode
+
+  commandLineProcess param
diff --git a/lib/Application/XournalConvert/Command.hs b/lib/Application/XournalConvert/Command.hs
new file mode 100644
--- /dev/null
+++ b/lib/Application/XournalConvert/Command.hs
@@ -0,0 +1,12 @@
+module Application.XournalConvert.Command where
+
+import Application.XournalConvert.ProgType
+import Application.XournalConvert.Job
+
+commandLineProcess :: Xournal_convert -> IO ()
+commandLineProcess Test = do 
+  putStrLn "test called"
+  startJob
+commandLineProcess (MakeSVG fname mdest) = do 
+  putStrLn "makeSVG is called"
+  startMakeSVG fname mdest
diff --git a/lib/Application/XournalConvert/Job.hs b/lib/Application/XournalConvert/Job.hs
new file mode 100644
--- /dev/null
+++ b/lib/Application/XournalConvert/Job.hs
@@ -0,0 +1,93 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module Application.XournalConvert.Job where
+
+import Data.List 
+import Graphics.Xournal.Render.Simple
+import Graphics.Rendering.Cairo
+
+import Data.Xournal.Simple
+import Text.Xournal.Parse
+
+import Text.StringTemplate
+-- import Text.StringTemplate.Helpers
+
+import System.Directory 
+import System.FilePath
+import System.IO
+
+import Paths_xournal_convert
+
+render1 :: [(String,String)] -> String -> String
+render1 attribs tmpl = render . setManyAttrib attribs . newSTMP $ tmpl
+
+svgFileName :: String -> Int -> String 
+svgFileName fname_wo_ext pnum =
+  fname_wo_ext ++ "_Page_" ++ show pnum <.> "svg"
+
+
+startJob :: IO () 
+startJob = do 
+  putStrLn "job started"
+
+
+
+
+startMakeSVG :: FilePath -> Maybe FilePath -> IO () 
+startMakeSVG fname mdest = do 
+  xojcontent <- read_xournal fname 
+
+  case mdest of 
+    Nothing -> return ()
+    Just dest -> setCurrentDirectory dest
+
+  let (fname_wo_ext,_fname_ext) = splitExtension fname 
+  let pages = xoj_pages xojcontent
+      names = map (svgFileName fname_wo_ext) [1..]
+      -- names = map (\x -> fname_wo_ext ++ show x ++ ".svg") [1..] 
+      namePages = zip names pages 
+  let Dim w h = page_dim (head pages)
+
+  putStrLn $ " w = " ++ show w
+  putStrLn $ " h = " ++ show h  
+
+  let svgoutfn x = withSVGSurface (fst x) w h (\s -> renderWith s (cairoDrawPage (snd x)))
+
+  mapM_ svgoutfn namePages
+
+  makeHtmlJavascriptPage "index.html" $ zip [1..] (map fst namePages)
+   
+  putStrLn "test ended"
+
+onePageTemplate :: String 
+onePageTemplate = "<p><div class=\"page\"> <a name=\"$page$\"> <img src=\"$filename$\" width=100% /> </a> </div> </p>\n\n"
+
+onerule :: String 
+onerule = "<hr /> \n"
+
+makeHtmlJavascriptPage :: FilePath -> [(Int,String)] -> IO ()
+makeHtmlJavascriptPage fname names = do
+  putStrLn $ "writing  " ++ fname
+  putStrLn $ show names 
+  templateDir <- getDataDir >>= return . (</> "template")
+
+  indexhtmlst <- readFile (templateDir </> "index.html.st")
+  -- (templates :: STGroup String) <- directoryGroup templateDir 
+ 
+ 
+
+  let mkstr :: (Int,String) -> String 
+      mkstr (p,n) = flip render1 onePageTemplate [ ("filename", "." </> n) 
+                                                 , ("page", show p) ]
+      bodystr = intercalate onerule . map mkstr $ names
+
+  let str = flip render1 indexhtmlst [ ("body", bodystr) ] 
+
+  {- renderTemplateGroup 
+             templates 
+             [ ("body", bodystr) ] 
+             "index.html" -}
+
+  withFile fname WriteMode $ \h -> do 
+    hPutStr h str
+    
diff --git a/lib/Application/XournalConvert/ProgType.hs b/lib/Application/XournalConvert/ProgType.hs
new file mode 100644
--- /dev/null
+++ b/lib/Application/XournalConvert/ProgType.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+
+module Application.XournalConvert.ProgType where 
+
+import System.Console.CmdArgs
+
+data Xournal_convert = Test 
+                     | MakeSVG { xojfile :: FilePath
+                               , dest :: Maybe FilePath 
+                               }
+              deriving (Show,Data,Typeable)
+
+test :: Xournal_convert
+test = Test 
+
+makeSVG :: Xournal_convert
+makeSVG = MakeSVG { xojfile = "test.xoj" &= typ "FILENAME" &= argPos 0 
+                  , dest = Nothing &= typ "DESTINATION" 
+                  }
+
+mode :: Xournal_convert 
+mode = modes [test, makeSVG]
+
diff --git a/template/index.html.st b/template/index.html.st
new file mode 100644
--- /dev/null
+++ b/template/index.html.st
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <title> XOJ file </title>
+  </head>
+  <body>
+    $body$
+  </body>
+</html>
diff --git a/xournal-convert.cabal b/xournal-convert.cabal
new file mode 100644
--- /dev/null
+++ b/xournal-convert.cabal
@@ -0,0 +1,54 @@
+Name:		xournal-convert
+Version:	0.1
+Synopsis:	convert utility for xoj files
+Description: 	convert xoj files into various formats (SVG,SVG+index.html..) 
+Homepage:       http://ianwookim.org/hxournal
+License: 	BSD3
+License-file:	LICENSE
+Author:		Ian-Woo Kim
+Maintainer: 	Ian-Woo Kim <ianwookim@gmail.com>
+Category:       Application
+Tested-with:    GHC == 7.0.4
+Build-Type: 	Simple
+Cabal-Version:  >= 1.8
+data-files:     
+                template/*.html.st
+                CHANGES
+Source-repository head
+  type: git
+  location: http://www.github.com/wavewave/xournal-convert
+
+Executable xournal-convert
+  Main-is: xournal-convert.hs
+  hs-source-dirs: exe
+  ghc-options: 	-Wall -threaded -funbox-strict-fields -fno-warn-unused-do-bind
+  ghc-prof-options: -caf-all -auto-all
+  Build-Depends: 
+                   base == 4.*, 
+                   cmdargs >= 0.7 && < 0.10, 
+                   xournal-convert
+
+Library
+  hs-source-dirs: lib
+  ghc-options: 	-Wall -funbox-strict-fields -fno-warn-unused-do-bind
+  ghc-prof-options: -caf-all -auto-all
+  Build-Depends: 
+                   base == 4.*,
+                   mtl == 2.*, 
+                   directory == 1.1.*, 
+                   filepath == 1.2.*,
+                   cmdargs >= 0.7 && < 0.10, 
+                   HStringTemplate == 0.6.*,
+                   xournal-types == 0.2.*,
+                   xournal-parser == 0.3.*, 
+                   xournal-render == 0.4.*, 
+                   cairo == 0.12.*
+
+  Exposed-Modules: 
+                   Application.XournalConvert.ProgType
+                   Application.XournalConvert.Job
+                   Application.XournalConvert.Command
+  Other-Modules: 
+                   Paths_xournal_convert
+ 
+
