Files
Kabir Oberai 1c34649860 docs: enable copy-to-clipboard (#241)
Ref https://github.com/swiftlang/swift-docc/pull/1273

Could be a good idea to later add `nocopy` to some of the code blocks
that aren't commands
2026-09-02 22:11:40 -04:00

27 lines
473 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
rm -rf docs
if type -p xcrun &>/dev/null; then
docc="$(xcrun -f docc)"
else
docc="docc"
fi
if [[ $# == 0 ]]; then
command="convert"
elif [[ $# == 1 && ( "$1" == "preview" || "$1" == "convert" ) ]]; then
command="$1"
else
echo "Usage: $0 [convert|preview]"
exit 1
fi
"$docc" "$command" xtool.docc \
--enable-experimental-code-block-annotations \
--experimental-enable-custom-templates