-
Notifications
You must be signed in to change notification settings - Fork 13.5k
reapply [clang-doc] Add --asset option to clang-doc #96358
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bb407e7
Revert "Revert "[clang-doc] Add --asset option to clang-doc" (#96354)"
PeterChou1 c7490ab
[clang-doc] address pr comments
PeterChou1 48b3dbf
[clang-doc] switch loading
PeterChou1 6321616
[clang-doc] remove extra --output
PeterChou1 900869e
[clang-doc] fix conflict
PeterChou1 ada6489
[clang-doc] fix default asset path
PeterChou1 2e6ee4c
Merge branch 'main' into re-revert-add-asset
PeterChou1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
padding: 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hello, world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: rm -rf %t && mkdir %t | ||
// RUN: clang-doc --format=html --output=%t --asset=%S/Inputs/test-assets --executor=standalone %s | ||
// RUN: FileCheck %s -input-file=%t/index.html -check-prefix=INDEX | ||
// RUN: FileCheck %s -input-file=%t/test.css -check-prefix=CSS | ||
// RUN: FileCheck %s -input-file=%t/test.js -check-prefix=JS | ||
|
||
// INDEX: <!DOCTYPE html> | ||
// INDEX-NEXT: <meta charset="utf-8"/> | ||
// INDEX-NEXT: <title>Index</title> | ||
// INDEX-NEXT: <link rel="stylesheet" href="test.css"/> | ||
// INDEX-NEXT: <script src="index_json.js"></script> | ||
// INDEX-NEXT: <script src="test.js"></script> | ||
// INDEX-NEXT: <header id="project-title"></header> | ||
// INDEX-NEXT: <main> | ||
// INDEX-NEXT: <div id="sidebar-left" path="" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left" style="flex: 0 100%;"></div> | ||
// INDEX-NEXT: </main> | ||
|
||
// CSS: body { | ||
// CSS-NEXT: padding: 0; | ||
// CSS-NEXT: } | ||
|
||
// JS: console.log("Hello, world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I've read this in some detail, I'm confused by this patch.
As far as I can tell,
getAssetFiles()
looks for all.css
and.js
files in the passed-in directory and appends them. Line 182 still wants the main js file to be calledindex.js
, even if--asset
is used (…right?), but onlygetDefaultAssetFiles()
checks for the existence of that file.The way I would've expected this to work is that
--asset
just overrides the value ofAssetsPath
. Is there more discussion on why this doesn't implemented that way somewhere that I missed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is an oversight on my part the clang-doc still expect users to provide a file called index.js even if we use the --asset option I've modify the pr to make it so that clang-doc uses whatever js file the user supplies