How to convert code samples to be "live" - The MDN project 编辑

MDN has a "live sample" system, where the code sample shown on a page is directly used to display the output of that same sample. However, many existing articles have code samples that do not yet use this system, and need to be converted.

Live samples, which let you see what a sample's output looks like, make documentation more dynamic and instructive. This guide covers how to take existing samples and add "live" functionality to them.

Where does it need to be done?
Any article that has a static code example (just blocks of HTML, CSS, JavaScript) that you think would benefit from being shown running live.
What do you need to know to do the task?
  • Understanding of HTML, CSS and/or JavaScript, depending on the code sample.
  • Ability to use KumaScript macros within MDN articles.
What are the steps to do the task?
  1. Find a code example that you think should be converted to be "live".
  2. Convert the code sample to be "live".
  3. Delete any code or image that was previously used to display the output of the sample.

For more information on creating and editing Live Samples, see Using the live sample system

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:88 次

字数:1579

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文