jfmengels / elm-review-documentation

Provides elm-review rules to help with the quality and correctness of your Elm project's documentation
https://package.elm-lang.org/packages/jfmengels/elm-review-documentation/latest/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

New rule: Report what looks like a title but isn't #11

Open jfmengels opened 3 years ago

jfmengels commented 3 years ago

What the rule should do:

Report when (module/function/type) documentation contains what looks like a title but isn't.

What problems does it solve:

Fixes a Markdown issue that can surprise documentation authors.

Example of things the rule would report:

module A exposing (..)
{-|

#Title

-}

a = 1

Here's an example of the result: https://package.elm-lang.org/packages/stil4m/elm-syntax/7.2.6/Elm-Syntax-Infix (#Types)

Multiplying the number of #'s

Example of things the rule would not report:

module A exposing (..)
{-|

# Title

-}

a = 1

When (not) to enable this rule:

This can probably have some false positives, if authors genuinely want to start a line with #.

I am looking for:

(cc @dillonkearns who might know some of the answers)

lue-bird commented 3 years ago
dillonkearns commented 3 years ago

You might find markdownlint to be a useful reference here as well. I actually use markdownlint in VS Code and find it helpful for things like making sure heading levels don't skip a level.

https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md