swift-book
swift-book copied to clipboard
Specify code listings are Swift
Because the Info.plist
file specifies Swift as the default language via the CDDefaultCodeListingLanguage
key, code listings with an unspecified language should still render correctly. However, it's still good to be explicit and makes the markdown files more usable by other toolchains.
Used the following script to find code listings that were missing an explicit language, and to verify that none remain after this change:
echo "Not specified as Swift"
cmark --to xml TSPL.docc/*/*.md |
xpath -q -n -e '//code_block[not(@info="swift")]'
echo "Languages used"
cmark --to xml TSPL.docc/*/*.md |
xpath -q -n -e '//code_block/@info' |
sort -u