This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Generate HTML links for children namespaces/records
ClosedPublic

Authored by DiegoAstiazaran on Aug 8 2019, 5:45 PM.

Details

Summary

Path is now stored in the references to the child while serializing, then this path is used to generate the relative path in the HTML generator.
Now some references have paths and some don't so in the reducing phase, references are now properly merged checking for empty attributes.
Tests added for HTML and YAML generators, merging and serializing.
computeRelativePath function had a bug when the filepath is part of the given directory; it returned a path that starts with a separator. This has been fixed.

Diff Detail

Repository
rL LLVM

Event Timeline

DiegoAstiazaran created this revision.Aug 8 2019, 5:45 PM
juliehockett added inline comments.Aug 9 2019, 9:16 AM
clang-tools-extra/clang-doc/HTMLGenerator.cpp
250 ↗(On Diff #214267)

Would llvm::sys::path::remove_dots() do this? It might not, but is worth investigating.

DiegoAstiazaran marked 2 inline comments as done.Aug 9 2019, 11:15 AM
DiegoAstiazaran added inline comments.
clang-tools-extra/clang-doc/HTMLGenerator.cpp
250 ↗(On Diff #214267)

llvm::sys::path::remove_dots() removes all ../ (except for leading ../) so the resulting path in the example would be ../A/B/D, which is not correct.

DiegoAstiazaran marked 2 inline comments as done.Aug 9 2019, 11:52 AM
DiegoAstiazaran added inline comments.
clang-tools-extra/clang-doc/HTMLGenerator.cpp
250 ↗(On Diff #214267)

Sorry about that, I was incorrect. llvm::sys::path::remove_dots() do what we want but from the right side of the path, not the left side.
For A/B/C/../.. it changes it to A. So it still does not work for us.

Change the implementation of computeRelativePath

juliehockett accepted this revision.Aug 12 2019, 10:48 AM
juliehockett marked an inline comment as done.

LGTM

clang-tools-extra/clang-doc/HTMLGenerator.cpp
250 ↗(On Diff #214267)

That's irritating :(

This revision is now accepted and ready to land.Aug 12 2019, 10:48 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2019, 11:42 AM