Open mudassir0909 opened 8 years ago
Just posting so I get notifications but will come back with a bigger reply.
This repo will be one of the biggest going into the new year.
I would love to see it spilt up a lot more potentially theme-utils-locale
, theme-utils-dates
etc
There also might be util libraries that aren't exactly theme
related, going to white board this out.
Excellent work here though. We should link it from all the theme doc pages asap.
The main purpose of this repository is to make the job easier for theme developers in transforming the resume object to suit their theme needs. The current implementation is pretty ad-hoc since all I did was just transfer this repository to jsonresume & I did not have a proper plan back then. So, the code in this repo is highly contextual to elegant's need. I want this to be generic so that any theme developer can use it to their benefits.
Following are the computations most theme developers do
resume.basics.location
objectprofile.username
&profile.network
I thought about how the api should look & here's what I propose. The theme developers pass the
resume
object toutils.transformResume
method which would emit out the transformedresume
object which they can directly plug into the template, this method would takeresume
as first argument &options
as second argument. So, in a nutshell the code to render a theme would look as follows:The
options
object structure will be similar to jsonresumeschema
, the keys remain the same but the value will be replaced with a transformer function which takes the input asresume[key]
, does the transformation & returns a value(If this sentence was confusing, I hope it'll be easier with an example below)We can move common transformers such as
profileTransformer
,pictureTransformer
etc under this repo so that developers can directly useutils.profilerTransformer
so that they can reuse the logic. Thoughts?