如何将Rust模块文档保存在单独的Markdown文件中? [英] How is it possible to keep Rust module documentation in separate Markdown files?

查看:189
本文介绍了如何将Rust模块文档保存在单独的Markdown文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rust的本部分本书似乎暗示可以将Rust文档保存在单独的.md文件中,但是并未说明如何将这些.md文件包含回去.如何运作?

This section of the Rust book seems to imply that it is possible to keep Rust documentation in separate .md files, but it does not say how these .md files can then be included back. How does this work?

推荐答案

不是.描述rustdoc功能的那部分说,它可以处理单个.md文件.第三段涉及到这一点:

It doesn't. That section on describing the functionality of rustdoc is saying that it can process individual .md files. The third paragraph touches on this:

可以通过两种方式生成文档:从源代码和独立的Markdown文件.

Documentation can be generated in two ways: from source code, and from standalone Markdown files.

据我所知,目前尚无将代码文档放入外部文件的方法.从理论上讲,可以使用过程派生宏来执行此操作,但是我不知道实际上有哪个板条箱可以执行此操作.

Insofar as I am aware, there is no extant way to put code documentation in external files. It would be theoretically possible to do so using a procedural derive macro, but I'm not aware of any crate that actually does this.

这篇关于如何将Rust模块文档保存在单独的Markdown文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆