-
Notifications
You must be signed in to change notification settings - Fork 146
Update contributor documentation to reflect changes in input discovery #1060
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
d-ronnqvist
merged 9 commits into
swiftlang:main
from
d-ronnqvist:input-discovery-contributor-docs
Nov 8, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f24bd81
Update contributor documentation about documentation input discovery
d-ronnqvist 18cd622
Update copyright year for updated contributor documentation article
d-ronnqvist 975dac9
Avoid deprecated API in code example in contributor documentation
d-ronnqvist 0e4ec7b
Mention catalog content file extensions in top-level contributor docu…
d-ronnqvist 34fb986
Add more documentation for `DocumentationContext/InputsProvider`
d-ronnqvist bc05658
Correct "catalog" terminology in some contributor documentation
d-ronnqvist f3aad9d
Add more documentation for `DocumentationBundle`
d-ronnqvist b6a2079
Apply suggestions from code review
d-ronnqvist 17bd190
Merge branch 'main' into input-discovery-contributor-docs
d-ronnqvist 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
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 |
---|---|---|
|
@@ -4,8 +4,9 @@ Build and query the in-memory documentation model. | |
|
||
## Discussion | ||
|
||
The documentation context generally manages the in-memory documentation including: | ||
|
||
A documentation context is the the in-memory representation of a "unit" of documentation (for example a module, package, or technology). | ||
The context is generally responsible for: | ||
|
||
- Analyzing bundle file contents and converting to semantic models. | ||
- Managing a graph of documentation nodes (a single node representing one documentation topic). | ||
- Processing assets like media files or download archives. | ||
|
@@ -14,12 +15,17 @@ The documentation context generally manages the in-memory documentation includin | |
|
||
### Creating a Context | ||
|
||
Use ``DocumentationContext/init(bundle:dataProvider:diagnosticEngine:configuration:)`` to create a context for a given bundle: | ||
|
||
```swift | ||
let workspace = DocumentationWorkspace() | ||
let context = try DocumentationContext(dataProvider: workspace) | ||
``` | ||
let inputsProvider = DocumentationContext.InputsProvider() | ||
let (bundle, dataProvider) = try inputsProvider.inputsAndDataProvider( | ||
startingPoint: catalogURL, | ||
options: bundleDiscoveryOptions | ||
) | ||
|
||
During initialization the context will inspect the available bundles in the workspace and load any symbol graph files and markup files. | ||
let context = try DocumentationContext(bundle: bundle, dataProvider: dataProvider) | ||
``` | ||
|
||
### Accessing Documentation | ||
|
||
|
@@ -40,19 +46,11 @@ To find out the location of the source file for a given documentation node use: | |
let sourceFileURL = try context.documentURL(for: reference) | ||
``` | ||
|
||
And finally to print all known paths in the context: | ||
|
||
```swift | ||
context.knownIdentifiers.forEach({ print($0) }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this no longer true/possible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's still both true and possible. I just felt that it wasn't relevant. |
||
``` | ||
|
||
## Topics | ||
|
||
### Documentation Context | ||
|
||
- ``DocumentationContext`` | ||
- ``DocumentationContextDataProvider`` | ||
- ``DocumentationContextDataProviderDelegate`` | ||
- ``AutomaticCuration`` | ||
|
||
### Documentation Nodes | ||
|
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.
I think describing the extensions for each of these file types is useful. Can we add that back here?
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.
I didn't feel like the top-level page about the compiler pipeline was the right place to enumerate all the support file extensions in a catalog.
I'll see if I can find a better place for this information.
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.
I noticed that the top-level page also listed the possible content of a catalog so I updated that to mention the file extensions .
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.
Thanks!