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

Why is there a src/lib.rs file with only comments? #11

Closed
shawntabrizi opened this issue Aug 3, 2024 · 3 comments · Fixed by paritytech/polkadot-sdk#5330
Closed

Why is there a src/lib.rs file with only comments? #11

shawntabrizi opened this issue Aug 3, 2024 · 3 comments · Fixed by paritytech/polkadot-sdk#5330

Comments

@shawntabrizi
Copy link
Member

https://github.com/paritytech/polkadot-sdk-minimal-template/blob/master/src/lib.rs

Why does this file exist in the template?

@rzadp
Copy link
Contributor

rzadp commented Aug 5, 2024

These are the docs following the sentiment to use rustdoc and keep readmes as a light intro.
(The readme has been improved a bit since then, but lib.rs stayed as is).

However it doesn't quite work here because the package gets replaced with a workspace root. And the template crates are not published to any registry, so there is no way to read those rustdocs without cloning the repo (e.g. on mobile).

So for these reasons I think templates should be the exception and avoid rustdocs for introductory documentation, instead have it right in the readme - so we can remove lib.rs (or integrate into the readme file).

@gupnik Do you agree with that?

@shawntabrizi
Copy link
Member Author

I agree, if your auto-generation process can remove this, it makes sense to me.

@kianenigma
Copy link
Collaborator

the only place they can be seen is in https://paritytech.github.io/polkadot-sdk/master/minimal_template/index.html

I think these were added when the template had no good readme. Now that it has, they can be removed, or bere a mere duplicate of the readme include_str!("./README.md").

github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Aug 16, 2024
This removes the workspace of the minimal template, which (I think) is
redundant. The other two templates do not have such a workspace.

The synchronized template created [it's own
workspace](https://github.com/paritytech/polkadot-sdk-minimal-template/blob/master/Cargo.toml)
anyway, and the new readme replaced the old docs contained in `lib.rs`.

Closes
paritytech/polkadot-sdk-minimal-template#11

Silent because the crate was private.
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

Successfully merging a pull request may close this issue.

3 participants