This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Add index in each info html file
ClosedPublic

Authored by DiegoAstiazaran on Aug 2 2019, 6:04 PM.

Details

Summary

An index structure is created while generating the output file for each info. This structure is parsed to JSON and written to a file in the output directory. The html for the index is not rendered by clang-doc. A Javascript file is included in the output directory, this will read the JSON and insert HTML elements into the file.

Diff Detail

Repository
rL LLVM

Event Timeline

DiegoAstiazaran created this revision.Aug 2 2019, 6:04 PM
phosek added inline comments.Aug 2 2019, 6:30 PM
clang-tools-extra/clang-doc/assets/index.js
17 ↗(On Diff #213158)

Wrong indentation?

DiegoAstiazaran marked 2 inline comments as done.

Fix format of index.js file

clang-tools-extra/clang-doc/assets/index.js
17 ↗(On Diff #213158)

Yes, clang-format "missed" that because I forgot the semicolon in the previous line.
Thanks, it has been fixed.

juliehockett added inline comments.Aug 5 2019, 5:09 PM
clang-tools-extra/clang-doc/Generators.cpp
79 ↗(On Diff #213171)

Why is this implementation in the generic Generator? It's fairly HTML-specific -- neither of the other generators are able to parse and include Javascript (since this does include the var JsonIndex bit).

clang-tools-extra/clang-doc/HTMLGenerator.cpp
665 ↗(On Diff #213171)

Can we move this to ClangDocMain.cpp right above where the function is called? That's where most of these types of status updates are.

DiegoAstiazaran marked 3 inline comments as done.

Moved serialization of Index to HTML generator.

DiegoAstiazaran added inline comments.Aug 5 2019, 7:51 PM
clang-tools-extra/clang-doc/Generators.cpp
79 ↗(On Diff #213171)

Moved to HTMLGenerator.cpp; it was there because I was first writing a JSON file which could be used for any generator.

This revision is now accepted and ready to land.Aug 6 2019, 9:02 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2019, 11:32 AM
clang-tools-extra/trunk/clang-doc/assets/index.js