Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moderncv.sty binding #924

Merged
merged 8 commits into from
Apr 16, 2018
Merged

moderncv.sty binding #924

merged 8 commits into from
Apr 16, 2018

Conversation

dginev
Copy link
Collaborator

@dginev dginev commented Jan 9, 2018

Finally making progress on my promise in #200 and starting to generalize my personal CV binding sketch towards supporting all of moderncv.sty.

Would like some feedback on what may be the sane approach to deal with the special CV styling however - a bit more concretely now that I have a first test CV and attached PDF and HTML files to compare. I "chickenized" my own CV as a first test, it is not an exhaustive one by any means and I should add at least one of the official templates to ensure the coverage makes some sense.

There's also the open question of allowing to use the various \moderncvtheme definitions, maybe a native read-in of the TeX could get more of that auto-ingested?

In any case, this PR contains the working setup from my private website (responsible for my cv ), and should be a good starting point to adding support for CVs. Feedback more than welcome!

@dginev
Copy link
Collaborator Author

dginev commented Jan 9, 2018

I'm also wondering if the RequireResource command can be / could be enhanced to be used with remote resources, since the only way to get the well-looking HTML output right now is to convert with this extensive invocation:

latexmlc t/moderncv/cs_cv.tex --dest=t/moderncv/cs_cv.html \
   --stylesheet=LaTeXML-CV.xsl \
   --css="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" \
   --css="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css" \
   --javascript="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"

@brucemiller
Copy link
Owner

I Like it! Well, the results, anyway. I'm not so convinced about the need for the XSLT; that it's even necessarily CV specific, or maybe about what it exactly does. It seems that it could be handled more generically in the standard structure stylesheet, possibly with appropriate css (maybe hiding some of the output by default?).

@dginev
Copy link
Collaborator Author

dginev commented Apr 5, 2018

I double-checked with a friend who is a CTO of a job-application company, in which "CV imports" are a fundamental acquisition channel, and indeed they are working entirely with PDF and Word files. To the best of her knowledge there is no HTML standard for CVs in wide use today, and no one is really using HTML as a CV import channel for them.

Or in other words, we are "free to innovate" with the HTML target for this PR.

I was actually looking for an easy out, so that I just adopt some "CV standard" for HTML, but it seems we'd have to invent something like one. Will be back to this issue soon.

@dginev
Copy link
Collaborator Author

dginev commented Apr 5, 2018

This ties into your XSLT comment - the stylesheet applies the Bootstrap class markup, as an add-on that is entirely HTML-specific and does not belong in the binding files.

The big problem remains that Bootstrap is not a latexml CSS requirement, and it really shouldn't be. I should up my CSS game and find a solution that is native, instead of requiring a new framework. Then the XSLT can go away and only use the CSS file.

@dginev
Copy link
Collaborator Author

dginev commented Apr 5, 2018

I've heard (only) great things about flexbox, modern Bootstrap is based on it, and it looks like flexbox grids are simple to code in CSS (random tutorial here)

So I will take a stab at reworking what I have to pure flexbox

@brucemiller
Copy link
Owner

Yeah, flex has crept into the stock LaTeXML css, too :>

And, yeah, we don't want to build in assumptions about css or js frameworks, they come & go so often, and folks have their own preferences. OTOH, waving hands, it would be nice if we could more easily enable the use of random frameworks.

It seems the common way of applying these frameworks is to add specific classes from the framework onto your html markup, which then gets whatever properties & behaviour of the kit. So (waving hands more franticly) that it wouldn't be hard to develop a simple tool to that used either css selectors or xpath (either on the latexml xml or html) and added the appropriate css class to the matching items.
(and in fact sorta seems like something CSS should have done in the first place; ie. a certain selector inherits all the properties of some other class).

@dginev
Copy link
Collaborator Author

dginev commented Apr 5, 2018

Hm, sounds handy, but maybe that is premature abstraction at this point? Since we haven't had the need for external frameworks yet, and it is very hard to predict the future...

Should I postpone my flexbox rewrite here, or you think that sounds good for now?

@brucemiller
Copy link
Owner

brucemiller commented Apr 5, 2018 via email

@brucemiller
Copy link
Owner

Since I just merged TagsNTitles, you'll probably have to remake your test case (don't think anything else would be affected).

@dginev
Copy link
Collaborator Author

dginev commented Apr 10, 2018

Trying to reconcile with the main stylesheet, I decided it may be convenient to just have a ltx:creator element with role cv, which will anchor my xslt rules.

I'm a bit confused by the frontmatter macro machinery, as the metadata macros (such as \firstname, \familyname etc) have no fixed order, I am unsure what is the best way to create the parent creator element early enough.

For now I just added this to the binding which does the trick (as it executes on package load) but it feels... hacky?

RawTeX('\@add@frontmatter{ltx:creator}[role=cv]{}');

@dginev
Copy link
Collaborator Author

dginev commented Apr 10, 2018

Making it work was easier than I thought, but making the CV look good with flexbox has a bit of a learning curve... makes you appreciate bootstrap's magic when dealing with an entire doc 👍

@dginev
Copy link
Collaborator Author

dginev commented Apr 11, 2018

Alright, ready for review here again @brucemiller . I have:

  • Redone the HTML styling using flexbox
  • Simplified the class names, styling scheme, and even the internal binding setup
  • Rebased to the latest master and updated my unnumbered section redefinition (tricky change!)
  • Integrated the XSLT rules with the main stylesheets, as a separate cv component
  • Updated all tests

Feel free to take a look at the latest cs_cv.html file in the PR, though you'd need to carry over the .css files for it to look good.

I'm still short of covering all moderncv features, but basic CVs can look reasonable!

@dginev
Copy link
Collaborator Author

dginev commented Apr 11, 2018

Oh, and I forgot - improved user experience ergonomics. You don't need any special options now, a simple invocation will get you an HTML CV:

latexmlc cs_cv.tex --dest=cs_cv.html

Done.

@dginev
Copy link
Collaborator Author

dginev commented Apr 11, 2018

Tiny fix: had piggybacked on the wrong XSLT rule which turned the mobile number into an email link. Much better now.

@dginev
Copy link
Collaborator Author

dginev commented Apr 11, 2018

Another fun bit - you can actually generate the CV as an epub file that Calibre understands and shows nicely, which makes it distributable akin to a PDF, if such a future ever becomes mainstream. Cool side effect!

@dginev dginev changed the title [Demo] moderncv.sty binding moderncv.sty binding Apr 11, 2018
@brucemiller
Copy link
Owner

The tests, css, (other stuff?) need to go into the MANIFEST, too. Otherwise, let me know when you're done tweaking...it's looking good.

@dginev
Copy link
Collaborator Author

dginev commented Apr 15, 2018

I am done tweaking here, but the MANIFEST is confusing me. Can I just run a command and have it auto-update instead of adding each file by hand? I think there was a make manifest, but I haven't used it for the longest time.

@dginev
Copy link
Collaborator Author

dginev commented Apr 15, 2018

I tried and remembered that make manifest regenerates the entire file and ruins the manually curated structure, so I went and added the remaining files by hand.

Should be ready to merge, I'm done working on this PR 👍

@brucemiller
Copy link
Owner

Cool! Thanks!!

@brucemiller brucemiller merged commit eb97c69 into brucemiller:master Apr 16, 2018
@dginev dginev deleted the moderncv branch April 16, 2018 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants