Closed badlydrawnrob closed 9 months ago
For now, I think this is an optional extra and can be added to a Child Theme if required. It could be somewhat useful to reference a number to a piece of code, but I think a better way is to strip the code back to it's absolute minimal that references the question we're asking. You could always link to a Github commit, or repo file and link to the line number like this.
Example of syntax for numbered lines
-- View -- view model = .. .. , div [ id "thumbnails" ] (List.map (viewThumbnail model.selectedUrl) -- Apply the function model.photos ) ..
-- Helper functions -- urlPrefix = "http://elm-in-action.com/"
viewThumbnail selectedUrl thumb = img [ src (urlPrefix ++ thumb.url) , classList [ ("selected", selectedUrl == thumb.url) ] .. ] []
-- Model -- { photos = [ { url = "1.jpeg" } -- Our list of urls , { url = "2.jpeg" } , { url = "3.jpeg" } ] , selectedUrl = "1.jpeg" -- Has the url been selected? }