swift-book icon indicating copy to clipboard operation
swift-book copied to clipboard

Specify code listings are Swift

Open amartini51 opened this issue 4 months ago • 1 comments

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

amartini51 avatar Sep 27 '24 19:09 amartini51