[clang-tools-extra] [clang-doc] [feat] add --repository-line-prefix argument (PR #131280)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 22 12:46:27 PDT 2025
================
@@ -516,15 +518,16 @@ writeFileDefinition(const Location &L,
std::make_unique<TagNode>(HTMLTag::TAG_A, std::to_string(L.LineNumber));
// The links to a specific line in the source code use the github /
// googlesource notation so it won't work for all hosting pages.
- // FIXME: we probably should have a configuration setting for line number
- // rendering in the HTML. For example, GitHub uses #L22, while googlesource
- // uses #22 for line numbers.
- LocNumberNode->Attributes.emplace_back(
- "href", (FileURL + "#" + std::to_string(L.LineNumber)).str());
+ std::string LineAnchor =
+ formatv("#{0}{1}", RepositoryLinePrefix, L.LineNumber);
----------------
ilovepi wrote:
Why use an `std::string` here and then concatenate below? wouldn't it be easier to simply use `formatv` for the whole thing below?
https://github.com/llvm/llvm-project/pull/131280
More information about the cfe-commits
mailing list