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

Use each crate's README as the root module's rustdocs #460

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jul 7, 2022

At the moment, there is a bit of a gulf between the longer form README documentation we have in the GitHub repo, and the reference documentation shown on docs.rs for each crate.

I believe this leads to people not really looking at docs.rs as much when starting out (particularly if they are less familiar with Rust, so aren't used to checking docs.rs out of habit), making discovery of features and reference examples harder. For example, as seen in:
#366 (comment)
#402

By using the crate READMEs as the rustdocs for each crate's root module, it means the content will show at the top of the crate's docs.rs page - meaning that the docs.rs page then shows all docs, not just the reference docs. We can then pitch the docs.rs page (rather than repo READMEs) as the best entrypoint for documentation - a "one stop shop" for docs if you will.

As an added bonus, our READMEs will now all be linted for markdown and code correctness (and not only libcnb-test's README). (This is why there are a few changes to the repo root README, to fix lint issues.)

GUS-W-11395978.

At the moment, there is a bit of a gulf between the longer form
README documentation we have in the GitHub repo, and the
reference documentation shown on `docs.rs` for each crate.

I believe this leads to people not really looking at `docs.rs` as much
when starting out (particularly if they are less familiar with Rust, so
aren't used to checking it by default), making discovery of features
and reference examples harder. For example, as seen in:
#366 (comment)
#402

By using the crate READMEs as the rustdocs for each crate's root
module, it means the content will show at the top of the crate's
`docs.rs` page - meaning they then show all docs, not just the
reference docs. We can then pitch the `docs.rs` page as the best
entrypoint for documentation, rather than repo READMEs.

As an added bonus, our READMEs will now all be linted for markdown
and code correctness (and not only `libcnb-test`'s README). (This is why
there are a few changes to the repo root README, to fix lint issues.)
@edmorley edmorley self-assigned this Jul 7, 2022
@edmorley edmorley force-pushed the edmorley/readmes-as-module-docs branch from d6837d2 to de8dcd5 Compare July 7, 2022 12:04
@edmorley edmorley marked this pull request as ready for review July 7, 2022 12:08
@edmorley edmorley requested a review from a team as a code owner July 7, 2022 12:08
@edmorley edmorley merged commit e2ec0e3 into main Jul 7, 2022
@edmorley edmorley deleted the edmorley/readmes-as-module-docs branch July 7, 2022 15:05
@edmorley edmorley linked an issue Jul 7, 2022 that may be closed by this pull request
edmorley added a commit that referenced this pull request Jul 14, 2022
Followup to #460.

Previously it was referencing the repo root file, which doesn't exist
when the package is published (since at that point it's no longer in
a monorepo).

Now, the package root `README.md` is used instead, which is a
symlink to the repo root `README.md` in the monorepo, and
when the package is published is the resolved README from:
https://github.com/heroku/libcnb.rs/blob/3c9637e238d23d3fec402f27c81fa8a13b1a5a6d/libcnb/Cargo.toml#L11-L12

The redundant doctest readme include has also been removed.

GUS-W-11395978.
edmorley added a commit that referenced this pull request Jul 14, 2022
Followup to #460.

Previously it was referencing the repo root file, which doesn't exist
when the package is published (since at that point it's no longer in
a monorepo).

Now, the package root `README.md` is used instead, which is a
symlink to the repo root `README.md` in the monorepo, and
when the package is published is the resolved README from:
https://github.com/heroku/libcnb.rs/blob/3c9637e238d23d3fec402f27c81fa8a13b1a5a6d/libcnb/Cargo.toml#L11-L12

The redundant doctest readme include has also been removed.

GUS-W-11395978.
edmorley added a commit that referenced this pull request Jul 20, 2022
Previously the rustdocs for the `libcnb::data` module were
auto-generated, and resulted in:

```
## Modules
build   Provides build phase specific types and helpers.
data    libcnb-data  Docs Latest Version MSRV 
...
```

(where the "Docs Latest Version MSRV" are broken badge links
from `libcnb-data`'s README)

Now the content from the libcnb-data README is overridden,
which results in:

```
## Modules
build   Provides build phase specific types and helpers.
data    Provides types for CNB data formats. Is a re-export of the `libcnb-data` crate.
...
```

Follow-up to #460.
edmorley added a commit that referenced this pull request Jul 20, 2022
Previously the rustdocs for the `libcnb::data` module were
auto-generated, and resulted in:

```
## Modules
build   Provides build phase specific types and helpers.
data    libcnb-data  Docs Latest Version MSRV 
...
```

(where the "Docs Latest Version MSRV" are broken badge links
from `libcnb-data`'s README)

Now the content from the libcnb-data README is overridden,
which results in:

```
## Modules
build   Provides build phase specific types and helpers.
data    Provides types for CNB data formats. Is a re-export of the `libcnb-data` crate.
...
```

Follow-up to #460.
edmorley added a commit that referenced this pull request Sep 23, 2022
edmorley added a commit that referenced this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve discoverability of libcnb-test docs on docs.rs
2 participants