Compare commits

...

2 Commits

Author SHA1 Message Date
Julien Marquet 7eece79b0e Isolate elm output files 3 years ago
Julien Marquet 6608bceeb5 Added links to source 3 years ago
  1. 2
      .gitignore
  2. 11
      src/ServicesTable.elm
  3. 6379
      src/main.js
  4. 7
      ssg/src/Main.hs

2
.gitignore vendored

@ -1,5 +1,7 @@
.direnv
ssg/dist-newstyle
src/_cache
src/_site
src/elm-stuff
src/_elm
result

11
src/ServicesTable.elm

@ -4,12 +4,14 @@ module ServicesTable exposing (main)
import List
import String exposing (fromInt)
import Browser
import Html exposing (Html, div, span, text, table, thead, tbody, tr, th, td)
import Html.Attributes exposing (class)
import Html exposing (Html, div, span, text, a, table, thead, tbody, tr, th, td)
import Html.Attributes exposing (class, href)
import Http
import Dict exposing (Dict)
import Json.Decode exposing (Decoder, map, map3, field, list, string, dict, keyValuePairs)
pinnedCommit = "2a5f9fcde65629554f39d683db02a98a6c054756"
type alias ServiceInfo =
{ fields : List String
, tests : List String
@ -98,9 +100,12 @@ renderTable info = table [ class "services-table", class "table-header-rotated"
[ thead [ class "info-thead" ] [ headers ]
, tbody [] (List.indexedMap renderLine info) ]
mkSourceLink : String -> Html Msg
mkSourceLink mod = a [ href <| "https://github.com/NixOS/nixpkgs/blob/" ++ pinnedCommit ++ String.dropLeft 7 mod ] [ text mod ]
renderLine : Int -> { name : String, fields : List String, tests : List String, mod : String } -> Html Msg
renderLine i {name, fields, tests, mod} = tr []
<| [ th [] [ text mod ], th [] [ text <| fromInt i ], th [] [ text name ] ]
<| [ th [] [ mkSourceLink mod ], th [] [ text <| fromInt i ], th [] [ text name ] ]
++ (List.map (\b -> td [class (if b then "cell-good" else "cell-bad")] [text (if b then "" else "")])
<| List.map (\field -> not <| List.member field fields) watchedFields)

6379
src/main.js

File diff suppressed because it is too large Load Diff

7
ssg/src/Main.hs

@ -27,5 +27,10 @@ main = do
match "*.elm" $ do
route $ setExtension "js"
compile $ execCompilerWith (execName "elm") [ProcArg "make", HakFilePath, ProcArg "--output=main.js"] (COutFile $ SpecificPath "main.js")
compile $ execCompilerWith (execName "elm")
[ ProcArg "make"
, HakFilePath
, ProcArg "--optimize"
, ProcArg "--output=_elm/main.js" ]
(COutFile $ SpecificPath "_elm/main.js")

Loading…
Cancel
Save