mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-03-30 01:27:03 +02:00
Support ?style=plain on haddocks
This commit is contained in:
parent
950cb7ef6d
commit
eac18f4b1b
@ -50,6 +50,11 @@ getHaddockR slug rest
|
||||
addExtra t = [t]
|
||||
req <- parseRequest $ unpack $ makeURL slug rest
|
||||
(_, res) <- acquireResponse req >>= allocateAcquire
|
||||
mstyle <- lookupGetParam "style"
|
||||
case mstyle of
|
||||
Just "plain" -> respondSource "text/html; charset=utf-8"
|
||||
$ responseBody res .| mapC (Chunk . toBuilder)
|
||||
_ -> do
|
||||
doc <- responseBody res
|
||||
$$ eventConduit
|
||||
=$ concatMapC addExtra
|
||||
|
||||
Loading…
Reference in New Issue
Block a user