研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
编写优秀的 Codelab
简介
Codelab 是使用 Markdown 语法编写的互动式教程。我们在 blocklycodelabs.dev 上发布 Codelab。Codelab 结合使用自然语言、代码示例和屏幕截图,打造更有趣的教程体验。Codelab 的目标用户会遵循并在阅读时运行代码。
编写 Codelab 是为社区做贡献的绝佳方式。您可以在这里分享知识,为遇到相同问题的下一位开发者提供帮助。
优秀的 Codelab 有哪些特征?
出色的 Codelab 重点明确、易于阅读。它会明确告诉用户要构建什么、将学到什么,还会引导用户编写和理解代码,以完成特定任务。
流程
如果您对某个 Codelab 有任何想法,可以通过在 blockly-samples 代码库中发出功能请求告诉我们。添加说明,说明您要教授的内容以及您将在此 Codelab 中构建的内容。我们将讨论并完善该参考提示。
然后,您可以编写出该请求,并为其提交拉取请求。该 APK 通过审核后,Blockly 团队的成员会发布它。
书写提示
本页的其余部分包含一系列提示和问题,可指导您编写 Codelab。
read_more
查看技术写作 One,简要了解技术写作。
受众群体
- 目标读者是谁?
- 他们对使用 Blockly 有哪些了解?
- 他们想要了解什么?
初始设置
如果有帮助,您可以在 examples
目录中发布起始代码和完成后的代码。
结构
与任何写作一样,从大纲入手。对大多数 Codelab 来说,这是一个很好的结构:
- 简介
- 第一步:[请在此处添加标题]
- ...
- 第 10 步:[请在此处输入标题]
- 摘要
- 要点回顾
- 构建内容
- 其他资源
- 指向完成后的代码的链接(如果有)
虽然您可以完成 10 个以上步骤,但如果您达到 20 步,则应考虑将其拆分为两个 Codelab。
写作风格
- 采用对话式的写作风格。
- 使用标题使组织结构清晰明了。
- 使用项目符号列表打破文本的壁垒。
- 使用图片和 GIF!
代码样式
- 您可以使用 ES5、ES6 或 TypeScript 编写代码,但要告诉读取器开头是什么。
- 遵循 Google 风格指南
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["Codelabs are interactive tutorials that use a mix of text, code, and images to teach Blockly concepts."],["Contributing a codelab involves proposing an idea, writing the tutorial following provided guidelines, and submitting it for review and publishing."],["Effective codelabs have a clear structure, including an introduction, step-by-step instructions with explanations and code samples, and a summary."],["When writing a codelab, consider the target audience, necessary setup, and maintain a conversational, organized style with visuals."],["Codelabs can be written in ES5, ES6, or TypeScript, adhering to the Google style guide."]]],["Codelabs, interactive markdown tutorials, are published at blocklycodelabs.dev. To contribute, submit a feature request in the blockly-samples repository with the codelab's content and build. After discussion and refinement, write the codelab and submit a pull request for review and publication. Structure includes an introduction, step-by-step instructions with code samples, and a summary. Focus on a conversational, clear writing style with headings, lists, and visuals, following Google's code style guide.\n"]]