Skip to content

Commit

Permalink
Add codenew shortcode to style guide
Browse files Browse the repository at this point in the history
added review changes for #18231
  • Loading branch information
anshuprateek-grabtaxi committed Dec 23, 2019
1 parent d60ca0b commit 4e01e79
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/en/docs/contribute/style/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,24 @@ The output is:
{{< kat-button >}}
### Downloadable code blocks
Use {{</* codenew */>}} to make code samples (eg manifests) downloadable.
Pages that provide ready-to-run sample manifests should put them in respective localized folder, (eg) content/en/examples/application/deployment.yaml (for English localization) and reference the downloadable code sample directly, using the {{</* codenew */>}} shortcode.
eg: {{</* codenew file="application/deployment.yaml" */>}}
The output is:
{{< codenew file="application/deployment.yaml" >}}
Example page containing above shortcode:
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
Code samples may also have some localized context which should be updated in respective localized folder. Typically, code samples do not change, however natural-language comments can be translated.
For example: https://github.com/kubernetes/website/blob/master/content/ko/examples/application/deployment.yaml is the `ko` version for https://github.com/kubernetes/website/blob/master/content/en/examples/application/deployment.yaml
## Common Shortcode Issues
### Ordered Lists
Expand Down

0 comments on commit 4e01e79

Please sign in to comment.