-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Scrape code examples from examples/ directory for Rustdoc #85833
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4b3f82a
Add updated support for example-analyzer
willcrichton 7831fee
Fix check issue
willcrichton 2855bf0
Factor scraping and rendering into separate calls to rustdoc
willcrichton b6338e7
Generate example source files with corresponding links
willcrichton eea8f0a
Sort examples by size
willcrichton 55bb517
Move highlighting logic from JS to Rust
willcrichton 18edcf8
Reduce blur size, fix example width bug, add better error handling fo…
willcrichton a1cb194
Add styles for non-white themes
willcrichton 829b1a9
Incorporate jyn's feedback
willcrichton 5c05b3c
Add target crates as inputs to reduce size of intermediates
willcrichton df5e3a6
Change serialized format to use DefPathHash instead of custom String
willcrichton 25323ec
Move JS into a standalone file
willcrichton 55731bb
Fix lint error, change scrape-examples.js minify call
willcrichton ed8e12f
Unversioned -> InvocationSpecific
willcrichton 5584c79
Update to latest rustc and rustdoc styles
willcrichton bb383ed
Move some expansion logic into generation-time, fix section header li…
willcrichton e22e858
Move more scrape-examples logic from JS to rust
willcrichton f10dcee
Change handling of spans in scrape examples, add test for highlight d…
willcrichton 9e4958a
Add test for prev/back arrows + examples across multiple files
willcrichton b1616f3
Add test for ordering of examples, simplify with single scrape.mk file
willcrichton 24a71cb
Fix local crate not being scraped
willcrichton 8f80d86
Small scrape-example fixes
willcrichton d1c29c6
Revert def_id addition from clean::Function, add test for
willcrichton fd5d614
Move def_id logic into render_call_locations
willcrichton 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 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 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 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 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 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 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 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 @@ | ||
// compile-flags: -Z unstable-options --scrape-examples-target-crate foobar |
This file contains 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,2 @@ | ||
error: must use --scrape-examples-output-path and --scrape-examples-target-crate together | ||
|
This file contains 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 @@ | ||
// compile-flags: -Z unstable-options --scrape-examples-output-path ex.calls |
This file contains 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,2 @@ | ||
error: must use --scrape-examples-output-path and --scrape-examples-target-crate together | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
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.
note to self: get rid of this later, it can be calculated on-demand from the DefId.
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.
Open an issue to not forget it then. ;)
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.
#89673