hatex-guide 1.0 → 1.0.1
raw patch · 6 files changed
+77/−36 lines, 6 filessetup-changed
Files
- Setup.hs +33/−3
- Text/LaTeX/Guide.hs +2/−0
- Text/LaTeX/Guide/Aux.hs +9/−0
- Text/LaTeX/Guide/Backend/LaTeX.hs +2/−2
- hatex-guide.cabal +3/−3
- license +28/−28
Setup.hs view
@@ -1,13 +1,19 @@ -import Distribution.Simple import System.Directory ( copyFile , getAppUserDataDirectory , createDirectoryIfMissing )-import Text.LaTeX.Guide (sectionList)-import Text.LaTeX.Guide.Info (otherResources)+import Text.LaTeX.Guide.Info (sectionList,otherResources) import System.FilePath ((</>),(<.>))+import Control.Applicative ((<$>))+-- Cabal+import Distribution.Simple+import Distribution.PackageDescription+import Distribution.PackageDescription.Parse (readPackageDescription)+import Distribution.Verbosity (normal)+-- Version+import Data.Version main :: IO () main = do@@ -18,4 +24,28 @@ in copyFile fp $ d </> fp) sectionList mapM_ (\r -> let fp = "res" </> r in copyFile fp $ d </> fp) otherResources+ -- Write aux module+ getAux >>= writeFile ("Text" </> "LaTeX" </> "Guide" </> "Aux" <.> "hs") . auxmodule+ -- defaultMain++data Aux = Aux { guideVersion :: Version }++getAux :: IO Aux+getAux = do+ pd <- packageDescription <$> readPackageDescription normal "hatex-guide.cabal"+ return $ Aux (pkgVersion $ package pd)++auxmodule :: Aux -> String+auxmodule a = unlines [+ "module Text.LaTeX.Guide.Aux ("+ , " guideVersion"+ , " ) where"+ , ""+ , "import Data.Version"+ , ""+ , "-- | The version of the guide. Based on the version of the package."+ , "guideVersion :: Version"+ , "guideVersion = " ++ (let v = guideVersion a+ in "Version " ++ show (versionBranch v) ++ " []")+ ]
Text/LaTeX/Guide.hs view
@@ -18,9 +18,11 @@ -- * Info , sectionList , contributors+ , guideVersion ) where import Text.LaTeX.Guide.Info+import Text.LaTeX.Guide.Aux (guideVersion) import qualified Text.LaTeX.Guide.Backend.LaTeX as LaTeX import qualified Text.LaTeX.Guide.Backend.Wiki as Wiki
+ Text/LaTeX/Guide/Aux.hs view
@@ -0,0 +1,9 @@+module Text.LaTeX.Guide.Aux (+ guideVersion+ ) where++import Data.Version++-- | The version of the guide. Based on the version of the package.+guideVersion :: Version+guideVersion = Version [1,0,1] []
Text/LaTeX/Guide/Backend/LaTeX.hs view
@@ -7,6 +7,7 @@ import Text.LaTeX.Guide.Syntax import Text.LaTeX.Guide.Info hiding (LaTeX)+import Text.LaTeX.Guide.Aux -- import Text.LaTeX import Text.LaTeX.Packages.Color@@ -21,7 +22,6 @@ import Data.List (intersperse) import System.FilePath ((</>)) import System.Directory (getAppUserDataDirectory)-import qualified Paths_hatex_guide as G sectFromInt :: Int -> LaTeX -> LaTeX sectFromInt 1 = section@@ -66,7 +66,7 @@ theTitle = let xs = versionBranch version in flushright ( resizebox (Pt 300) (Pt 40) (textbf "HATEX " <> (rendertex $ head xs)) <> lnbk <> textit ("The User's Guide, version "- <> fromString (showVersion G.version)+ <> fromString (showVersion guideVersion) <> " (using " <> hatex <> " " <> fromString (showVersion version) <> ")") <> lnbk <> rule (Just $ Pt 10) (CustomMeasure textwidth) (Pt 2) <> lnbk <> url (createURL "https://github.com/Daniel-Diaz/HaTeX") <> lnbk
hatex-guide.cabal view
@@ -1,8 +1,8 @@ Name: hatex-guide-Version: 1.0+Version: 1.0.1 Author: Daniel Díaz-Category: LaTeX Build-type: Custom+Category: LaTeX License: BSD3 License-file: license Maintainer: Daniel Díaz (dhelta `dot` diaz `at` gmail `dot` com)@@ -43,7 +43,7 @@ Exposed-modules: Text.LaTeX.Guide Other-modules:- Paths_hatex_guide+ Text.LaTeX.Guide.Aux Text.LaTeX.Guide.Syntax Text.LaTeX.Guide.Info Text.LaTeX.Guide.Backend.LaTeX
license view
@@ -1,28 +1,28 @@-Copyright (c)2013, Daniel Díaz - -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. - - * Neither the name of Daniel Díaz nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"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 -OWNER OR CONTRIBUTORS 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. +Copyright (c)2013, Daniel Díaz++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.++ * Neither the name of Daniel Díaz nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"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+OWNER OR CONTRIBUTORS 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.