packages feed

mdcat (empty) → 0.1.0.0

raw patch · 5 files changed

+90/−0 lines, 5 filesdep +ansi-terminaldep +basedep +directorysetup-changed

Dependencies added: ansi-terminal, base, directory, pandoc, terminfo

Files

+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2015 Bob Fang++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ README.md view
@@ -0,0 +1,16 @@+#mdcat and its usage+This is a simple utility tool for viewing markdown files in terminal.++##Test for *mdcat* [a fake link]() then go back to header+*Hi* _World_++---------------------------------------++***++  * I am Bob+  * [University of Cambridge](http://www.cam.ac.uk), _Chuchill College_+  * Male+  * Software developer+  * _Miao_+  * [Homepage *Github yo!* ](https://dorafmon.github.io)
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ mdcat.cabal view
@@ -0,0 +1,30 @@+-- Initial mdcat.cabal generated by cabal init.  For further documentation,+--  see http://haskell.org/cabal/users-guide/++name:                mdcat+version:             0.1.0.0+synopsis:            Markdown viewer in your terminal+description:		 A simple command line tool for viewing markdown in your terminal+-- description:         +homepage:            https://github.com/dorafmon/mdcat+license:             MIT+license-file:        LICENSE+author:              Bob Fang+maintainer:          dorafmon@gmail.com+-- copyright:           +category:            Text+build-type:          Simple+extra-source-files:  README.md+cabal-version:       >=1.10++executable mdcat+  main-is:             Main.hs+  -- other-modules:       +  -- other-extensions:    +  build-depends:       base >=4.7 && <4.8, pandoc >=1.13 && <1.14, directory >=1.2 && <1.3, ansi-terminal >=0.6 && <0.7, terminfo >= 0.4.0.0+  hs-source-dirs:      src+  default-language:    Haskell2010++source-repository      head+  type:				   git+  location:            git@github.com:dorafmon/mdcat.git
+ src/Main.hs view
@@ -0,0 +1,22 @@+module Main where+  import Mdcat+  import System.Environment (getArgs)+  import Text.Pandoc+  import System.Directory+  import System.Console.ANSI+  import Control.Monad++  main :: IO ()+  main = do+    l <- getArgs+    case l of+      (file:_) -> do+        file_exists <- doesFileExist file+        if file_exists then do+          file_content <- readFile file+          let pandoc_document = readMarkdown def file_content+          render pandoc_document+          debugMessage 100 "Finished Rendering"+        else+          print "Error, file does not exists"+      _ -> print "Error, please at leaset provide a file path"