[all-commits] [llvm/llvm-project] d4dc57: [clang-doc] Allow setting a base directory for hos...
Paul Kirth via All-commits
all-commits at lists.llvm.org
Fri Mar 28 12:50:05 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d4dc5712c47dab5f5dcfc329db8121059b591fb1
https://github.com/llvm/llvm-project/commit/d4dc5712c47dab5f5dcfc329db8121059b591fb1
Author: Paul Kirth <paulkirth at google.com>
Date: 2025-03-28 (Fri, 28 Mar 2025)
Changed paths:
M clang-tools-extra/clang-doc/HTMLGenerator.cpp
M clang-tools-extra/clang-doc/Representation.cpp
M clang-tools-extra/clang-doc/Representation.h
M clang-tools-extra/clang-doc/assets/index.js
M clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
M clang-tools-extra/test/clang-doc/assets.cpp
M clang-tools-extra/test/clang-doc/test-path-abs.cpp
M clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
Log Message:
-----------
[clang-doc] Allow setting a base directory for hosted pages (#132482)
Currently, when we set URLs from JS, we set them only using the protocol
and host locations. This works fine when docs are served from the base
directory of the site, but if you want to nest it under another
directory, our JS fails to set the correct path, leading to broken
links.
This patch adds a --base option to specify the path prefix to use, which
is set in the generated index_json.js file. index.json can then fill in
the prefix appropriately when generating links in a browser. This flag
has no effect for non HTML output.
Given an index hosted at: www.docs.com/base_directory/index.html
we used to generate the following link:
www.docs.com/file.html
Using --base base_directory we now generate:
www.docs.com/base_directory/file.html
This allows such links to work when hosting pages without using a custom
index.js.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list