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

doc = include_str! readme #736

Closed
wants to merge 2 commits into from
Closed

doc = include_str! readme #736

wants to merge 2 commits into from

Conversation

clux
Copy link
Member

@clux clux commented Nov 25, 2021

minimal tests for the readme trying to follow: https://blog.guillaume-gomez.fr/articles/2021-08-03+Improvements+for+%23%5Bdoc%5D+attributes+in+Rust

adds a fake module under integration:

/// Doctests for CI
pub mod docs {
    /// Root README.md
    pub mod readme {
        #![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../README.md"))]
    }
}

and then tries to get cargo test --doc --all to not complain

investigation thoughts irrelevant now

it gave me errors when i didn't have enough features on kube in the integration crate where i stashed it, but after that it doesn't complain about anything anymore :(

maybe it just doesn't parse the inline code blocks ...

maybe we need to use doc_comment instead like tokio. that is a heavily deprecated crate though..

EDIT: turns out it "works" with cargo test --doc --all...

minimal tests for the readme.
trying to follow: https://blog.guillaume-gomez.fr/articles/2021-08-03+Improvements+for+%23%5Bdoc%5D+attributes+in+Rust

it captures invalid imports root imports, but not full paths for some
reason. maybe it gets confused with the multiple examples? i tried to
put it in a #![doc] module comment instead, but no change

Signed-off-by: clux <sszynrae@gmail.com>
@clux clux mentioned this pull request Nov 25, 2021
33 tasks
Signed-off-by: clux <sszynrae@gmail.com>
@clux
Copy link
Member Author

clux commented Nov 25, 2021

well, this kind of works now....had to basically do a huge amount of imports in the README to get cargo test --doc --all to like this, and didn't do all of them because you cannot hide the hidden imports and async wrappers in the main github display only inside cargo doc...

thus to actually do this, you would need all async wrappers, join crd examples, and have more imports than example code to have this in the README. and the github view of it would look terrible

don't think this is worth it... probably going to restructure the README at a later time, and move code out of the main README and maybe link directly to docs / examples.

@clux clux added the wontfix This is unlikely to be worked on label Nov 25, 2021
@clux clux closed this Nov 25, 2021
@clux clux deleted the readme-docs branch November 25, 2021 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This is unlikely to be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant