Replies: 1 comment 1 reply
-
Our documentation can and should certainly get improved a lot. When reading this, I initially I thought "why not include those things" After thinking about it a bit more I'm not too sure we should try to explain electronic eginieering things in the API docs. I see how it could improve the onboarding of new users w/o an embedded background but I don't think we can fully explain those things in the API docs and will end up trying in a poor way with lots of inaccuracies. Also, if we start explaining those things here, we probably should continue that and explain I2C protocol, SPI protocol including half-duplex, dual and quad SPI etc. etc. I totally think that linking to e.g. Wikipedia or other resources might be a good idea, however. What I could imagine is to have more background information in e.g. the no_std-training-book (if we want that - but I think of it more like a resource to learn about the APIs). Or even better a more general book which just happens to use That's at least what I think at me moment - I'm happy to hear other's opinions on this But don't get me wrong - we should definitely improve our documentation. |
Beta Was this translation helpful? Give feedback.
-
This is a follow-up to the discussion raised in the recent community meeting.
The esp-rs ecosystems documentation is ripe for applied effort. My initial intent is along the lines of:
For example:
When I came across
fn into_pull_up_input()
I wandered through a maze of interpretations. If you plotted my path through this maze, it would look a bit like a cross between a breadth-first-search and an A* search that was a bit inaccurate in terms of where the destination was:This is a rough representation of how I arrived at how I think about gpio pins now. Now consider this at the top of the gpio module:
...combine that with doc-comments on the functions, such as:
This example intentionally glosses over some of the lower level details, such as why a floating pin isn't normally used, what a pull-up resistor is, why the jargon is the way it is, and is likely to have an experienced embedded developer thinking "duh...". The goal here is to allow the first-time embedded developer to feel like they have the tools to get out of tutorial hell without leaving
docs.rs
, and a foundation on which they can start asking questions like "how does a pull-up-input pin rest in a high state" to start going down that rabbit hole when they are ready.To be clear, this is coming from someone that had a complete lack of familiarity going into these things. Coming to the needed understandings has been productive, and I've benefited greatly from the help recieved in the matrix chat. With that said, I believe the labor needed to absorb and internalise these understandings can be reduced, and here are some ideas on how to think about making this happen:
clippy::missing_docs
lint, and create a macro that can be used as so:#[allow_reason(clippy::missing_docs, "TODO")]
which gets stripped down to a regularallow
. At first, we could just do something like use a tool to automagically allow missing docs, then do ased
to replace the thoseallow
s with#[allow_reason(clippy::missing_docs, "AUTO GENERATED"]
. This will be easy torg
for. At this point, the work needed to pair everything with a good doc-comment (if needed) is clearly laid out, and self-coordinating.docs.rs
a first-class-citizen. This is probably MUCH easier said than done. This might include things like: clicking the source code behaves more like an LSPgoto-definition
in well-configed IDE, instead of taking you to this page, using doc-tests where possible and sensible.ChatGPT4-generated code for the
allow_reason
macro:Beta Was this translation helpful? Give feedback.
All reactions