Section of a markdown file as documentation?

It is possible to include mark down file as documentation attribute with this code:

#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/Readme.md" ) ) ]

Does exist crate which makes possible to select a section to include?

Using include_str! should work, you just might not be able to concatenate the paths like that. Using a relative path instead should work, and is a bit simpler to read.

And no, I don't believe there's a way of only including a certain section (at least not with what's built into std).

1 Like

Problem to select a section of an md file instead of including the whole file. Do you know such crate?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.