How create documentation using terminal for application?

I use this - Documentation, but it is doesn’t work for generate documentation, what I need to use to generate and preview documentation?

The article you linked to tells you how to build the documentation. What are you having trouble with? You need to be much more specific.

I suspect the issue that @gulivero1773 is running into is that DocC doesn't yet support generating the documentation for the top-level module (such as an iOS application). You can currently get documentation generated for all the libraries you use and their dependencies, but nothing from the application module itself.

One workaround to this particular issue is to move any code you want to expose with documentation into a module, or even a separate library, then you'll get the documentation generated as you'd expect.

3 Likes

as you can see i am getting error - zsh: command not found: docc, but I did everything as shown in the instructions. Оr I did not indicate something or the instruction is not relevant and I want to understand what is wrong

To my knowledge, it seems to be that docc binary is not yet one part of the swift toolchain. (Which is tested on Swift 5.5+ and hopefully will land on soon).

You can clone the repo (GitHub - apple/swift-docc: Documentation compiler that produces rich API reference documentation and interactive tutorials for your Swift framework or package.) and do swift build to get the docc binary in the .build folder @gulivero1773

2 Likes

It is a part of the nightly toolchains - a change that happened only a week or two ago. Unless you're after a latest & greatest & EXPERIMENTAL branch, getting swift-docc and swift-docc-render from source and compiling them locally for use (as @Kyle-Ye suggests) is the much easier path to follow.

If you do get the nightly toolchain, then you can also use some new options to dump protected and private access symbols into the symbol graph and render documentation from that, which may be useful to you - depending on what you're trying to document for your app.

Terms of Service

Privacy Policy

Cookie Policy