Closed onato closed 3 years ago
Running jazzy this way generates documentation for one module - see Usage in the readme for tips on how to pick the right module.
If you want to try putting multiple modules into the same docset then see #1194, #564 for the workaround -- things should mostly work as long as your structure is not too complex and there are no name clashes.
Worked like a charm.
#!/bin/sh
set -euo pipefail
IFS=$'\n\t'
modules=(
"App"
"Authentication"
"Utils"
)
cleanup() {
for module in ${modules[@]}; do
rm "$module.json" || true
done
}
trap cleanup 0
FILENAMES=""
for module in ${modules[@]}; do
filename="$module.json"
if [ ! -f $filename ]; then
echo "Processing $module"
sourcekitten doc -- -workspace MyApp.xcworkspace -scheme "$module" > "$filename"
fi
FILENAMES="$FILENAMES,$filename"
done
jazzy \
--clean \
--author Acme \
--author_url https://example.com \
--source-host github \
--source-host-url https://github.com/example/my-app \
--build-tool-arguments -scheme,MyApp \
--root-url https://github.com/example/my-app/ \
--output docs/reference \
--min-acl private \
--sourcekitten-sourcefile "${FILENAMES:1}"
I have my modules organized in frameworks that are linked into the App Target, similar to this example project.
DemoAppWithFramework.zip
When I run…
I get documentation generated for the files in the main App target, but not for those in the framework.
I expected jazzy to generate docs for files in the app target's dependencies as well.
Do I need to generate the docs for frameworks in a separate step using https://github.com/realm/jazzy#docs-from-swiftmodules-or-frameworks or is there something else I am missing?