haskell / haskell/vscode-haskell-syntax-highlighting

Highlighting for haddocks

Open
#142 7 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
109
Forks
51
Avg merge
3d 8h
Merged PRs (30d)
2

Description

As per the [haddock documentation](https://haskell-haddock.readthedocs.io/en/latest/markup.html), Haskell code can appear in Haddock comments in the following ways:

```haskell
-- code blocks:
-- @
-- f :: a -> a
-- f a = a
-- @
--
-- bird tracks:
-- > f 12
--
-- REPL examples:
-- >>> f 12
```

There are also delimiters for LaTeX: ` \( ... \)` (inline equation) and ` \[ ... \]` (displayed equation).

It would be nice if highlighting could be enabled for those cases.

Some other extra highlighting that could be done:

- headings with `=` `==` `===`, ...
- named chunks `$chunkname`
- `*bold*` and `/italics/`
- `@since` annotations
- URLs (VS Code automatically makes URLs clickable)

I think we could have a special haddock grammar file that we could include in the main Haskell grammar for Haddock comments.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.