diff --git a/message-index/cabal/index.html b/message-index/cabal/index.html new file mode 100644 index 00000000..40109ef5 --- /dev/null +++ b/message-index/cabal/index.html @@ -0,0 +1,27 @@ +--- +title: The Haskell Error Index | Cabal +--- + +

Welcome

+ +

+ This site describes error messages that can be returned by Cabal, including both errors and warnings. + Every error and warning has a code that Cabal emits when you run into it—you can look them up below. +

+ +

+ So far, $messageCount$ Cabal errors and warnings are documented here. + If you encounter a message that is not yet documented, please + open an issue or + submit a pull request with documentation. + Pull requests with additional examples and improved explanations for + existing messages are also very welcome, as are + improvements to the generated site. +

+ +

+This site is a project of The Haskell Foundation. +Please get in touch if you have feedback or if you'd like to get involved! +

+ +$partial("templates/messages.html")$ diff --git a/message-index/ghc/index.html b/message-index/ghc/index.html new file mode 100644 index 00000000..355b123b --- /dev/null +++ b/message-index/ghc/index.html @@ -0,0 +1,27 @@ +--- +title: The Haskell Error Index | GHC +--- + +

Welcome

+ +

+ This site describes error messages that can be returned by GHC, including both errors and warnings. + Every error and warning has a code that GHC emits when you run into it—you can look them up below. +

+ +

+ So far, $messageCount$ GHC errors and warnings are documented here. + If you encounter a message that is not yet documented, please + open an issue or + submit a pull request with documentation. + Pull requests with additional examples and improved explanations for + existing messages are also very welcome, as are + improvements to the generated site. +

+ +

+This site is a project of The Haskell Foundation. +Please get in touch if you have feedback or if you'd like to get involved! +

+ +$partial("templates/messages.html")$ diff --git a/message-index/ghcup/index.html b/message-index/ghcup/index.html new file mode 100644 index 00000000..7820343d --- /dev/null +++ b/message-index/ghcup/index.html @@ -0,0 +1,27 @@ +--- +title: The Haskell Error Index | GHCup +--- + +

Welcome

+ +

+ This site describes error messages that can be returned by GHCup, including both errors and warnings. + Every error and warning has a code that GHCup emits when you run into it—you can look them up below. +

+ +

+ So far, $messageCount$ GHCup errors and warnings are documented here. + If you encounter a message that is not yet documented, please + open an issue or + submit a pull request with documentation. + Pull requests with additional examples and improved explanations for + existing messages are also very welcome, as are + improvements to the generated site. +

+ +

+This site is a project of The Haskell Foundation. +Please get in touch if you have feedback or if you'd like to get involved! +

+ +$partial("templates/messages.html")$ diff --git a/message-index/index.html b/message-index/index.html index 792ea64c..146623f3 100644 --- a/message-index/index.html +++ b/message-index/index.html @@ -11,13 +11,6 @@

Welcome

These codes can be looked up below for further information.

-

- Other Haskell-related tools are welcome to add their own messages to the index. Please contact - the Haskell Foundation - or open an issue - to begin the process. -

-

So far, $messageCount$ errors and warnings are documented here. If you encounter a message that is not yet documented, please @@ -34,42 +27,4 @@

Welcome

Please get in touch if you have feedback or if you'd like to get involved!

-

The Messages

- - - -$partial("templates/message-list.html")$ - - +$partial("templates/messages.html")$ \ No newline at end of file diff --git a/message-index/site.hs b/message-index/site.hs index 422b059f..0f97e01c 100644 --- a/message-index/site.hs +++ b/message-index/site.hs @@ -119,23 +119,11 @@ main = hakyll $ do >>= applyAsTemplate ctx >>= loadAndApplyTemplate "templates/default.html" ctx - match "index.html" $ do - route idRoute - compile $ do - messages <- loadAll ("messages/*/index.md" .&&. hasNoVersion) - let bread = breadcrumbCtx [] - indexCtx = - mconcat - [ listField "messages" (messageCtx <> defaultContext) (pure messages), - bread, - constField "messageCount" (show (length messages)), - defaultContext - ] - - getResourceBody - >>= applyAsTemplate indexCtx - >>= loadAndApplyTemplate "templates/default.html" indexCtx - >>= relativizeUrls + match "index.html" $ compileFilteredIndex "" + match "cabal/index.html" $ compileFilteredIndex "Cabal-" + match "ghc/index.html" $ compileFilteredIndex "GHC-" + match "ghcup/index.html" $ compileFilteredIndex "GHCup-" + match "stack/index.html" $ compileFilteredIndex "S-" -- Needed for flagInfo below match "warning-sets/warning-sets-9.5.txt" $ do @@ -185,6 +173,25 @@ main = hakyll $ do -------------------------------------------------------------------------------- +compileFilteredIndex :: String -> Rules () +compileFilteredIndex prefix = do + route idRoute + compile $ do + messages <- loadAll (fromGlob ("messages/" <> prefix <> "*/index.md") .&&. hasNoVersion ) + let bread = breadcrumbCtx [] + indexCtx = + mconcat + [ listField "messages" (messageCtx <> defaultContext) (pure messages), + bread, + constField "messageCount" (show (length messages)), + defaultContext + ] + + getResourceBody + >>= applyAsTemplate indexCtx + >>= loadAndApplyTemplate "templates/default.html" indexCtx + >>= relativizeUrls + -- | The file extensions to be shown in example lists exampleExtensions :: NonEmpty String exampleExtensions = "hs" :| ["yaml", "cabal"] diff --git a/message-index/stack/index.html b/message-index/stack/index.html new file mode 100644 index 00000000..792db5e6 --- /dev/null +++ b/message-index/stack/index.html @@ -0,0 +1,27 @@ +--- +title: The Haskell Error Index | Stack +--- + +

Welcome

+ +

+ This site describes error messages that can be returned by Stack, including both errors and warnings. + Every error and warning has a code that Stack emits when you run into it—you can look them up below. +

+ +

+ So far, $messageCount$ Stack errors and warnings are documented here. + If you encounter a message that is not yet documented, please + open an issue or + submit a pull request with documentation. + Pull requests with additional examples and improved explanations for + existing messages are also very welcome, as are + improvements to the generated site. +

+ +

+This site is a project of The Haskell Foundation. +Please get in touch if you have feedback or if you'd like to get involved! +

+ +$partial("templates/messages.html")$ diff --git a/message-index/templates/messages.html b/message-index/templates/messages.html index 1e4dc918..aaeba762 100644 --- a/message-index/templates/messages.html +++ b/message-index/templates/messages.html @@ -1,2 +1,39 @@ -$body$ +

The Messages

+ + + $partial("templates/message-list.html")$ + +