diff --git a/build/Vita.hs b/build/Vita.hs index f7fb4eb..e0f8476 100644 --- a/build/Vita.hs +++ b/build/Vita.hs @@ -27,7 +27,7 @@ module Vita import Data.Aeson (FromJSON (..), Object, Value (..), withObject, (.:), (.:?), (.!=)) import Data.Aeson.Types (Parser, typeMismatch) import Data.Char (toLower) -import Data.List (isPrefixOf, sortOn) +import Data.List (intercalate, isPrefixOf, sortOn) import Data.Maybe (mapMaybe) import Data.Scientific (isInteger, toRealFloat) import qualified Data.Aeson.Key as K @@ -360,22 +360,48 @@ rewriteCmd2 name f = go dateRange :: String -> Maybe String -> String dateRange s me = tex s ++ maybe "" (\e -> " – " ++ tex e) me --- | The grey line under an entry heading: dates, then location if present. -metaLine :: String -> Maybe String -> Maybe String -> String -metaLine dates mloc murl = concat - [ "
" +-- | Title and date on one baseline, title left and date flush right — the +-- layout item-card.css already establishes for every other list on the +-- site. An earlier version stacked the date on its own line below the +-- title, which read as a stray indented fragment: @#markdownBody p + p@ +-- applies the essay prose indent of 1.5em to consecutive paragraphs, and a +-- date is not prose. +-- +-- Dates stay in a @span@ rather than a @time@ element on purpose. Half of +-- them are "Fall 2024", "expected 2028", "Present" — no valid @datetime@ +-- value exists for those, and a @time@ without one is worse than no @time@. +headerRow :: String -> String -> String +headerRow titleHtml dates = concat + [ "" ++ lead ++ trailing ++ "
" + where + parts = maybe [] (pure . tex) mrole ++ extras + lead = head parts + rest = tail parts + trailing + | null rest = "" + | otherwise = " · " + ++ intercalate " · " rest + ++ "" + +-- | A location, linked when the entry gives a URL for it. +locationPart :: Maybe String -> Maybe String -> [String] +locationPart Nothing _ = [] +locationPart (Just loc) murl = pure $ case murl of + Just u -> "" ++ tex loc ++ "" + Nothing -> tex loc + -- | Link chips. The affordance the print CV cannot offer: every artifact one -- click away, rather than a bracketed label the reader has to retype. renderLinks :: [Link] -> String @@ -425,11 +451,11 @@ renderEducation es one e = concat [ "", tex (edDegree e) - , maybe "" (\g -> " · GPA " ++ tex g ++ "") (edGpa e) - , "
" - , metaLine (dateRange (edStart e) (edEnd e)) (edLocation e) Nothing + , headerRow (tex (edInstitution e)) (dateRange (edStart e) (edEnd e)) + , subLine (Just (edDegree e)) + ( maybe [] (\g -> ["GPA " ++ tex g]) (edGpa e) + ++ locationPart (edLocation e) Nothing + ) , maybe "" (\n -> "" ++ tex n ++ "
") (edNotes e) , "", tex (pbVenue p) , maybe "" (\t -> " " ++ tex t) (pbTarget p) , "
" ] Just t -> concat - [ "", tex (pbVenue p), "
" ] - , "" , renderLinks (pbLinks p) , "" , "" @@ -489,14 +514,12 @@ renderPresentations ps one p = concat [ "" , maybe "" (\k -> tex k ++ ", ") (prKind p) , tex (prVenue p) - , "
" - , "" , "" ++ tex r ++ "
") (exRole e) - , metaLine (dateRange (exStart e) (exEnd e)) (exLocation e) (exLocUrl e) + , headerRow (tex (exOrg e)) (dateRange (exStart e) (exEnd e)) + , subLine (exRole e) (locationPart (exLocation e) (exLocUrl e)) , maybe "" (\p -> "" ++ tex p ++ "
") (exPreamble e) , renderBullets (exBullets e) , "", tex (pjDescription p), "
" , renderLinks (pjLinks p) , "