Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to type aliases #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 11 additions & 3 deletions src/frontend/Page/Docs/Block.elm
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,19 @@ type alias TypeNameDict =
makeInfo : String -> String -> Maybe V.Version -> String -> List Docs.Module -> Info
makeInfo author project version moduleName docsList =
let
addUnion home union docs =
Dict.insert (home ++ "." ++ union.name) (home, union.name) docs
addType home typeName docs =
Dict.insert (home ++ "." ++ typeName) ( home, typeName ) docs

addModule docs dict =
List.foldl (addUnion docs.name) dict docs.unions
let
types : List String
types =
List.concat
[ List.map .name docs.unions
, List.map .name docs.aliases
]
in
List.foldl (addType docs.name) dict types
in
Info author project version moduleName <|
List.foldl addModule Dict.empty docsList
Expand Down