elements icon indicating copy to clipboard operation
elements copied to clipboard

feat: add ability to override code examples using `x-codeSamples`

Open weyert opened this issue 9 months ago • 8 comments

Elements Default PR Template

In general, make sure you have: (check the boxes to acknowledge you've followed this template)

  • [X] Read CONTRIBUTING.md

Updates the RequestSamples and TryItWithExamples-components to support the x-codeExamples vendor extension on a http operation schema.

refs #2453

weyert avatar Apr 25 '24 15:04 weyert

Deploy Preview for stoplight-elements ready!

Name Link
Latest commit ec84034af4befae7d5db1d255b3a9d53be953dcd
Latest deploy log https://app.netlify.com/sites/stoplight-elements/deploys/664b84291ea50c0008154970
Deploy Preview https://deploy-preview-2574--stoplight-elements.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 25 '24 15:04 netlify[bot]

Deploy Preview for stoplight-elements-demo ready!

Name Link
Latest commit ec84034af4befae7d5db1d255b3a9d53be953dcd
Latest deploy log https://app.netlify.com/sites/stoplight-elements-demo/deploys/664b8429842de70008d51c84
Deploy Preview https://deploy-preview-2574--stoplight-elements-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 25 '24 15:04 netlify[bot]

@weyert Hey! Thank you for the contribution. Were you going for x-codeexamples or was it supposed to be x-codesamples?

x-codesamples is generally what we see being used in the industry.

mnaumanali94 avatar Apr 26 '24 12:04 mnaumanali94

Oh sorry, my bad. I am happy to update it. You are totally right. I am not sure if we would like to remap support mappings from other views (E.g. redly) to the values that Elements is expecting?

weyert avatar Apr 26 '24 14:04 weyert

I am not sure if we would like to remap support mappings from other views (E.g. redly) to the values that Elements is expecting?

I am not sure what you mean by this? is redly using a different overriding code example x extension?

brendarearden avatar Apr 26 '24 16:04 brendarearden

I am not sure if we would like to remap support mappings from other views (E.g. redly) to the values that Elements is expecting?

I am not sure what you mean by this? is redly using a different overriding code example x extension?

Sorry, I meant Redocly and others might use a different naming convention for the language, e.g. shell vs bash etc. I think we are fine for Read.me version of doing this, though.

weyert avatar Apr 26 '24 18:04 weyert

Sorry, I meant Redocly and others might use a different naming convention for the language, e.g. shell vs bash etc. I think we are fine for Read.me version of doing this, though.

Gotcha. We don't need to do the remapping as part of this, but would you open a separate issue for the remapping?

brendarearden avatar May 03 '24 15:05 brendarearden

Gotcha. We don't need to do the remapping as part of this, but would you open a separate issue for the remapping?

Sure, happy to do that.

weyert avatar May 03 '24 18:05 weyert

Hmm, bummer, wondering if it's incorrect management of the isStale-variable?

weyert avatar May 16 '24 20:05 weyert

Don't want to sound rude but I would prefer Stoplight's resources would be spend on my other PR https://github.com/stoplightio/elements/pull/2545 which would allow me to stop using my fork of Elements. This PR was just a nice improvement.

weyert avatar May 20 '24 17:05 weyert

@weyert this PR overlapped with a feature request from our product team, so it was a higher priority in the backlog. I appreciate you letting us know though and we will make sure your other PR is moved up in priority! hopefully we will be able to get you unforked soon!

brendarearden avatar May 20 '24 18:05 brendarearden

Thank you for merging :)

weyert avatar May 21 '24 15:05 weyert