mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-28 18:24:04 +03:00
Adds link to the package site based on the module name
This commit is contained in:
parent
585ce8aece
commit
1db134067a
@ -142,15 +142,26 @@ view showFocusLink { name, content } =
|
|||||||
[]
|
[]
|
||||||
[ Html.text name ]
|
[ Html.text name ]
|
||||||
, if showFocusLink then
|
, if showFocusLink then
|
||||||
Html.a
|
viewLink "see only this" ("#doodad/" ++ name)
|
||||||
[ Attributes.href <| "#doodad/" ++ name ]
|
|
||||||
[ Html.text "see only this" ]
|
|
||||||
|
|
||||||
else
|
else
|
||||||
Html.text ""
|
Html.text ""
|
||||||
|
, String.replace "." "-" name
|
||||||
|
|> (++) "https://package.elm-lang.org/packages/NoRedInk/noredink-ui/latest/"
|
||||||
|
|> viewLink "view docs"
|
||||||
]
|
]
|
||||||
, Html.styled Html.div
|
, Html.styled Html.div
|
||||||
[ padding2 (px 20) zero ]
|
[ padding2 (px 20) zero ]
|
||||||
[]
|
[]
|
||||||
content
|
content
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
viewLink : String -> String -> Html msg
|
||||||
|
viewLink text href =
|
||||||
|
Html.a
|
||||||
|
[ Attributes.href href
|
||||||
|
, Attributes.css [ Css.display Css.block ]
|
||||||
|
]
|
||||||
|
[ Html.text text
|
||||||
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user