Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename HtmlToBlaze to BlazeFromHtml

This name allows better consistency with the
package names on Hackage.
  • Loading branch information...
commit 0fd1a35bcf7db3fb3382ff4d027ef1869ad54fa9 1 parent 6fc8821
Jasper Van der Jeugt authored
6 Makefile
View
@@ -49,6 +49,6 @@ blaze-html: hide-cabal-files
mv blaze-html.cabal.blaze-html blaze-html.cabal
mv Setup.hs.blaze-html Setup.hs
-blaze-html-to-blaze: hide-cabal-files
- mv blaze-html-to-blaze.cabal.blaze-html-to-blaze blaze-html-to-blaze.cabal
- mv Setup.hs.blaze-html-to-blaze Setup.hs
+blaze-from-html: hide-cabal-files
+ mv blaze-from-html.cabal.blaze-from-html blaze-from-html.cabal
+ mv Setup.hs.blaze-from-html Setup.hs
0  Setup.hs.blaze-html-to-blaze → Setup.hs.blaze-from-html
View
File renamed without changes
18 Util/HtmlToBlaze.hs → Util/BlazeFromHtml.hs
View
@@ -138,11 +138,11 @@ fromHtml variant (Parent tag attrs inner) = case combinatorType variant tag of
-- | Convert the HTML to blaze code.
--
-htmlToBlaze :: HtmlVariant -- ^ Variant to use
- -> String -- ^ Template name
- -> String -- ^ HTML code
- -> String -- ^ Resulting code
-htmlToBlaze variant name =
+blazeFromHtml :: HtmlVariant -- ^ Variant to use
+ -> String -- ^ Template name
+ -> String -- ^ HTML code
+ -> String -- ^ Resulting code
+blazeFromHtml variant name =
addSignature . unlines . fromHtml variant
. minimizeBlocks . removeEmptyText . fst . makeTree []
. parseTagsOptions parseOptions { optTagPosition = True }
@@ -162,12 +162,12 @@ main = do
Just variant -> main' variant xs
where
-- No files given, work with stdin
- main' variant [] = interact $ htmlToBlaze variant "template"
+ main' variant [] = interact $ blazeFromHtml variant "template"
-- Handle all files
main' variant files = forM_ files $ \file -> do
body <- readFile file
- putStrLn $ htmlToBlaze variant (dropExtension file) body
+ putStrLn $ blazeFromHtml variant (dropExtension file) body
-- | Show some help information.
--
@@ -178,7 +178,7 @@ help = mapM_ putStrLn $
, ""
, "Usage:"
, ""
- , " html-to-blaze html-version [FILES ...]"
+ , " blaze-from-html html-version [FILES ...]"
, ""
, "When no files are given, it works as a filter. The HTML version should"
, "be one of:"
@@ -188,6 +188,6 @@ help = mapM_ putStrLn $
[ ""
, "Example:"
, ""
- , " html-to-blaze html4-strict index.html"
+ , " blaze-from-html html4-strict index.html"
, ""
]
6 blaze-html-to-blaze.cabal.blaze-html-to-blaze → blaze-from-html.cabal.blaze-from-html
View
@@ -1,4 +1,4 @@
-Name: blaze-html-to-blaze
+Name: blaze-from-html
Version: 0.2.0
Synopsis: Tool to convert HTML to BlazeHtml code.
Description: Tool that converts HTML files to Haskell code, ready to be
@@ -14,9 +14,9 @@ Category: Text
Build-type: Simple
Cabal-version: >= 1.2
-Executable html-to-blaze
+Executable blaze-from-html
Ghc-Options: -Wall
- Main-Is: Util/HtmlToBlaze.hs
+ Main-Is: Util/BlazeFromHtml.hs
Build-depends: base >= 4 && < 5,
containers >= 0.3,
filepath >= 1.1,
Please sign in to comment.
Something went wrong with that request. Please try again.