dmy / elm-doc-preview

Elm offline documentation previewer

Home Page:https://www.npmjs.com/package/elm-doc-preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a warning for markdown links starting by / as they won't work in final documentation

rlefevre opened this issue · comments

Links added in some markdown as [Module](/Module) won't work in the final documentation because they will point to https://package.elm-lang.org/Module instead of https://package.elm-lang.org/packages/author/package/Module but they will work in the preview as the module is the only path segment there.

The correct way to link to another module that will work in both the final documentation and the preview is to use:

  • [Module](Module)
  • or [Module](./Module) to avoid elm-format bug avh4/elm-format#339 (comment)
  • or [Module.function](Module#function)
  • or [Module.SubModule.function](Module-SubModule#function)

A warning should be added when clicking such broken links in the preview to allow the editor to fix them.

Version 3.0.0-rc1 and later uses exactly the same URL scheme that package.elm-lang.org, so errors should not be possible anymore.