Include inclusive/exclusive as part of guide

@snoyberg Hopefully this'll ensure nobody "misses" the difference
This commit is contained in:
Chris Done 2014-08-25 10:10:25 +02:00
parent 799a6a6211
commit b041979b64
2 changed files with 40 additions and 10 deletions

View File

@ -11,9 +11,13 @@ getStackageHomeR ident = do
return (stackage, user) return (stackage, user)
hasBundle <- storeExists $ SnapshotBundle ident hasBundle <- storeExists $ SnapshotBundle ident
let isInclusiveOrExclusive = let minclusive =
"inclusive" `isSuffixOf` stackageTitle stackage || if "inclusive" `isSuffixOf` stackageTitle stackage
"exclusive" `isSuffixOf` stackageTitle stackage then Just True
else if "exclusive" `isSuffixOf` stackageTitle stackage
then Just False
else Nothing
base = maybe 0 (const 1) minclusive :: Int
defaultLayout $ do defaultLayout $ do
setTitle $ toHtml $ stackageTitle stackage setTitle $ toHtml $ stackageTitle stackage
$(widgetFile "stackage-home") $(widgetFile "stackage-home")

View File

@ -1,11 +1,11 @@
$newline never $newline never
<div .container> <div .container>
<h1> <h1>
#{stackageTitle stackage} #{stackageTitle stackage}, inclusive
<p> <p>
Published on #{yearMonthDay (stackageUploaded stackage)} Published on #{yearMonthDay (stackageUploaded stackage)}
<span .separator> $if hasBundle
$if True <span .separator>
<span> <span>
<a href=@{StackageMetadataR ident} title="View metadata on this snapshot, such as package versions"> <a href=@{StackageMetadataR ident} title="View metadata on this snapshot, such as package versions">
\Metadata \Metadata
@ -16,7 +16,7 @@ $newline never
<p> <p>
<pre> <pre>
remote-repo: stackage:@{StackageHomeR ident} remote-repo: stackage:@{StackageHomeR ident}
$if isInclusiveOrExclusive $maybe _ <- minclusive
<p> <p>
<a href="https://github.com/fpco/stackage/wiki/Stackage-Server-FAQ#whats-the-difference-between-inclusive-and-exclusive-snapshots">What's the difference between inclusive and exclusive snapshots?</a> <a href="https://github.com/fpco/stackage/wiki/Stackage-Server-FAQ#whats-the-difference-between-inclusive-and-exclusive-snapshots">What's the difference between inclusive and exclusive snapshots?</a>
<h3> <h3>
@ -25,10 +25,36 @@ $newline never
(click to expand) (click to expand)
<div class="accordion" id="accordion2"> <div class="accordion" id="accordion2">
$maybe inclusive <- minclusive
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse1">
<span .number>#{base + 0}
Check whether you want an inclusive or exclusive snapshot
<div id="collapse1" class="accordion-body collapse">
<div class="accordion-inner">
<p>
This snapshot is: #
<strong>
$if inclusive
inclusive
$else
exclusive
<p>
$if inclusive
This means that it contains packages from Hackage too,
\ which are not guaranteed to build.
$if not inclusive
This means that it contains only packages that build
\ and have been tested (excludes packages from Hackage
\ that <em>may</em> or may not build.
<p>
For a detailed explanation of the differences and reasons for inclusive and exclusive snapshots, see <a href="https://github.com/fpco/stackage/wiki/Stackage-Server-FAQ#whats-the-difference-between-inclusive-and-exclusive-snapshots">the FAQ on this topic</a>.
<div class="accordion-group"> <div class="accordion-group">
<div class="accordion-heading"> <div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse1"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse1">
<span .number>1 <span .number>#{base + 1}
Copy the Copy the
<code>remote-repo <code>remote-repo
line to your Cabal configuration file line to your Cabal configuration file
@ -56,7 +82,7 @@ $newline never
<div class="accordion-group"> <div class="accordion-group">
<div class="accordion-heading"> <div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse2"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse2">
<span .number>2 <span .number>#{base + 2}
Remove any existing package config Remove any existing package config
<div id="collapse2" class="accordion-body collapse"> <div id="collapse2" class="accordion-body collapse">
<div class="accordion-inner"> <div class="accordion-inner">
@ -93,7 +119,7 @@ $newline never
<div class="accordion-group"> <div class="accordion-group">
<div class="accordion-heading"> <div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion3" href="#collapse3"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion3" href="#collapse3">
<span .number>3 <span .number>#{base + 3}
Run Run
<code> <code>
cabal update cabal update