Skip to content

Consider using mdbook's include anchors feature for some examples #289

Open
@JohnTitor

Description

@JohnTitor

@ehuss suggested in #288 (review):

One possible option in the future is to use {{#rustdoc_include}} (along with mdbook's include anchors), and place the sample code in a separate directory where it can be more thoroughly tested. I notice there are huge chunks of code that aren't tested at all, which means there is a good likelihood that it contains errors, or may become incorrect in the future. TRPL is written this way. A big downside is that it becomes more difficult to edit/read the markdown source since the examples are in a separate file, so it is tough to decide if that is worth it.

I think at least examples using libc crate should be considered here. They're ignored just because requiring an external crate but it would be easy to test if we had it.
And some longer examples could also be moved to the external directory to shrink markdown files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions