mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-24 09:51:57 +01:00
Adding heading IDs for READMEs
This commit is contained in:
parent
c453b0bd34
commit
47e4545842
@ -44,7 +44,7 @@ import Database.Sqlite (SqliteException)
|
|||||||
import Web.PathPieces (toPathPiece)
|
import Web.PathPieces (toPathPiece)
|
||||||
import qualified Codec.Archive.Tar as Tar
|
import qualified Codec.Archive.Tar as Tar
|
||||||
import Database.Esqueleto.Internal.Language (From)
|
import Database.Esqueleto.Internal.Language (From)
|
||||||
import Text.Markdown (Markdown (..))
|
import Text.Markdown (markdown, msAddHeadingId, def)
|
||||||
import System.Directory (removeFile)
|
import System.Directory (removeFile)
|
||||||
import Stackage.Database.Haddock
|
import Stackage.Database.Haddock
|
||||||
import System.FilePath (takeBaseName, takeExtension)
|
import System.FilePath (takeBaseName, takeExtension)
|
||||||
@ -330,7 +330,9 @@ addPackage e =
|
|||||||
fp = Tar.entryPath e
|
fp = Tar.entryPath e
|
||||||
base = takeBaseName fp
|
base = takeBaseName fp
|
||||||
|
|
||||||
renderContent txt "markdown" = toHtml $ Markdown $ fromStrict txt
|
renderContent txt "markdown" = markdown
|
||||||
|
(def { msAddHeadingId = True })
|
||||||
|
(fromStrict txt)
|
||||||
renderContent txt "haddock" = renderHaddock txt
|
renderContent txt "haddock" = renderHaddock txt
|
||||||
renderContent txt _ = toHtml $ Textarea txt
|
renderContent txt _ = toHtml $ Textarea txt
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user