Title: [Docs] Pull content from README into `lambda-runtime` crate docs / other readmes into other crates · Issue #990 · aws/aws-lambda-rust-runtime · GitHub
Open Graph Title: [Docs] Pull content from README into `lambda-runtime` crate docs / other readmes into other crates · Issue #990 · aws/aws-lambda-rust-runtime
X Title: [Docs] Pull content from README into `lambda-runtime` crate docs / other readmes into other crates · Issue #990 · aws/aws-lambda-rust-runtime
Description: We have a fairly rich README in the repository, but very minimalist lambda-runtime docs (same goes for lambda-extension, but i think lambda-runtime is most important). I know the README already shows in GitHub, and on crates.io, but docs...
Open Graph Description: We have a fairly rich README in the repository, but very minimalist lambda-runtime docs (same goes for lambda-extension, but i think lambda-runtime is most important). I know the README already sho...
X Description: We have a fairly rich README in the repository, but very minimalist lambda-runtime docs (same goes for lambda-extension, but i think lambda-runtime is most important). I know the README already sho...
Opengraph URL: https://github.com/aws/aws-lambda-rust-runtime/issues/990
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Docs] Pull content from README into `lambda-runtime` crate docs / other readmes into other crates","articleBody":"We have a fairly rich README in the repository, but very minimalist `lambda-runtime` docs (same goes for `lambda-extension`, but i think `lambda-runtime` is most important). I know the README already shows in GitHub, and on `crates.io`, but `docs.rs` adds discoverability as well. It gives the impression that the crate is well-maintained (which it is), whereas sparse `docs.rs` docs don't look so great.\n\nEven without a full from-scratch crate docs write, I think it would add a lot of value to make some of the content in the README show up in `docs.rs`. \n\n## How to do it\n### Bad options\n#### Simple `include_str!`\nA simple way to do this would just be to add:\n```\n#![doc = include_str!(\"../../README.md\")]\n```\n\nHowever the first section with all the badges break. So I don't think this is a good option.\n\n#### `include-utils`\nThere is a crate, [include-utils](https://docs.rs/include-utils/latest/include_utils/index.html), that does pretty much exactly what we need. It would allow only including a subset of the file, so we would include everything after the first section.\n\nHowever, it would force a new proc macro-based dependency into our primary dependencies, which I don't love. It also seems maintained but is not widely used.\n\nSo, I don't think this is a great option either.\n\n### Good options\n#### Custom `build.rs` handling to filter the file\nInstead of using the proc macro, we could also just filter the file into what we need via a custom `build.rs`. This is nice too since then we could replace the badges with regular links to the related crates, which would be kind of nice.\n\nThe downside here is a bit of added complexity, but I don't mind knocking it out if desired.\n\n#### Move most of docs into crate docs, use `cargo-readme`\nThe other good option is to flip things around and migrate the source of truth to be the library docs proper. Then the tool [cargo-readme](https://github.com/webern/cargo-readme) lets us generate the markdown `README` from those.\n\nThis has the added benefit of making it really easy to add cross-linking to types and functions inside the crate docs, which is nice.\n\nThe downside is that now we need to generate README changes via an extra build step. I guess we could add a pre-commit hook to do it so that nobody forgets?\n","author":{"url":"https://github.com/jlizen","@type":"Person","name":"jlizen"},"datePublished":"2025-05-08T15:40:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/990/aws-lambda-rust-runtime/issues/990"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b6e4a384-2722-6060-971a-67779222e684 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2CA:5283A:1D80A60:260F025:698BFA7A |
| html-safe-nonce | a8c8f2007ba7a2e87f945bdc29b119fafdcd2982ff46430ed5dd78ba895549a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkNBOjUyODNBOjFEODBBNjA6MjYwRjAyNTo2OThCRkE3QSIsInZpc2l0b3JfaWQiOiI0MzcwOTQ5NzA1OTM4MjM4MDc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a99186bd63c7c02866cb684f42b24788bfd86a80b17ed5e546c21f052e3b9426 |
| hovercard-subject-tag | issue:3049397987 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aws/aws-lambda-rust-runtime/990/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a01c8ade0cbf84c2a07f96299b1188bb2f67c194e8f75df399fa74239c0dcd08/aws/aws-lambda-rust-runtime/issues/990 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a01c8ade0cbf84c2a07f96299b1188bb2f67c194e8f75df399fa74239c0dcd08/aws/aws-lambda-rust-runtime/issues/990 |
| og:image:alt | We have a fairly rich README in the repository, but very minimalist lambda-runtime docs (same goes for lambda-extension, but i think lambda-runtime is most important). I know the README already sho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlizen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/aws/aws-lambda-rust-runtime git https://github.com/aws/aws-lambda-rust-runtime.git |
| octolytics-dimension-user_id | 2232217 |
| octolytics-dimension-user_login | aws |
| octolytics-dimension-repository_id | 156752158 |
| octolytics-dimension-repository_nwo | aws/aws-lambda-rust-runtime |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 156752158 |
| octolytics-dimension-repository_network_root_nwo | aws/aws-lambda-rust-runtime |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width