char/cv
git clone https://git.t4t.associates/char/cv
fbadae1
main
1# let icon ( name , shift : 0.25em ) ={ 2box ( 3baseline : shift , 4height : 1.25em , 5image ( "icons/" + name + ".svg" , alt : name ) 6) 7h ( 0.35em ) 8} 9 10# let cv ( 11name : "" , 12tagline : "" , 13links : (), 14paper : "a4" , 15accent : rgb ( "#870c66" ), 16heading_font : "Inter" , 17body_font : "Inter" , 18mono_font : "TX-02" , 19doc , 20) = { 21set text ( size : 9pt , font : body_font , weight : "medium" ) 22set page ( paper , margin : ( x : 0.8cm , y : 0.8cm )) 23set par ( justify : true ) 24 25show raw : it => text ( size : 1.2em , font : mono_font , baseline : - 0.05em ) [# it ] 26 27show heading . where ( level : 1 ): it => text ( 28size : 1.6em , 29font : heading_font , 30tracking : 0.1pt , 31weight : "semibold" , 32block [ 33# { it . body } 34] 35) 36 37show heading . where ( level : 2 ): it => text ( 38fill : accent , 39font : heading_font , 40tracking : 0.1pt , 41weight : "bold" , 42size : 1.35em , 43[ 44# { it . body } 45# v ( - 0.85em ) 46# line ( length : 100% , stroke : 1pt + accent ) 47# v ( 0.2em ) 48] 49) 50 51show heading . where ( level : 3 ): it => text ( 52size : 1.2em , 53weight : "semibold" , 54block [# it ] 55) 56 57[ 58# grid ( 59columns : ( 1fr , 1fr ), 60gutter : 1em , 61{ 62[ = # name ] 6364 text ( 65font : body_font , 66size : 1em , 67block [# { tagline } ] 68) 69}, 70[ 71# box [ 72# h ( 4em ) 73# grid ( 74columns : 2 , 75gutter : 0.75em , 76.. links . map ( l => { 77[# h ( 2em ) ] 78link ( l . link ) [ 79# set text ( weight : "medium" ) 80# icon ( l . icon ) 81# if "text" in l . keys () { l . text } else { l . link } 82] 83}) 84) 85] 86] 87) 88] 89 90doc 91} 92 93# let divider ( accent : rgb ( "#870c66" )) = { 94v ( - 0.25em ) 95line ( length : 100% , stroke : ( paint : accent , thickness : 1pt , dash : "dotted" )) 96v ( - 0.25em ) 97} 98 99# let event ( 100accent : rgb ( "#870c66" ), company_newline : false , 101title , company , period , location 102) = [ 103# if company_newline { 104grid ( 105columns : ( auto , 1fr ), 106align : ( left + bottom , right + bottom ), 107box [ 108# text ( 1.2em , weight : "semibold" ) [# title ] \ 109# text ( 0.96em , fill : accent , weight : "bold" ) [ _ #[# company ] _ ] 110] , 111box [ 112# if period != [] { 113icon ( "calendar" , shift : 0.18em ) 114[ _ #[# period ] _ ] 115} \ 116# if location != [] { 117icon ( "location" ) 118location 119} 120] 121) 122 } else { 123grid ( 124columns : ( 1fr , auto ), 125align : ( left + top , right + top ), 126box ( text ( 1.2em , weight : "semibold" ) [# title ] ), 127box ( text ( 0.96em , fill : accent , weight : "bold" ) [ _ #[# company ] _ ] ) 128) 129130 v ( - 0.5em ) 131if period != [] { 132icon ( "calendar" , shift : 0.18em ) 133[ _ #[# period ] _ ] 134} 135h ( 1fr ) 136if location != [] { 137icon ( "location" ) 138location 139} 140} 141] 142 143# let article ( 144accent : rgb ( "#870c66" ), 145title : "" , date : "" , url : "" 146) = [ 147# par ( justify : false ) [ 148# text ( weight : "semibold" ) [ 149# text ( size : 1.2em ) [ " # title "] 150] \ 151# text ( size : 0.85em , style : "italic" , weight : "semibold" , tracking : - 0.025em ) [ 152# icon ( "calendar" , shift : 0.15em ) 153# h ( 0.1em ) 154# date 155] 156# h ( 0.75em ) 157# text ( size : 0.85em , style : "italic" , weight : "bold" , tracking : - 0.025em , fill : accent ) [ 158# icon ( "link" , shift : 0.25em ) 159# h ( - 0.25em ) 160# link ( "https://" + url ) [# url ] 161] 162] 163]