Skip to content
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

Add doc_compile macro to compile external files only. #20

Open
Hexilee opened this issue Apr 1, 2020 · 8 comments
Open

Add doc_compile macro to compile external files only. #20

Hexilee opened this issue Apr 1, 2020 · 8 comments

Comments

@Hexilee
Copy link

Hexilee commented Apr 1, 2020

I want to guarantee all examples in external files can pass compiling.

The main reason not to add no_run for each block is many markdown renders cannot correctly recognize a "rust,no_run" block.

So, is there any macro or attribute to set global no_run?

@GuillaumeGomez
Copy link
Owner

I don't recall rustdoc having such an option. I'd suggest you to open an issue on the rust repository so it can be added.

@Hexilee
Copy link
Author

Hexilee commented Apr 1, 2020

Thx, I'm going to open an issue.

@GuillaumeGomez
Copy link
Owner

Thanks!

@GuillaumeGomez
Copy link
Owner

Since #21, this crate is using proc-macro. So we could now set a global option to be used in all codeblocks put into the macro.

@Hexilee
Copy link
Author

Hexilee commented Jul 21, 2020

Great! Is there some progress?

@GuillaumeGomez
Copy link
Owner

Not yet, I need to finish the update to proc-macro. And once done, it'll only work on nightly. Not sure this is what most users want for now. :)

@Hexilee
Copy link
Author

Hexilee commented Jul 21, 2020

I don't think it's a big problem as we can use cfg_attr to optionally enable it (and external_doc is also a nightly only feature).

@GuillaumeGomez
Copy link
Owner

No I mean, to finish the switch to proc-macro, which all the crate will rely upon, I need features which are nightly-only for the moment. This is why I didn't finish it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants