Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-frontend
Commits
08c95ff6
Commit
08c95ff6
authored
Oct 21, 2014
by
Björn Peemöller
Browse files
Automatically copy installed CSS file to documentation root directory
parent
8cc51bce
Changes
2
Hide whitespace changes
Inline
Side-by-side
curry-frontend.cabal
View file @
08c95ff6
...
...
@@ -40,7 +40,8 @@ Executable cymake
build-depends: network < 2.6
ghc-options: -Wall
Other-Modules:
Base.CurryTypes
Paths_curry_frontend
, Base.CurryTypes
, Base.Expr
, Base.Messages
, Base.NestEnv
...
...
src/Html/CurryHtml.hs
View file @
08c95ff6
...
...
@@ -13,11 +13,12 @@
-}
module
Html.CurryHtml
(
source2html
)
where
import
Control.Applicative
((
<$>
),
(
<*>
))
import
Control.Monad.Writer
import
Data.List
(
mapAccumL
)
import
Data.Maybe
(
fromMaybe
,
isJust
)
import
Network.URI
(
escapeURIString
,
isUnreserved
)
import
System.Directory
(
copyFile
,
doesFileExist
)
import
System.FilePath
((
</>
),
dropFileName
,
joinPath
,
takeBaseName
)
import
Curry.Base.Ident
(
ModuleIdent
(
..
),
QualIdent
(
..
),
unqualify
)
...
...
@@ -49,6 +50,18 @@ source2html opts f = do
srcFile
<-
liftIO
$
lookupCurryFile
(
"."
:
optImportPaths
opts
)
f
(
m
,
program
)
<-
filename2program
opts
(
fromMaybe
f
srcFile
)
liftIO
$
writeFile
outFile
(
program2html
m
program
)
liftIO
$
updateCSSFile
outDir
updateCSSFile
::
FilePath
->
IO
()
updateCSSFile
dir
=
do
src
<-
getDataFileName
cssFile
let
target
=
dir
</>
cssFile
exists
<-
doesFileExist
target
if
not
exists
then
copyFile
src
target
else
do
same
<-
(
==
)
<$>
readFile
src
<*>
readFile
target
unless
same
$
copyFile
src
target
-- @param importpaths
-- @param filename
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment