kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
319 stars 208 forks source link

Render code blocks properly in OpenAPI #482

Open Jefftree opened 4 months ago

Jefftree commented 4 months ago

Render code blocks properly in OpenAPI.

Partially solves https://github.com/kubernetes/website/issues/35712

/cc @sftim @robert-cronin /assign @jpbetz @sttts

k/k OpenAPI diff can be seen here https://github.com/kubernetes/kubernetes/pull/125899/commits/7e24dabdd9b84c67f2f2aa1445d53be6bddefb7e#diff-9f4c1466e676f9e733cae72d369ffd5ff37f446116c98562807cf3bfb872ae95

k8s-ci-robot commented 4 months ago

@Jefftree: GitHub didn't allow me to request PR reviews from the following users: robert-cronin.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to [this](https://github.com/kubernetes/kube-openapi/pull/482): >Render code blocks properly in OpenAPI. > >Partially solves https://github.com/kubernetes/website/issues/35712 > >/cc @sftim @robert-cronin >/assign @jpbetz @sttts Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kube-openapi/blob/master/OWNERS)~~ [Jefftree] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
Jefftree commented 4 months ago

The motivation was code blocks but imo anything within the block quote ``` should NOT be interpreted as markdown and should be outputted as is with no reformatting done. That's essentially what this PR is targeting

sftim commented 4 months ago

Markdown blockquotes look like:

> This is a block quote
> 
> Within the block quote there could be a multiline code snippet
> ```
> echo "Hello, world
> ```

Jefftree commented 4 months ago

Ah sorry I mixed up the terminology.

I'm not sure if we have any examples of use cases with blockquotes, so right now I'm leaning probably not. We can re-evaluate if we see a future use case.

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

sftim commented 1 month ago

@jefftree I'm happy to see this land. I can review it but you'd need to either explain how to test this, or give me an explain-it-like-I-use-Go-more-than-once-every-5-years guide to setting up a local dev environment (yes those overlap a bit).

k8s-triage-robot commented 3 hours ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten