Skip to content

Conversation

@heckj
Copy link
Member

@heckj heckj commented Jul 31, 2025

extends the list of highlighted languages to include YAML by default

resolves #959

@heckj
Copy link
Member Author

heckj commented Jul 31, 2025

@swift-ci please test

@heckj heckj requested review from marinaaisa and mportiz08 July 31, 2025 20:32
Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll also need to update this line:

const builtinLanguages = 'bash|c|s?css|cpp|diff|http|java|llvm|perl|php|python|ruby|xml|javascript|json|markdown|objectivec|shell|swift';

You can verify that a file with a name like dist/js/highlight-js-yaml-... gets emitted when you run npm run build and ideally test with an example code listing to make sure things are configured right.

Seems like it would be a good addition to default set of supported languages though, thanks!

@heckj
Copy link
Member Author

heckj commented Jul 31, 2025

Thanks Marcus!

Verified it's splatting out the YAML highlighter, from my last nom run build with the updated line:

highlight-js-bash-js.702f0c5c.js          highlight-js-markdown-js.a2f456af.js
highlight-js-c-js.063069d3.js             highlight-js-objectivec-js.74dea052.js
highlight-js-cpp-js.458a9ae4.js           highlight-js-perl-js.da6eda82.js
highlight-js-css-js.bfc4251f.js           highlight-js-php-js.c458ffa4.js
highlight-js-custom-markdown.78c9f6ed.js  highlight-js-python-js.60354774.js
highlight-js-custom-swift.738731d1.js     highlight-js-ruby-js.7272231f.js
highlight-js-diff-js.4db9a783.js          highlight-js-scss-js.adcd11a2.js
highlight-js-http-js.f78e83c2.js          highlight-js-shell-js.0ad5b20f.js
highlight-js-java-js.4fe21e94.js          highlight-js-swift-js.bdd5bff5.js
highlight-js-javascript-js.dfc9d16d.js    highlight-js-xml-js.0d78f903.js
highlight-js-json-js.2a1856ba.js          highlight-js-yaml-js.859e2232.js
highlight-js-llvm-js.26121771.js

@mportiz08
Copy link
Contributor

@swift-ci test

@mportiz08 mportiz08 merged commit deca402 into swiftlang:main Jul 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable YAML syntax highlighting within DocC content

2 participants