Page MenuHomePhabricator

[clang-doc] Add stylesheet to generated html docs

Authored by DiegoAstiazaran on Jul 10 2019, 3:30 PM.

Diff Detail

Event Timeline

juliehockett added inline comments.Jul 10 2019, 3:38 PM
juliehockett added inline comments.Jul 10 2019, 3:40 PM

Eventually, we'll want to make this a configurable thing via a flag, but that can be done in another patch.

DiegoAstiazaran marked 2 inline comments as done.

Use llvm::sys::fs::copy_file to copy css file.

juliehockett added inline comments.Jul 11 2019, 8:37 AM

On second thought, can you create a virtual method to the Generator along the lines of Generator::createResources(ClangDocContext ctx), which would be a no-op for the YAML and MD generators atm and for the HTML generator would encapsulate this logic? I'd rather not have it in the main tool file, since it is generator-specific.

DiegoAstiazaran marked an inline comment as done.

Move the generation of css stylesheet to a function inside the HTMLGenerator.
A virtual function createResources was declared for Generator class. This is no-op for the YAML and MD generators. For the HTML it contains the generation of css stylesheet.

juliehockett accepted this revision.Jul 12 2019, 12:56 PM
This revision is now accepted and ready to land.Jul 12 2019, 12:56 PM
DiegoAstiazaran edited the summary of this revision. (Show Details)

Move the CSS file to share/clang and read it from there, instead of trying to read it from the file that's with the source code, that only worked when run locally.

I'm blindly accepting the CSS but all other code looks fine. I still have that chrome bug where I can't LGTM sometimes but consider this reviewed and accepted by me as well

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2019, 2:30 PM