-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose generated modules as public #32
Comments
I'm a bit lost. Your content from #[cfg(doctest)]
pub struct User {
username: Strin
} Then you can use this type in other (doc) tests. PS: I loved the reference to Gaston Lagaffe. Really loved this comic. :) |
Right, I think I had the wrong image of how the macro works in my mind. The snippet you shared would still have to reside in a Rad that you liked Gaston as well :) |
It doesn't need to reside in a If you want to concatenate files, you can always do something like this (I think it works, to be confirmed): #[cfg(doctest)]
doc_comment!(concat!(include_str!("file1.md"), include_str!("file2.md"))); |
Now I'm a bit lost - since markdown files included via |
If your markdown file look like this: pub struct Something; Then you can also include this as rust source code since it's literally rust source code. |
Oh I see, but this would prohibit writing text as usual in that markdown file, right? Something like this: See the following struct as an example:
pub struct Something;
More documentation text here If this is not possible, why use markdown at this point? Since you're syntactically bound to rust, you might as well write a normal rust module. |
Well, I don't get why you want to do that in the first place so... |
I have a snippet like this:
Included using doctest like this:
Now in the same
users.md
file, I'd like to reference theUser
struct from another code block like so:This seems to almost work, except the module generated by doc_comment is not marked as
pub
and thus not accessible from other modules. Could you imagine adding a way to expose the module? How would you go about implementing this?The text was updated successfully, but these errors were encountered: