From cd1cc2a49d564021f6a8d733a6057b393b76866f Mon Sep 17 00:00:00 2001 From: andys8 Date: Sat, 20 Oct 2018 14:57:46 +0200 Subject: [PATCH] Links to operator code blocks The id of the code block will match the link's hash. Therefore the browser will jump to the correct section for direct links. Solves #286 --- src/frontend/Page/Docs/Block.elm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/Page/Docs/Block.elm b/src/frontend/Page/Docs/Block.elm index 04d72156..74d7a7bd 100644 --- a/src/frontend/Page/Docs/Block.elm +++ b/src/frontend/Page/Docs/Block.elm @@ -96,10 +96,13 @@ indentFour = viewBinop : Info -> Docs.Binop -> Html msg viewBinop info { name, comment, tipe } = let + nameInParens = + "(" ++ name ++ ")" + nameHtml = - toBoldLink info ("(" ++ name ++ ")") + toBoldLink info nameInParens in - viewCodeBlock name comment <| + viewCodeBlock nameInParens comment <| case toLines info Other tipe of One _ line -> [ nameHtml :: space :: colon :: space :: line ]