Teaching by leo-editor

60 阅读1分钟

Write code

When writing code, it is often necessary to add a lot of explanatory text. The commonly adopted approach is to directly write single-line comments or a large number of block comments in the code.

If these comments in the code could be formatted like an article, the effect would be much better.

在编写代码时,往往需要加入很多说明文字,经常采用的方式是直接在代码里写单行注释或者大量块注释。

如果代码里的这些注释能够有像文章一样的排版体现,效果就会好很多。

Write document

Teaching documents are typically presented in the form of PowerPoint (PPT) files. However, PPTs are generally used for summarizing and presenting information during live sessions and should be complemented by detailed Word or Markdown files to serve as practical operational aids.

In programming-related teaching materials, the primary source code of demonstration programs is usually included. Typically, the relevant portions of the source code are copied into the documentation. This practice introduces the challenge of ensuring that the documentation is promptly updated whenever changes are made to the source code.

Therefore, if a method could be devised to write the source code concurrently with the documentation, a significant amount of repetitive labor and time could be saved.

教学文档通常为 ppt 文件,但是 ppt 一般做为临场提纲挈领的演示,需要再配合详尽的 word 或者 markdown 文件来作为实操辅助。

在编程的教学文档里,会包含演示程序的主要源代码。通常会把需要的部分源代码复制到文档里。这样就存在源代码更改后需要再及时更改文档的问题。

所以如果能够在编写文档的同时编写源代码,将会节省大量重复劳动的时间。


使用 plantuml 直接画图的例子:不用在外部画好图再导入了。

image.png

文档与代码在一起,可以导出为 pdf 或者 html。

image.png