[commit: haddock] master: Document some functions in XHTML utlity module. (980664b)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:42:21 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/980664b29a588eef44d8048d4beedce4d2a96b09

>---------------------------------------------------------------

commit 980664b29a588eef44d8048d4beedce4d2a96b09
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Jul 1 21:01:42 2015 +0200

    Document some functions in XHTML utlity module.


>---------------------------------------------------------------

980664b29a588eef44d8048d4beedce4d2a96b09
 haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
index 36ecf86..5166549 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
@@ -41,11 +41,19 @@ import Module   ( Module, ModuleName, moduleName, moduleNameString )
 import Name     ( getOccString, nameOccName, isValOcc )
 
 
+-- | Replace placeholder string elements with provided values.
+--
+-- Used to generate URL for customized external paths, usually provided with
+-- @--source-module@, @--source-entity@ and related command-line arguments.
+--
+-- >>> spliceURL Nothing mmod mname Nothing "output/%{MODULE}.hs#%{NAME}"
+-- "output/Foo.hs#foo"
 spliceURL :: Maybe FilePath -> Maybe Module -> Maybe GHC.Name ->
              Maybe SrcSpan -> String -> String
 spliceURL mfile mmod = spliceURL' mfile (moduleName <$> mmod)
 
 
+-- | Same as 'spliceURL' but takes 'ModuleName' instead of 'Module'.
 spliceURL' :: Maybe FilePath -> Maybe ModuleName -> Maybe GHC.Name ->
               Maybe SrcSpan -> String -> String
 spliceURL' maybe_file maybe_mod maybe_name maybe_loc = run



More information about the ghc-commits mailing list