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

Guidelines for the crate level documentation : fixing the inconsistencies #9500

Open
tguichaoua opened this issue Aug 19, 2023 · 3 comments
Open
Labels
A-Meta About the project itself C-Docs An addition or correction to our documentation

Comments

@tguichaoua
Copy link
Contributor

tguichaoua commented Aug 19, 2023

The problem

There is not guidelines on how to make the docs for the internal crates.
#3492 is completed little by little by many people leading to a lot of inconsistency in the documentations.

Here's an example if you search for "prelude" on docs.rs :

image

If we look at the first sentence of the docs they generally mention Bevy, but sometimes it's called "the Bevy game engine" and other times "the game engine Bevy" or just "Bevy".

bevy_math

//! Provides math types and functionality for the Bevy game engine.

bevy_animation

//! Animation for the game engine Bevy

bevy_gizmos

//! This crate adds an immediate mode drawing api to Bevy for visual debugging.

bevy_app

//! This crate is about everything concerning the highest-level, application layer of a Bevy app.

bevy_winit didn't even mention Bevy (also, it's missing a full stop).

//! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`]

bevy_time includes a README

#![doc = include_str!("../README.md")]

Also crate attributes are placed before the docs and sometime after.

#![allow(clippy::type_complexity)]
#![warn(missing_docs)]

Roadmap

  1. Have a discussion to establish rules for documentation and create a guidelines file in the .github/contributing directory.
  2. Open a PR to apply the rules on the existing docs.
  3. Use the guidelines for the future contributions to Tracking issue: deny missing docs, one crate at a time #3492.

Points to discuss

  • The docs on prelude modules
    • Always the same sentence (e.g. Commonly used items)?
    • Use the crate's name (e.g The Bevy Time prelude)? Should the crate's name be CamelCase or snake_case?
  • Crates attributes before or after the crate docs? (I open a discussion on the rust forum with a poll and another one on reddit)
  • Should Bevy be mentionned ? If yes, just Bevy, the Bevy game engine, the game engine Bevy or anything else ? Does it also include a link to the Bevy website?
@tguichaoua tguichaoua added C-Docs An addition or correction to our documentation S-Needs-Triage This issue needs to be labelled labels Aug 19, 2023
@tguichaoua
Copy link
Contributor Author

tguichaoua commented Aug 19, 2023

My point of view on the question :

  • When reading the docs of the main crate all prelude modules are mixed up, so their docs should mention the name of their crate. e.g. The Bevy Time prelude.

  • I prefer put the crates attributes before the docs. But I haven't a strong opinion on this one. This is why I open a poll on the rust forum and on reddit.

If the crate is an extension of the game engine (e.g. bevy_time, bevy_math, etc.) the docs should be something like :

//! Add <list of functionality> functionality to the [Bevy game engine].
//!
//! <more docs here, optional>
//!
//! [Bevy game engine]: https://bevyengine.org/

If the crate adapts an external crate for Bevy (e.g. bevy_winit, bevy_gilrs, etc.) the docs should be something like :

//! Integrates the [`external`] crate to the [Bevy game engine].
//!
//! <more docs here, optional>
//!
//! [`external`]: <the docs.rs url to the external crate>
//! [Bevy game engine]: https://bevyengine.org/

Those rules didn't apply for standalone crates like bevy_reflect.

@alice-i-cecile alice-i-cecile added A-Meta About the project itself and removed S-Needs-Triage This issue needs to be labelled labels Aug 19, 2023
@alice-i-cecile
Copy link
Member

I'm fine to merge consistency PRs (ideally one flavor of fix at a time), but unless we can automatically enforce it we shouldn't make it a "rule".

@alice-i-cecile
Copy link
Member

Always the same sentence (e.g. Commonly used items)?

Sure, I'm happy with that.

Use the crate's name (e.g The Bevy Time prelude)? Should the crate's name be CamelCase or snake_case?

snake_case, with code formatting.

Crates attributes before or after the crate docs? (I open a discussion on the rust forum with a poll and another one on reddit)

Mild preference to after but I don't care.

Should Bevy be mentionned ? If yes, just Bevy, the Bevy game engine, the game engine Bevy or anything else ? Does it also include a link to the Bevy website?

Yes, I think just "the Bevy game engine" is nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Meta About the project itself C-Docs An addition or correction to our documentation
Projects
None yet
Development

No branches or pull requests

2 participants