@@ -449,13 +449,14 @@ Renders to:
449
449
{{< /tabs >}}
450
450
451
451
<!--
452
- ### Source code files
453
- You can use the `{{</* codenew */>}}` shortcode to embed the contents of file
452
+ ## Source code files
453
+ You can use the `{{</* code */>}}` shortcode to embed the contents of file
454
454
in a code block to allow users to download or copy its content to their clipboard.
455
455
This shortcode is used when the contents of the sample file is generic and reusable,
456
456
and you want the users to try it out themselves.
457
457
-->
458
- 你可以使用 ` {{</* codenew */>}} ` 短代码将文件内容嵌入代码块中,
458
+ ## 源代码文件
459
+ 你可以使用 ` {{</* code */>}} ` 短代码将文件内容嵌入代码块中,
459
460
以允许用户下载或复制其内容到他们的剪贴板。
460
461
当示例文件的内容是通用的、可复用的,并且希望用户自己尝试使用示例文件时,
461
462
可以使用此短代码。
@@ -475,36 +476,43 @@ For example:
475
476
如果未提供 ` language ` 参数,短代码将尝试根据文件扩展名推测编程语言。
476
477
477
478
``` none
478
- {{</* codenew language="yaml" file="application/deployment-scale.yaml" */>}}
479
+ {{</* code language="yaml" file="application/deployment-scale.yaml" */>}}
479
480
```
480
481
481
482
<!--
482
483
The output is:
483
484
-->
484
485
输出是:
485
486
486
- {{< codenew language="yaml" file="application/deployment-scale.yaml" >}}
487
+ {{< code language="yaml" file="application/deployment-scale.yaml" >}}
487
488
488
489
<!--
489
490
When adding a new sample file, such as a YAML file, create the file in one
490
491
of the `<LANG>/examples/` subdirectories where `<LANG>` is the language for
491
- the page. In the markdown of your page, use the `codenew ` shortcode:
492
+ the page. In the markdown of your page, use the `code ` shortcode:
492
493
-->
493
494
添加新的示例文件(例如 YAML 文件)时,在 ` <LANG>/examples/ `
494
495
子目录之一中创建该文件,其中 ` <LANG> ` 是页面的语言。
495
- 在你的页面的 markdown 文本中,使用 ` codenew ` 短代码:
496
+ 在你的页面的 markdown 文本中,使用 ` code ` 短代码:
496
497
497
498
``` none
498
- {{</* codenew file="<RELATIVE-PATH>/example-yaml>" */>}}
499
+ {{</* code file="<RELATIVE-PATH>/example-yaml>" */>}}
499
500
```
500
501
501
502
其中 ` <RELATIVE-PATH> ` 是要包含的示例文件的路径,相对于 ` examples ` 目录。
502
503
以下短代码引用位于 ` /content/en/examples/configmap/configmaps.yaml ` 的 YAML 文件。
503
504
504
505
``` none
505
- {{</* codenew file="configmap/configmaps.yaml" */>}}
506
+ {{</* code file="configmap/configmaps.yaml" */>}}
506
507
```
507
508
509
+ <!--
510
+ The legacy `{{%/* codenew */%}}` shortcode is being replaced by `{{%/* code */%}}`.
511
+ Use `{{%/* code */%}}` in new documentation.
512
+ -->
513
+ 传统的 ` {{%/* codenew */%}} ` 短代码将被替换为 ` {{%/* code */%}} ` 。
514
+ 在新文档中使用 ` {{%/* code */%}} ` 。
515
+
508
516
<!--
509
517
## Third party content marker
510
518
-->
0 commit comments