Skip to content

[clang-doc] Correct improper file paths in HTML output #132103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Mar 19, 2025

In index.js the logic of the ternary operator was backwards, preventing
us from generating the correct file paths, or relative paths in the HTML
output.

@llvmbot
Copy link
Member

llvmbot commented Mar 19, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

Changes

In index.js the logic of the ternary operator was backwards, preventing
us from generating the correct file paths, or relative paths in the HTML
output.


Full diff: https://github.com/llvm/llvm-project/pull/132103.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-doc/assets/index.js (+2-2)
diff --git a/clang-tools-extra/clang-doc/assets/index.js b/clang-tools-extra/clang-doc/assets/index.js
index 6a223de66f84a..58a92f049f19f 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -2,8 +2,8 @@ function genLink(Ref) {
   // we treat the file paths different depending on if we're
   // serving via a http server or viewing from a local
   var Path = window.location.protocol.startsWith("file") ?
-      `${window.location.protocol}//${window.location.host}/${Ref.Path}` :
-      `${window.location.protocol}//${RootPath}/${Ref.Path}`;
+      `${window.location.protocol}//${RootPath}/${Ref.Path}` :
+      `${window.location.protocol}//${window.location.host}/${Ref.Path}`;
   if (Ref.RefType === "namespace") {
     Path = `${Path}/index.html`
   } else if (Ref.Path === "") {

@ilovepi ilovepi requested review from PeterChou1 and petrhosek March 19, 2025 21:57
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-extra-cmd branch from dfc4eae to 3f09b51 Compare March 19, 2025 23:03
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-fix-index branch from 6182de9 to 4fba6cf Compare March 19, 2025 23:03
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-extra-cmd branch from 3f09b51 to 86c3dc2 Compare March 19, 2025 23:16
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-fix-index branch from 4fba6cf to 96898ef Compare March 19, 2025 23:17
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-extra-cmd branch from 86c3dc2 to df32792 Compare March 19, 2025 23:46
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-fix-index branch 2 times, most recently from 9293b4c to 8b73051 Compare March 19, 2025 23:47
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-extra-cmd branch 2 times, most recently from 9f1a589 to c857982 Compare March 20, 2025 00:55
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-fix-index branch from 8b73051 to f50f1a7 Compare March 20, 2025 00:55
Copy link
Contributor Author

ilovepi commented Mar 20, 2025

Merge activity

  • Mar 20, 5:02 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Mar 20, 5:09 PM EDT: Graphite rebased this pull request as part of a merge.
  • Mar 20, 5:11 PM EDT: A user merged this pull request with Graphite.

@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-extra-cmd branch from c857982 to b00e1c8 Compare March 20, 2025 21:05
Base automatically changed from users/ilovepi/clang-doc-extra-cmd to main March 20, 2025 21:08
In index.js the logic of the ternary operator was backwards, preventing
us from generating the correct file paths, or relative paths in the HTML
output.
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-fix-index branch from f50f1a7 to a215322 Compare March 20, 2025 21:09
@ilovepi ilovepi merged commit 3fbc9b9 into main Mar 20, 2025
6 of 10 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-fix-index branch March 20, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants