Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen Judkins
haddock
Commits
1de86e8a
Commit
1de86e8a
authored
14 years ago
by
waern
Browse files
Options
Downloads
Patches
Plain Diff
Naming wibbles
parent
d5ec9853
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Haddock/Options.hs
+10
-9
10 additions, 9 deletions
src/Haddock/Options.hs
src/Main.hs
+9
-9
9 additions, 9 deletions
src/Main.hs
with
19 additions
and
18 deletions
src/Haddock/Options.hs
+
10
−
9
View file @
1de86e8a
...
...
@@ -20,13 +20,13 @@ module Haddock.Options (
optContentsUrl
,
optIndexUrl
,
optCssFile
,
optS
ourceUrls
,
optW
ikiUrls
,
s
ourceUrls
,
w
ikiUrls
,
optDumpInterfaceFile
,
optLaTeXStyle
,
verbosity
,
ghcFlags
,
ifaceTriple
s
readIfaceArg
s
)
where
...
...
@@ -196,15 +196,15 @@ optCssFile :: [Flag] -> Maybe FilePath
optCssFile
flags
=
optLast
[
str
|
Flag_CSS
str
<-
flags
]
optS
ourceUrls
::
[
Flag
]
->
(
Maybe
String
,
Maybe
String
,
Maybe
String
)
optS
ourceUrls
flags
=
s
ourceUrls
::
[
Flag
]
->
(
Maybe
String
,
Maybe
String
,
Maybe
String
)
s
ourceUrls
flags
=
(
listToMaybe
[
str
|
Flag_SourceBaseURL
str
<-
flags
]
,
listToMaybe
[
str
|
Flag_SourceModuleURL
str
<-
flags
]
,
listToMaybe
[
str
|
Flag_SourceEntityURL
str
<-
flags
])
optW
ikiUrls
::
[
Flag
]
->
(
Maybe
String
,
Maybe
String
,
Maybe
String
)
optW
ikiUrls
flags
=
w
ikiUrls
::
[
Flag
]
->
(
Maybe
String
,
Maybe
String
,
Maybe
String
)
w
ikiUrls
flags
=
(
listToMaybe
[
str
|
Flag_WikiBaseURL
str
<-
flags
]
,
listToMaybe
[
str
|
Flag_WikiModuleURL
str
<-
flags
]
,
listToMaybe
[
str
|
Flag_WikiEntityURL
str
<-
flags
])
...
...
@@ -217,6 +217,7 @@ optDumpInterfaceFile flags = optLast [ str | Flag_DumpInterface str <- flags ]
optLaTeXStyle
::
[
Flag
]
->
Maybe
String
optLaTeXStyle
flags
=
optLast
[
str
|
Flag_LaTeXStyle
str
<-
flags
]
verbosity
::
[
Flag
]
->
Verbosity
verbosity
flags
=
case
[
str
|
Flag_Verbosity
str
<-
flags
]
of
...
...
@@ -230,8 +231,8 @@ ghcFlags :: [Flag] -> [String]
ghcFlags
flags
=
[
option
|
Flag_OptGhc
option
<-
flags
]
ifaceTriple
s
::
[
Flag
]
->
[(
DocPaths
,
FilePath
)]
ifaceTriple
s
flags
=
[
parseIfaceOption
s
|
Flag_ReadInterface
s
<-
flags
]
readIfaceArg
s
::
[
Flag
]
->
[(
DocPaths
,
FilePath
)]
readIfaceArg
s
flags
=
[
parseIfaceOption
s
|
Flag_ReadInterface
s
<-
flags
]
where
parseIfaceOption
::
String
->
(
DocPaths
,
FilePath
)
parseIfaceOption
str
=
...
...
This diff is collapsed.
Click to expand it.
src/Main.hs
+
9
−
9
View file @
1de86e8a
...
...
@@ -141,7 +141,7 @@ main = handleTopExceptions $ do
throwE
"No input file(s)."
-- Get packages supplied with --read-interface.
packages
<-
readInterfaceFiles
freshNameCache
(
ifaceTriple
s
flags
)
packages
<-
readInterfaceFiles
freshNameCache
(
readIfaceArg
s
flags
)
-- Render even though there are no input files (usually contents/index).
renderStep
flags
packages
[]
...
...
@@ -161,7 +161,7 @@ readPackagesAndProcessModules flags files = do
withGhc
libDir
(
ghcFlags
flags
)
$
\
_
->
handleSrcErrors
$
do
-- Get packages supplied with --read-interface.
packages
<-
readInterfaceFiles
nameCacheFromGhc
(
ifaceTriple
s
flags
)
packages
<-
readInterfaceFiles
nameCacheFromGhc
(
readIfaceArg
s
flags
)
-- Create the interfaces -- this is the core part of Haddock.
let
ifaceFiles
=
map
snd
packages
...
...
@@ -187,7 +187,7 @@ render flags ifaces installedIfaces srcMap = do
let
title
=
fromMaybe
""
(
optTitle
flags
)
unicode
=
Flag_UseUnicode
`
elem
`
flags
opt_wiki_urls
=
optW
ikiUrls
flags
opt_wiki_urls
=
w
ikiUrls
flags
opt_contents_url
=
optContentsUrl
flags
opt_index_url
=
optIndexUrl
flags
odir
=
outputDir
flags
...
...
@@ -204,9 +204,9 @@ render flags ifaces installedIfaces srcMap = do
pkgStr
=
Just
(
packageIdString
pkgId
)
(
pkgName
,
pkgVer
)
=
modulePackageInfo
pkgMod
(
src
_b
ase
,
src
_m
odule
,
src
_e
ntity
)
=
optS
ourceUrls
flags
srcMap'
=
maybe
srcMap
(
\
path
->
Map
.
insert
pkgId
path
srcMap
)
src
_e
ntity
sourceUrls
=
(
src
_b
ase
,
src
_m
odule
,
srcMap'
)
(
src
B
ase
,
src
M
odule
,
src
E
ntity
)
=
s
ourceUrls
flags
srcMap'
=
maybe
srcMap
(
\
path
->
Map
.
insert
pkgId
path
srcMap
)
src
E
ntity
sourceUrls
'
=
(
src
B
ase
,
src
M
odule
,
srcMap'
)
libDir
<-
getHaddockLibDir
flags
prologue
<-
getPrologue
flags
...
...
@@ -214,20 +214,20 @@ render flags ifaces installedIfaces srcMap = do
when
(
Flag_GenIndex
`
elem
`
flags
)
$
do
ppHtmlIndex
odir
title
pkgStr
themes
opt_contents_url
sourceUrls
opt_wiki_urls
themes
opt_contents_url
sourceUrls
'
opt_wiki_urls
allVisibleIfaces
copyHtmlBits
odir
libDir
themes
when
(
Flag_GenContents
`
elem
`
flags
)
$
do
ppHtmlContents
odir
title
pkgStr
themes
opt_index_url
sourceUrls
opt_wiki_urls
themes
opt_index_url
sourceUrls
'
opt_wiki_urls
allVisibleIfaces
True
prologue
copyHtmlBits
odir
libDir
themes
when
(
Flag_Html
`
elem
`
flags
)
$
do
ppHtml
title
pkgStr
visibleIfaces
odir
prologue
themes
sourceUrls
opt_wiki_urls
themes
sourceUrls
'
opt_wiki_urls
opt_contents_url
opt_index_url
unicode
copyHtmlBits
odir
libDir
themes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment