Code structure and organization is a matter of pride for developers.Clear and consistent code signifies clear and consistent thought.Even though the compiler lacks a discerning palate when it comes tonaming, whitespace, or documentation,it makes all the difference for human collaborators.
Although the tooling and documentation around Swift is still developing,one would be wise to adopt good habits early,by using the new Markdown capabilities for documentation,as well as MARK: comments in Swift code going forward.
I'm aware of the documentation documentation here but there's no explanation of how to do this exactly and the only example of a multi-lined comment (scroll down to: "Calling this method increments the"...) is missing exactly this line of text in the screenshot of the "documentation" popup.
Xcode always interprets the first paragraph as a summary and everything after that as Discussion. The Summary will also be used in context with less space. For example as a hint for the code completion.Here is a good blog article about this that helped me: -documentation/
I had a great opportunity to use the (new in Swift 5.8) capability for changing the permissions level for documentation symbols, and it works beautifully. I ended up having to bound it to preserve backwards compatibility, so it makes a bit of bigger wart than you'd hope for in an annotation, but it does the trick:
(Sidebar: I'm working on a new flag that will also drop symbols that are implementations of protocol requirements, to clean up docs even more: [SymbolGraphGen] add new flag to skip "protocol implementation" symbols by QuietMisdreavus Pull Request #63726 apple/swift GitHub. I wanted to do a little more testing before i merge it for real, but it might be relevant to this use case.)
Is that exposed up through swift-docc-plugin, or would I need to step down into separately generating the symbols (using this option) in order to use this? I didn't see it as an option within swift package plugin generate-documentation --help
I think this was work that @sofiaromorales mentioned doing at the last workgroup meeting (cf. Feat: New plugin flag for skipping synthesized symbols by sofiaromorales Pull Request #28 apple/swift-docc-plugin GitHub). I don't think the plugin will let you provide arbitrary flags, but there is work on threading through this specific flag.
Did you ever find an answer for this? These excessive protocol implementation documentation artifacts make the document index unusable in my instance. There are hundreds of them listed for me and we are using DocC for a project, not just a package.
Symbol documentation comments are now based on the same Markdown syntax used by rich playground comments, so a lot of what you can do in playgrounds can now be used directly in source code documentation.
For full details of the syntax, see Markup Formatting Reference. Note that there are some discrepancies between the syntax for rich playground comments & symbol documentation; these are pointed out in the document (e.g. block quotes can only be used in playgrounds).
I've found something interesting, digging in the Xcode binary. Files with the ending .swiftdoc.It definitely has docs, because these files contain the docs for the Swift UIKit / Foundation API, unfortunately it seems to be a proprietary file format, for use in the Documentation viewer in Xcode.
I've started digging in and experimenting with the documentation coverage metrics, as a way to just track how much API surface exists on the library I'm contributing into, and to track updates over time.
The column name "USR" is actually a misnomer in this case because what gets output is the documentation link of the page. "USR" is a term refers to the unique string generated by the Swift compiler for a symbol. Thanks for pointing that out, I filed a bug about this: [SR-15540] Documentation coverage "USR" column is named incorrectly Issue #205 apple/swift-docc GitHub.
That's a great idea. I think one way we could achieve this would be to provide an ability to visualize coverage data based on how you've curated your APIs. For instance, the symbols that are curated in the Topics section of the top-level page of the framework are likely the most important ones, so the documentation coverage data could put these at the forefront in some way.
Articles aren't currently included in the 'brief' report indeed. Looking at the codebase ( -docc/blob/main/Sources/SwiftDocC/Infrastructure/CoverageDataEntry.swift#L223), the 'Globals' category encapsulates global functions, modules, global variables, and operators.
Hi, i've been looking for a way to use swift-docc for documenting the internals of a (fairly large) custom framework, the target audience being internal developpers that will later have to maintain or port the framework to other platforms, without much success.
Ideally DocC would add the ability for users to set a base access level for the generated documentation. In the meantime, you might be able to use Jazzy to do what you need, rather than polluting your code with unnecessary ACLs.
That capability is available in the nightly builds now - or at least you can kind of shim into it. There's a CLI option to specify the access level (defaults to 'public') of the symbols in the symbol graph to include from the compiler. To use this, you need to add some options to the swift build command that's generating the symbol graph.
When documenting internal API or code, I believe the goals change. Hosting the documentation away from the code is not desired. Instead, likely the documentation would always stay as part of the repository, next to the code, and will serve as documentation to share between the authors of the package/packages (not the consumers):
I know how to make some basic comments for functions, to mark parameters and list them, but I struggle to find a good tutorial or instructions on how to write proper documentation comments on everything so when I finish up my project I can document it properly and if somebody else will take over project they will get everything documented as Apple has.
I know there are a lot of markers for comments and probably there are also some snippets somewhere I can use for making good documentation comments. Best would be to write "/**", pressing enter and Xcode would automatically fill comment with list of parameters and let me fill just details I need. Something like IntelliJ has.
The documentation is currently being updated with Swift. -sdks/iOS/build-an-app/implement-features
If you need any code snippets from Objective-C documentation in Swift, I would be happy to provide those here.
getting logged in = false and a crash of EXC_BAD_ACCESS on the line marked as @main for my AppDelegate, which seemed to work fine in the anonymous joinMeeting function. I suspect I may have to restructure my swift application to use App type instead of what was originally developed in an older style with ContentView with an AppDelegate marked as @main and to implement the UIApplicationDelegateAdaptor - new topics for me to figure out - but to be clear more swift docs around starting an instant meeting is my ask here (as well as longer term ask of more comprehensive docs to make using zoom SDK within swift apps easier).
We have some examples of implementing screensharing with swift here: -sdks/iOS/mastering-zoom-sdk/in-meeting-function/screen-share. There is a toggle above the code snippets to switch between objective-c and swift.
Note that building the DocC documentation requires building the package first. Presumably, swift package generate-documentation functions similarly to swift build in that it only builds for the host platform. (In fact, the former probably calls through to the latter.) Therefore, SPM is trying to build your package on macOS, where UIKit doesn't exist.
I believe @Peter-Schorn is correct here- we don't expect swift package generate-documentation to run successfully if swift build fails since documentation generation depends on being able to build the package itself with SwiftPM.
Guided tutorials with hands-on coding to develop practical experience and build working code and apps. Start a Firebase codelab for iOS, Android, or Web. wysiwyg Reference documentation Formal reference documentation for Firebase SDKs, Firebase REST APIs, and Firebase tools. Find Firebase reference docs under the Reference tab at the top of the page.
You can use devcontainers as a package-ecosystem in your dependabot.yml file to update Features in your devcontainer.json configuration files. For more information about this support, and for configuration file examples, see General Availability of Dependabot Integration in the Development Containers documentation.
Dev containers are used in several tools and services, including Codespaces. For more information about Features and the supported services, see Features and Supporting tools and services in the Development Containers documentation, respectively.
Features in any valid dev container location will be updated in a single pull request. For more information about the dev container specification, see Specification in the Development Containers documentation.
In order for Dependabot to fetch Docker metadata, maintainers of Docker images must add the org.opencontainers.image.source label to their Dockerfile, and include the URL of the source repository. Additionally, maintainers must tag the repository with the same tags as the published Docker images. For an example, see the dependabot-fixtures/docker-with-source repository. For more information on Docker labels, see Extension image labels and BUILDX_GIT_LABELS in the Docker documentation.
Private registry support applies to git registries only. Swift registries are not supported. Non-declarative manifests are not supported. For more information on non-declarative manifests, see Editing Non-Declarative Manifests in the Swift Evolution documentation.
Dependabot works with any container registries that implement the OCI container registry spec. For more information, see -spec/blob/main/spec.md. Dependabot supports authentication to private registries via a central token service or HTTP Basic Auth. For further details, see Token Authentication Specification in the Docker documentation and Basic access authentication on Wikipedia.
08ab062aa8