doc-comment icon indicating copy to clipboard operation
doc-comment copied to clipboard

Add doc_compile macro to compile external files only.

Open Hexilee opened this issue 4 years ago • 8 comments

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?

Hexilee avatar Apr 01 '20 06:04 Hexilee

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.

GuillaumeGomez avatar Apr 01 '20 07:04 GuillaumeGomez

Thx, I'm going to open an issue.

Hexilee avatar Apr 01 '20 09:04 Hexilee

Thanks!

GuillaumeGomez avatar Apr 01 '20 09:04 GuillaumeGomez

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.

GuillaumeGomez avatar Jul 01 '20 10:07 GuillaumeGomez

Great! Is there some progress?

Hexilee avatar Jul 21 '20 04:07 Hexilee

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. :)

GuillaumeGomez avatar Jul 21 '20 07:07 GuillaumeGomez

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).

Hexilee avatar Jul 21 '20 08:07 Hexilee

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.

GuillaumeGomez avatar Jul 21 '20 08:07 GuillaumeGomez