diff --git a/README.md b/README.md index dce094bd8c..1ad4cdf53e 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ Using a theme, all of your default configuration lives in an npm package. - [disableSearch (optional)](#disablesearch-optional) - [hideTryItPanel (optional)](#hidetryitpanel-optional) - [jsonSampleExpandLevel (optional)](#jsonsampleexpandlevel-optional) + - [generateCodeSamples (optional)](#generatecodesamples-optional) - [JSDoc](#jsdoc) - [MDX](#mdx) - [Modular Content System](#modular-content-system) @@ -1207,6 +1208,17 @@ Defaults to ```2``` https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-object-openapi-schema +#### generateCodeSamples (optional) + +```js + +``` + +Controls options for generating code samples, including code sample languages. + +Defaults to ```languages: [], skipOptionalParameters: false``` + +https://redocly.com/docs/api-reference-docs/configuration/functionality#theme-object-openapi-schema ### JSDoc diff --git a/packages/gatsby-theme-aio/CHANGELOG.md b/packages/gatsby-theme-aio/CHANGELOG.md index 99f75ec799..dc3458394f 100644 --- a/packages/gatsby-theme-aio/CHANGELOG.md +++ b/packages/gatsby-theme-aio/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.11.15](https://github.com/adobe/aio-theme/compare/@adobe/gatsby-theme-aio@4.11.14...@adobe/gatsby-theme-aio@4.11.15) (2024-06-17) + +### Features +* Add option to generate code samples in RedoclyAPIBlock [f751bb5](https://github.com/adobe/aio-theme/commit/f751bb5f91dbbfd8f78bcdea0ea89093f907bbf2) + ## [4.11.14](https://github.com/adobe/aio-theme/compare/@adobe/gatsby-theme-aio@4.11.13...@adobe/gatsby-theme-aio@4.11.14) (2024-05-14) ### Fix diff --git a/packages/gatsby-theme-aio/package.json b/packages/gatsby-theme-aio/package.json index 8e629d9237..6438321151 100644 --- a/packages/gatsby-theme-aio/package.json +++ b/packages/gatsby-theme-aio/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/gatsby-theme-aio", - "version": "4.11.14", + "version": "4.11.15", "description": "The Adobe I/O theme for building markdown powered sites", "main": "index.js", "license": "Apache-2.0", diff --git a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js index 237345dd80..b2793e435d 100644 --- a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js +++ b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js @@ -27,6 +27,7 @@ const RedoclyAPIBlock = ({ disableSearch = false, hideTryItPanel = false, jsonSampleExpandLevel = 2, + generateCodeSamples = 'languages: [], skipOptionalParameters: false,', }) => { const [isRedoclyLoading, setIsRedoclyLoading] = useState(true); @@ -67,6 +68,7 @@ const RedoclyAPIBlock = ({ disableSearch: ${disableSearch}, hideTryItPanel: ${hideTryItPanel}, jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel}, + ${generateCodeSamples ? "generateCodeSamples: { " + generateCodeSamples + "}," : ''} hideLoading: true, theme: { ${typography ? "typography: { " + typography + "}," : ''} @@ -97,6 +99,7 @@ RedoclyAPIBlock.propTypes = { PropTypes.oneOf([all]), PropTypes.number, ]), + generateCodeSamples: PropTypes.string, }; export { RedoclyAPIBlock }; \ No newline at end of file