Skip to content

Commit c46e701

Browse files
weissiLukasa
authored andcommitted
Add 'Show on GitHub' link to API docs (#103)
Motivation: Allowing readers of the API documentation to drill into the implementation of documented declarations can be educational and helpful for debugging, among several other reasons. Modifications: Add --github-file-prefix appending the current version in order to keep stable links. This means that documentation generated from any non-release revision may resolve incorrectly. This can be refined in the doc generation script later if it is deemed problematic by resolving to the commit sha if it doesn't exactly align with the version. Result: Users will be able to click a 'Show on GitHub' for all documented API declarations.
1 parent 18b26df commit c46e701

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/generate_docs.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ tmp=`mktemp -d`
8686
for module in "${modules[@]}"; do
8787
args=("${jazzy_args[@]}" --output "$tmp/docs/$version/$module" --docset-path "$tmp/docset/$version/$module" --module "$module")
8888
if [[ -f "$root_path/.build/sourcekitten/$module.json" ]]; then
89-
args+=(--sourcekitten-sourcefile "$root_path/.build/sourcekitten/$module.json")
89+
args+=(--sourcekitten-sourcefile "$root_path/.build/sourcekitten/$module.json"
90+
--root-url "https://apple.github.io/swift-nio-ssl/docs/$version/$module")
9091
fi
9192
jazzy "${args[@]}"
9293
done

0 commit comments

Comments
 (0)