-
Notifications
You must be signed in to change notification settings - Fork 33
API documentation structure, voice & tone #79
Comments
It's not exactly documentation format or guideline but in general whole HexDocs (Elixir centralized packages documentation) is a great example. Example section: https://hexdocs.pm/elixir/writing-documentation.html |
Format for ExamplesIt would be useful to have a consistent format for code examples. Types of ExamplesLooking through the current documentation, there are several main types of examples. I'm labeling them with letters in parentheses for ease of reference. First, the ones that give results in a comment:
Some examples of this type use
Another major type of example uses equality to show what the result should be:
And these examples also have a
There are some examples that don’t provide any output of the expected result:
And some examples that are nearly full programs, such as this example for
Discussion[This is all opinion. Let me know in responses what you think.] Example (j) doesn’t give the expected output, which might leave the reader in doubt as to what the result should be. Examples (e), (h), and (i) are nice if you want to put the example into a program, run it, and see visible results. I am pretty sure I wrote example (i) for that purpose. The problem is that all you see when you run the program in (h) and (i) is a list of Comparing examples (a), (b), (c), and (d) with examples (f) and (g): it seems that (f) and (g) are more amenable to automated testing. Note the use of pipe first Using
|
I would like to define how the ideal documentation structure, voice and tone for a module & its functions look like.
Ideally this results in a very crisp guide on how to do this. Once this is defined we can focus on aligning all of them. (Aligning them already came up 4 times or so).
If you have ideas or good examples please chime in here as well.
One example for a guide I like is this one: https://package.elm-lang.org/help/documentation-format
The text was updated successfully, but these errors were encountered: