Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Haskell tooling emits a variety of errors, warnings, and other messages. In rece

Today, the Haskell Message Index supports three tools. Any user-facing Haskell-related programming tools are welcome to join the effort!

| Tool | Earliest supported version | Namespace |
|-------|----------------------------|-----------|
| GHC | 9.6.1 | `GHC-` |
| Stack | 2.9.3 | `S-` |
| GHCup | 0.1.19.0 | `GHCup-` |
| Cabal | 3.12 | `Cabal-` |
| Tool | Earliest supported version | Namespace | Link to subpage |
|-------|----------------------------|-----------|-----------------|
| GHC | 9.6.1 | `GHC-` | [/ghc](https://errors.haskell.org/ghc) |
| Stack | 2.9.3 | `S-` | [/stack](https://errors.haskell.org/stack) |
| GHCup | 0.1.19.0 | `GHCup-` | [/ghcup](https://errors.haskell.org/ghcup) |
| Cabal | 3.12 | `Cabal-` | [/cabal](https://errors.haskell.org/cabal) |

## Contributing to the Message Index

Expand Down
27 changes: 27 additions & 0 deletions message-index/cabal/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: The Haskell Error Index | Cabal
---

<h2>Welcome</h2>

<p>
This site describes error messages that can be returned by <a href="https://www.haskell.org/cabal/">Cabal</a>, 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.
</p>

<p>
So far, $messageCount$ Cabal errors and warnings are documented here.
If you encounter a message that is not yet documented, please
<a href="https://github.com/haskellfoundation/error-message-index/issues">open an issue</a> or
<a href="https://github.com/haskellfoundation/error-message-index/pulls">submit a pull request with documentation</a>.
Pull requests with additional examples and improved explanations for
existing messages are also very welcome, as are
<a href="https://github.com/haskellfoundation/error-message-index/issues?q=is%3Aissue+is%3Aopen+label%3Acss">improvements to the generated site</a>.
</p>

<p>
This site is a project of <a href="https://haskell.foundation" target="_blank" rel="noopener noreferrer">The Haskell Foundation</a>.
Please <a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">get in touch</a> if you have feedback or if you'd like to get involved!
</p>

$partial("templates/messages.html")$
27 changes: 27 additions & 0 deletions message-index/ghc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: The Haskell Error Index | GHC
---

<h2>Welcome</h2>

<p>
This site describes error messages that can be returned by <a href="https://www.haskell.org/ghc/">GHC</a>, 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.
</p>

<p>
So far, $messageCount$ GHC errors and warnings are documented here.
If you encounter a message that is not yet documented, please
<a href="https://github.com/haskellfoundation/error-message-index/issues">open an issue</a> or
<a href="https://github.com/haskellfoundation/error-message-index/pulls">submit a pull request with documentation</a>.
Pull requests with additional examples and improved explanations for
existing messages are also very welcome, as are
<a href="https://github.com/haskellfoundation/error-message-index/issues?q=is%3Aissue+is%3Aopen+label%3Acss">improvements to the generated site</a>.
</p>

<p>
This site is a project of <a href="https://haskell.foundation" target="_blank" rel="noopener noreferrer">The Haskell Foundation</a>.
Please <a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">get in touch</a> if you have feedback or if you'd like to get involved!
</p>

$partial("templates/messages.html")$
27 changes: 27 additions & 0 deletions message-index/ghcup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: The Haskell Error Index | GHCup
---

<h2>Welcome</h2>

<p>
This site describes error messages that can be returned by <a href="https://www.haskell.org/ghcup/">GHCup</a>, 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.
</p>

<p>
So far, $messageCount$ GHCup errors and warnings are documented here.
If you encounter a message that is not yet documented, please
<a href="https://github.com/haskellfoundation/error-message-index/issues">open an issue</a> or
<a href="https://github.com/haskellfoundation/error-message-index/pulls">submit a pull request with documentation</a>.
Pull requests with additional examples and improved explanations for
existing messages are also very welcome, as are
<a href="https://github.com/haskellfoundation/error-message-index/issues?q=is%3Aissue+is%3Aopen+label%3Acss">improvements to the generated site</a>.
</p>

<p>
This site is a project of <a href="https://haskell.foundation" target="_blank" rel="noopener noreferrer">The Haskell Foundation</a>.
Please <a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">get in touch</a> if you have feedback or if you'd like to get involved!
</p>

$partial("templates/messages.html")$
47 changes: 1 addition & 46 deletions message-index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ <h2>Welcome</h2>
These codes can be looked up below for further information.
</p>

<p>
Other Haskell-related tools are welcome to add their own messages to the index. Please contact
<a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">the Haskell Foundation</a>
or <a href="https://github.com/haskellfoundation/error-message-index/issues">open an issue</a>
to begin the process.
</p>

<p>
So far, $messageCount$ errors and warnings are documented here.
If you encounter a message that is not yet documented, please
Expand All @@ -34,42 +27,4 @@ <h2>Welcome</h2>
Please <a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">get in touch</a> if you have feedback or if you'd like to get involved!
</p>

<h2>The Messages</h2>

<script src="/js/tablefilter.js"></script>

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

<script>
var filtersConfig = {
base_path: '/wrong-on-purpose/',
auto_filter: {
delay: 75 //milliseconds
},
single_filter: true
};
var tf = new TableFilter(document.querySelector('.message-list'), filtersConfig);
tf.init();

var input = document.querySelector('.single_flt');

if (input) {
input.setAttribute("placeholder", "🔍 Type here to filter ...");
input.focus();

//Autofill the search from the URL
let url = new URL(document.location.href);
let query = url.searchParams.get('q');
if(query !== null)
{
input.setAttribute('value',query)
//Move cursor to end
input.setSelectionRange(query.length,query.length);

//Make sure that the list gets filtered as if the query had been typed manually
input.dispatchEvent(new KeyboardEvent('keyup'));

}
}

</script>
$partial("templates/messages.html")$
41 changes: 24 additions & 17 deletions message-index/site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
27 changes: 27 additions & 0 deletions message-index/stack/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: The Haskell Error Index | Stack
---

<h2>Welcome</h2>

<p>
This site describes error messages that can be returned by <a href="https://docs.haskellstack.org/en/stable/">Stack</a>, 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.
</p>

<p>
So far, $messageCount$ Stack errors and warnings are documented here.
If you encounter a message that is not yet documented, please
<a href="https://github.com/haskellfoundation/error-message-index/issues">open an issue</a> or
<a href="https://github.com/haskellfoundation/error-message-index/pulls">submit a pull request with documentation</a>.
Pull requests with additional examples and improved explanations for
existing messages are also very welcome, as are
<a href="https://github.com/haskellfoundation/error-message-index/issues?q=is%3Aissue+is%3Aopen+label%3Acss">improvements to the generated site</a>.
</p>

<p>
This site is a project of <a href="https://haskell.foundation" target="_blank" rel="noopener noreferrer">The Haskell Foundation</a>.
Please <a href="https://haskell.foundation/contact/" target="_blank" rel="noopener noreferrer">get in touch</a> if you have feedback or if you'd like to get involved!
</p>

$partial("templates/messages.html")$
39 changes: 38 additions & 1 deletion message-index/templates/messages.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
$body$
<h2>The Messages</h2>

<script src="/js/tablefilter.js"></script>

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

<script>
var filtersConfig = {
base_path: '/wrong-on-purpose/',
auto_filter: {
delay: 75 //milliseconds
},
single_filter: true
};
var tf = new TableFilter(document.querySelector('.message-list'), filtersConfig);
tf.init();

var input = document.querySelector('.single_flt');

if (input) {
input.setAttribute("placeholder", "🔍 Type here to filter ...");
input.focus();

//Autofill the search from the URL
let url = new URL(document.location.href);
let query = url.searchParams.get('q');
if(query !== null)
{
input.setAttribute('value',query)
//Move cursor to end
input.setSelectionRange(query.length,query.length);

//Make sure that the list gets filtered as if the query had been typed manually
input.dispatchEvent(new KeyboardEvent('keyup'));

}
}

</script>
Loading