feat: improved formatting

This commit is contained in:
Nick 2024-11-16 00:26:41 -06:00
parent 833c6b5d94
commit 68b6a45d6c
3 changed files with 28 additions and 11 deletions

View file

@ -7,6 +7,7 @@
"elm-version": "0.19.1", "elm-version": "0.19.1",
"dependencies": { "dependencies": {
"direct": { "direct": {
"dillonkearns/elm-markdown": "7.0.1",
"elm/browser": "1.0.2", "elm/browser": "1.0.2",
"elm/core": "1.0.5", "elm/core": "1.0.5",
"elm/html": "1.0.0", "elm/html": "1.0.0",
@ -15,8 +16,11 @@
"mdgriffith/elm-ui": "1.1.8" "mdgriffith/elm-ui": "1.1.8"
}, },
"indirect": { "indirect": {
"elm/parser": "1.1.0",
"elm/regex": "1.0.0",
"elm/time": "1.0.0", "elm/time": "1.0.0",
"elm/virtual-dom": "1.0.3" "elm/virtual-dom": "1.0.3",
"rtfeldman/elm-hex": "1.0.0"
} }
}, },
"test-dependencies": { "test-dependencies": {

View file

@ -17,6 +17,15 @@ import View exposing (View)
makeDodge : Dodge -> Int -> Element msg makeDodge : Dodge -> Int -> Element msg
makeDodge dodgeEntry index = makeDodge dodgeEntry index =
let
formatProposition : String -> String
formatProposition proposition =
if proposition == "N/A" then
proposition
else
"\"" ++ proposition ++ "\""
in
column paragraphAlignLeft column paragraphAlignLeft
[ row (paragraphFormat ++ [ F.size 18 ]) [ row (paragraphFormat ++ [ F.size 18 ])
[ text " " [ text " "
@ -54,7 +63,7 @@ makeDodge dodgeEntry index =
[ column [ alignTop, width <| px 184 ] [ column [ alignTop, width <| px 184 ]
[ text " Proposition:" [ text " Proposition:"
] ]
, column [ width <| px 350, alignLeft ] [ paragraph [ F.regular ] [ text dodgeEntry.dodgeProposition ] ] , column [ width <| px 350, alignLeft ] [ paragraph [ F.regular ] [ text (formatProposition dodgeEntry.dodgeProposition) ] ]
] ]
, row (paragraphBoldFormat ++ [ width fill ]) , row (paragraphBoldFormat ++ [ width fill ])
[ column [ alignTop, width <| px 184 ] [ column [ alignTop, width <| px 184 ]

View file

@ -17,7 +17,7 @@ import View exposing (View)
argumentMaker : Argument -> Element msg argumentMaker : Argument -> Element msg
argumentMaker makeRowInput = argumentMaker argument =
let let
argRows : List (Element msg) argRows : List (Element msg)
argRows = argRows =
@ -57,20 +57,20 @@ argumentMaker makeRowInput =
] ]
) )
) )
makeRowInput.argumentFormalization argument.argumentFormalization
in in
column column
[ paragraphWidth, alignLeft, spacing 8, paddingEach { top = 0, right = 0, bottom = 60, left = 0 } ] [ paragraphWidth, alignLeft, spacing 8, paddingEach { top = 0, right = 0, bottom = 60, left = 0 } ]
[ paragraph (paragraphBoldFormat ++ [ F.size 20 ]) [ paragraph (paragraphBoldFormat ++ [ F.size 20 ])
[ text makeRowInput.argumentTitle |> el [ F.color colourTheme.nonHighlightedText, F.bold ] [ text argument.argumentTitle |> el [ F.color colourTheme.nonHighlightedText, F.bold ]
] ]
, paragraph (paragraphBoldFormat ++ [ F.size 18 ]) , paragraph (paragraphBoldFormat ++ [ F.size 18 ])
[ text "Proposition: " |> el [ F.color colourTheme.highlightText ] [ text "Proposition: " |> el [ F.color colourTheme.highlightText ]
, text makeRowInput.propositionTitle |> el [ F.color colourTheme.nonHighlightedText, F.regular ] , text argument.propositionTitle |> el [ F.color colourTheme.nonHighlightedText, F.regular ]
] ]
, paragraph (paragraphBoldFormat ++ [ F.size 18 ]) , paragraph (paragraphBoldFormat ++ [ F.size 18 ])
[ text "Summary: " |> el [ F.color colourTheme.highlightText ] [ text "Summary: " |> el [ F.color colourTheme.highlightText ]
, text makeRowInput.propositionSummary |> el [ F.color colourTheme.nonHighlightedText, F.regular ] , text argument.propositionSummary |> el [ F.color colourTheme.nonHighlightedText, F.regular ]
] ]
, wrappedRow (paragraphBoldFormat ++ [ alignLeft ]) , wrappedRow (paragraphBoldFormat ++ [ alignLeft ])
[ Element.table [ Element.table
@ -80,7 +80,7 @@ argumentMaker makeRowInput =
, D.color colourTheme.nonHighlightedDarkText , D.color colourTheme.nonHighlightedDarkText
, clip , clip
] ]
{ data = makeRowInput.definitionTable { data = argument.definitionTable
, columns = , columns =
[ { header = [ { header =
el el
@ -101,8 +101,9 @@ argumentMaker makeRowInput =
, padding 8 , padding 8
, Element.height fill , Element.height fill
] ]
[ text definition.definiendum [ row [ centerX ]
, row [ alignRight ] [ text ":=" ] [ paragraph [] [ text definition.definiendum ]
]
] ]
} }
, { header = , { header =
@ -124,7 +125,10 @@ argumentMaker makeRowInput =
, padding 8 , padding 8
, Element.height fill , Element.height fill
] ]
[ text definition.definiens ] [ row []
[ paragraph [] [ text definition.definiens ]
]
]
} }
] ]
} }