Feature Name
Snippets from any directory
Description
The docs say:
If you prefer, you can specify the relative path from the package’s root directory (by including a
“Snippets/” prefix). You can also include the package name—as defined in Package.swift—before the
“Snippets/” prefix. Neither of these leading path components are necessary because all your snippet code
files are always located in your package’s “Snippets” directory.
Earlier Versions
Before Swift-DocC 6.2.1, the @Snippet path needed to include both the package name component and the “Snippets” component: @Snippet(path: "my-package/Snippets/example-snippet")
Which basically means I have to copy or symlink my Samples/ projects into Snippets in order to use snippets, very confusing people contributing to the project.
We should be able to just
`@Snippet(path: "my-package/Samples/MySample/Sources/FirstExample/example-snippet")`
because this way those are not only compiled but also run tests against as I verify my samples.
Motivation
swift-java has extensive examples and every single feature has a sample.
We want to use those in documentation snippets, without symlinking or "working around" docc decisions that force copying the same samples into Snippets/
Importance
Reduce code duplication as well as improve testing of snippets.
Alternatives Considered
No response
Feature Name
Snippets from any directory
Description
The docs say:
Which basically means I have to copy or symlink my
Samples/projects intoSnippetsin order to use snippets, very confusing people contributing to the project.We should be able to just
because this way those are not only compiled but also run tests against as I verify my samples.
Motivation
swift-java has extensive examples and every single feature has a sample.
We want to use those in documentation snippets, without symlinking or "working around" docc decisions that force copying the same samples into Snippets/
Importance
Reduce code duplication as well as improve testing of snippets.
Alternatives Considered
No response