Skip to content

Commit

Permalink
Merge pull request #1308 from haskell/janus/tested-with
Browse files Browse the repository at this point in the history
Add Tested-With to package page
  • Loading branch information
ysangkok authored Apr 17, 2024
2 parents 19b4737 + 7c8b019 commit 88de93c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions datafiles/templates/Html/package-page.html.st
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@
<td>$package.buildDepends$</td>
</tr>

$if(package.optional.hasTestedWith)$
<tr>
<th>Tested with</th>
<td class="word-wrap">
$package.optional.testedWith$
</td>
</tr>
$endif$

<tr>
<th>License</th>
<td class="word-wrap">$package.license$</td>
Expand Down
12 changes: 11 additions & 1 deletion src/Distribution/Server/Pages/PackageFromTemplate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Text.XHtml.Strict hiding (p, name, title, content)
import qualified Text.XHtml.Strict as XHtml

import Data.Maybe (maybeToList, fromMaybe, isJust)
import Data.List (intersperse)
import Data.List (intercalate, intersperse)
import System.FilePath.Posix ((</>), takeFileName, dropTrailingPathSeparator)
import Data.Time.Format (defaultTimeLocale, formatTime)

Expand Down Expand Up @@ -228,6 +228,12 @@ packagePageTemplate render
(vList $ map sourceRepositoryToHtml (sourceRepos desc))
] ++

[ templateVal "hasTestedWith"
(not $ null pkgTestedWith)
, templateVal "testedWith"
(intercalate ", " pkgTestedWith)
] ++

[ templateVal "hasSynopsis"
(not . Short.null $ synopsis (rendOther render))
, templateVal "synopsis"
Expand All @@ -238,6 +244,10 @@ packagePageTemplate render
pkgid = rendPkgId render
pkgVer = display $ pkgVersion pkgid
pkgName = display $ packageName pkgid
pkgTestedWith =
[ display compilerFlavor ++ " " ++ display versionRange
| (compilerFlavor, versionRange) <- testedWith desc
]

desc = rendOther render

Expand Down

0 comments on commit 88de93c

Please sign in to comment.